From 627061d1903b254314e28a5409f1c9d8b4d75d77 Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Sun, 31 May 2020 23:00:38 -0400 Subject: [PATCH] Add ocltst build files Change-Id: I8fcff320efb677a5efa5ee48efe1a6bbb259539f [ROCm/clr commit: 15b318b444369406bd44f2097ff2c7514069a309] --- projects/clr/opencl/CMakeLists.txt | 4 + .../clr/opencl/tests/ocltst/CMakeLists.txt | 13 +++ .../opencl/tests/ocltst/env/CMakeLists.txt | 28 +++++ .../opencl/tests/ocltst/log/CMakeLists.txt | 14 +++ .../tests/ocltst/module/common/CMakeLists.txt | 31 ++++++ .../tests/ocltst/module/gl/CMakeLists.txt | 39 +++++++ .../tests/ocltst/module/perf/CMakeLists.txt | 101 ++++++++++++++++++ .../ocltst/module/runtime/CMakeLists.txt | 74 +++++++++++++ 8 files changed, 304 insertions(+) create mode 100644 projects/clr/opencl/tests/ocltst/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/env/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/log/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/module/common/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt create mode 100644 projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt index 4ddbccb8af..e123df4914 100644 --- a/projects/clr/opencl/CMakeLists.txt +++ b/projects/clr/opencl/CMakeLists.txt @@ -23,6 +23,7 @@ if(DEFINED USE_COMGR_LIBRARY) endif() option(USE_COMGR_LIBRARY "Use comgr library" ON) +option(BUILD_TESTS "Enable building OpenCL tests" OFF) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) @@ -51,6 +52,9 @@ add_subdirectory(khronos/icd) add_subdirectory(amdocl) add_subdirectory(tools/clinfo) add_subdirectory(tools/cltrace) +if(BUILD_TESTS) + add_subdirectory(tests/ocltst) +endif() if(USE_COMGR_LIBRARY) include_directories("$") diff --git a/projects/clr/opencl/tests/ocltst/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/CMakeLists.txt new file mode 100644 index 0000000000..d455088f82 --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.5.1) + +set(OCLTST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + +find_package(OpenGL REQUIRED) +find_package(GLEW REQUIRED) + +add_subdirectory(module/common) +add_subdirectory(log) +add_subdirectory(env) +add_subdirectory(module/gl) +add_subdirectory(module/perf) +add_subdirectory(module/runtime) diff --git a/projects/clr/opencl/tests/ocltst/env/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/env/CMakeLists.txt new file mode 100644 index 0000000000..50f94abaa3 --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/env/CMakeLists.txt @@ -0,0 +1,28 @@ +add_executable(ocltst + ${OCLTST_DIR}/env/oclsysinfo.cpp + ${OCLTST_DIR}/env/ocltst.cpp + ${OCLTST_DIR}/env/pfm.cpp + ${OCLTST_DIR}/env/Timer.cpp + ${OCLTST_DIR}/module/common/BaseTestImp.cpp + ${OCLTST_DIR}/module/common/OCLTestImp.cpp + ${OCLTST_DIR}/module/common/OCLThread.cpp + ${OCLTST_DIR}/module/common/OCLWrapper.cpp) + +set_target_properties(ocltst PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst) + +target_compile_definitions(ocltst + PRIVATE + $) + +target_include_directories(ocltst + PRIVATE + $) + +target_link_libraries(ocltst + PRIVATE + OpenCL + TestLog) diff --git a/projects/clr/opencl/tests/ocltst/log/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/log/CMakeLists.txt new file mode 100644 index 0000000000..23fc37bdbe --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/log/CMakeLists.txt @@ -0,0 +1,14 @@ +add_library(TestLog SHARED + ${OCLTST_DIR}/log/oclTestLog.cpp) + +set_target_properties(TestLog PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst) + +target_include_directories(TestLog + PRIVATE + ${OCLTST_DIR}/include + PUBLIC + ${OCLTST_DIR}/log) diff --git a/projects/clr/opencl/tests/ocltst/module/common/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/common/CMakeLists.txt new file mode 100644 index 0000000000..307db89f8b --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/module/common/CMakeLists.txt @@ -0,0 +1,31 @@ +add_library(Common OBJECT + ${OCLTST_DIR}/module/common/BaseTestImp.cpp + ${OCLTST_DIR}/module/common/OCLGLCommon.cpp + ${OCLTST_DIR}/module/common/OCLGLCommonLinux.cpp + ${OCLTST_DIR}/module/common/OCLTestImp.cpp + ${OCLTST_DIR}/module/common/OCLTestListImp.cpp + ${OCLTST_DIR}/module/common/OCLTestUtils.cpp + ${OCLTST_DIR}/module/common/OCLThread.cpp + ${OCLTST_DIR}/module/common/OCLWrapper.cpp + ${OCLTST_DIR}/module/common/Timer.cpp) + +set_target_properties(Common PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + POSITION_INDEPENDENT_CODE ON) + +target_compile_definitions(Common + PUBLIC + ATI_OS_LINUX + CL_TARGET_OPENCL_VERSION=220) + +target_include_directories(Common + PUBLIC + ${OPENCL_ICD_LOADER_HEADERS_DIR} + ${OPENGL_INCLUDE_DIR} + ${GLEW_INCLUDE_DIRS} + ${OCLTST_DIR}/include + ${OCLTST_DIR}/module/common + ${OCLTST_DIR}/module/include + ${PROJECT_SOURCE_DIR}/amdocl) #TODO remove cl_profile_amd.h dependency diff --git a/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt new file mode 100644 index 0000000000..8b5703575d --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt @@ -0,0 +1,39 @@ +add_library(oclgl SHARED + OCLGLBuffer.cpp + OCLGLBufferMultipleQueues.cpp + OCLGLDepthBuffer.cpp + OCLGLDepthTex.cpp + OCLGLFenceSync.cpp + OCLGLMsaaTexture.cpp + OCLGLMultiContext.cpp + OCLGLTexture.cpp + TestList.cpp + $) + +set_target_properties(oclgl PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst) + +target_compile_definitions(oclgl + PRIVATE + $) + +target_include_directories(oclgl + PRIVATE + $) + +target_link_libraries(oclgl + PRIVATE + OpenCL + ${GLEW_LIBRARIES} + ${OPENGL_LIBRARIES}) + +add_custom_command( + TARGET oclgl POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/oclgl.exclude + ${CMAKE_BINARY_DIR}/tests/ocltst/ogl.exclude) + +add_dependencies(ocltst oclgl) diff --git a/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt new file mode 100644 index 0000000000..deba448506 --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt @@ -0,0 +1,101 @@ +add_library(oclperf SHARED + OCLPerf3DImageWriteSpeed.cpp + OCLPerfAES256.cpp + OCLPerfAtomicSpeed20.cpp + OCLPerfAtomicSpeed.cpp + OCLPerfBufferCopyOverhead.cpp + OCLPerfBufferCopySpeed.cpp + OCLPerfBufferReadSpeed.cpp + OCLPerfBufferWriteSpeed.cpp + OCLPerfCommandQueue.cpp + OCLPerfConcurrency.cpp + OCLPerfCPUMemSpeed.cpp + OCLPerfDeviceConcurrency.cpp + OCLPerfDeviceEnqueue2.cpp + OCLPerfDeviceEnqueue.cpp + OCLPerfDeviceEnqueueEvent.cpp + OCLPerfDeviceEnqueueSier.cpp + OCLPerfDevMemReadSpeed.cpp + OCLPerfDevMemWriteSpeed.cpp + OCLPerfDispatchSpeed.cpp + OCLPerfDoubleDMA.cpp + OCLPerfDoubleDMASeq.cpp + OCLPerfFillBuffer.cpp + OCLPerfFillImage.cpp + OCLPerfFlush.cpp + OCLPerfGenericBandwidth.cpp + OCLPerfGenoilSiaMiner.cpp + OCLPerfImageCopyCorners.cpp + OCLPerfImageCopySpeed.cpp + OCLPerfImageCreate.cpp + OCLPerfImageMapUnmap.cpp + OCLPerfImageReadSpeed.cpp + OCLPerfImageReadsRGBA.cpp + OCLPerfImageReadWrite.cpp + OCLPerfImageSampleRate.cpp + OCLPerfImageWriteSpeed.cpp + OCLPerfKernelArguments.cpp + OCLPerfKernelThroughput.cpp + OCLPerfLDSLatency.cpp + OCLPerfLDSReadSpeed.cpp + OCLPerfMandelbrot.cpp + OCLPerfMapBufferReadSpeed.cpp + OCLPerfMapBufferWriteSpeed.cpp + OCLPerfMapImageReadSpeed.cpp + OCLPerfMapImageWriteSpeed.cpp + OCLPerfMatrixTranspose.cpp + OCLPerfMemCombine.cpp + OCLPerfMemCreate.cpp + OCLPerfMemLatency.cpp + OCLPerfPinnedBufferReadSpeed.cpp + OCLPerfPinnedBufferWriteSpeed.cpp + OCLPerfPipeCopySpeed.cpp + OCLPerfProgramGlobalRead.cpp + OCLPerfProgramGlobalWrite.cpp + OCLPerfSampleRate.cpp + OCLPerfScalarReplArrayElem.cpp + OCLPerfSdiP2PCopy.cpp + OCLPerfSepia.cpp + OCLPerfSHA256.cpp + OCLPerfSVMAlloc.cpp + OCLPerfSVMKernelArguments.cpp + OCLPerfSVMMap.cpp + OCLPerfSVMMemcpy.cpp + OCLPerfSVMMemFill.cpp + OCLPerfSVMSampleRate.cpp + OCLPerfTextureMemLatency.cpp + OCLPerfUAVReadSpeed.cpp + OCLPerfUAVReadSpeedHostMem.cpp + OCLPerfUAVWriteSpeedHostMem.cpp + OCLPerfUncoalescedRead.cpp + OCLPerfVerticalFetch.cpp + TestList.cpp + $) + +set_target_properties(oclperf PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst) + +target_compile_definitions(oclperf + PRIVATE + $) + +target_include_directories(oclperf + PRIVATE + $) + +target_link_libraries(oclperf + PRIVATE + OpenCL + ${GLEW_LIBRARIES} + ${OPENGL_LIBRARIES}) + +add_custom_command( + TARGET oclperf POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/oclperf.exclude + ${CMAKE_BINARY_DIR}/tests/ocltst/oclperf.exclude) + +add_dependencies(ocltst oclperf) diff --git a/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt new file mode 100644 index 0000000000..af46e347ed --- /dev/null +++ b/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt @@ -0,0 +1,74 @@ +add_library(oclruntime SHARED + OCLAsyncMap.cpp + OCLAsyncTransfer.cpp + OCLAtomicCounter.cpp + OCLBlitKernel.cpp + OCLBufferFromImage.cpp + OCLCPUGuardPages.cpp + OCLCreateBuffer.cpp + OCLCreateContext.cpp + OCLCreateImage.cpp + OCLDeviceAtomic.cpp + OCLDeviceQueries.cpp + OCLDynamic.cpp + OCLDynamicBLines.cpp + OCLGenericAddressSpace.cpp + OCLGetQueueThreadID.cpp + OCLGlobalOffset.cpp + OCLImage2DFromBuffer.cpp + OCLImageCopyPartial.cpp + OCLKernelBinary.cpp + OCLLDS32K.cpp + OCLLinearFilter.cpp + OCLLiquidFlash.cpp + OCLMapCount.cpp + OCLMemDependency.cpp + OCLMemObjs.cpp + OCLMemoryInfo.cpp + OCLMultiQueue.cpp + OCLOfflineCompilation.cpp + OCLP2PBuffer.cpp + OCLPartialWrkgrp.cpp + OCLPerfCounters.cpp + OCLPersistent.cpp + OCLPinnedMemory.cpp + OCLPlatformAtomics.cpp + OCLProgramScopeVariables.cpp + OCLReadWriteImage.cpp + OCLRTQueue.cpp + OCLSDI.cpp + OCLSemaphore.cpp + OCLStablePState.cpp + OCLSVM.cpp + OCLThreadTrace.cpp + OCLUnalignedCopy.cpp + TestList.cpp + $) + +set_target_properties(oclruntime PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED ON + CXX_EXTENSIONS OFF + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst) + +target_compile_definitions(oclruntime + PRIVATE + $) + +target_include_directories(oclruntime + PRIVATE + $) + +target_link_libraries(oclruntime + PRIVATE + OpenCL + ${GLEW_LIBRARIES} + ${OPENGL_LIBRARIES}) + +add_custom_command( + TARGET oclruntime POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/oclruntime.exclude + ${CMAKE_BINARY_DIR}/tests/ocltst/oclruntime.exclude) + +add_dependencies(ocltst oclruntime)