From 0611a0502aeedee73b7dbc8c53f871b327d2d3a9 Mon Sep 17 00:00:00 2001 From: Vlad Sytchenko Date: Mon, 6 Jul 2020 15:56:46 -0400 Subject: [PATCH] Add ability to run each ocltst test individually Now one can run a single test by invoking `make test.ocltst.${module_name}.${test_name}`. Invoking `make test.ocltst.${module_name}` will still run all of the modules tests. Change-Id: I31b384576cb09800e580e41c12528a276899b6c2 Signed-off-by: Vlad Sytchenko [ROCm/clr commit: 3be244fb34dbdbae1a00b7c670942142d4d29003] --- .../tests/ocltst/module/gl/CMakeLists.txt | 41 ++-- .../tests/ocltst/module/perf/CMakeLists.txt | 178 ++++++++++-------- .../ocltst/module/runtime/CMakeLists.txt | 111 ++++++----- 3 files changed, 192 insertions(+), 138 deletions(-) diff --git a/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt index b0c213b099..240f5fe31a 100644 --- a/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt +++ b/projects/clr/opencl/tests/ocltst/module/gl/CMakeLists.txt @@ -1,15 +1,24 @@ +set(TESTS + OCLGLBuffer + OCLGLBufferMultipleQueues + OCLGLDepthBuffer + OCLGLDepthTex + OCLGLFenceSync + OCLGLMsaaTexture + OCLGLMultiContext + OCLGLTexture +) + add_library(oclgl SHARED - OCLGLBuffer.cpp - OCLGLBufferMultipleQueues.cpp - OCLGLDepthBuffer.cpp - OCLGLDepthTex.cpp - OCLGLFenceSync.cpp - OCLGLMsaaTexture.cpp - OCLGLMultiContext.cpp - OCLGLTexture.cpp TestList.cpp $) +foreach(TEST ${TESTS}) + target_sources(oclgl + PRIVATE + ${TEST}.cpp) +endforeach() + set_target_properties(oclgl PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON @@ -37,9 +46,7 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/oclgl.exclude ${CMAKE_BINARY_DIR}/tests/ocltst/ogl.exclude) -add_dependencies(ocltst oclgl) - -add_custom_target(test_oclgl +add_custom_target(test.ocltst.oclgl COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $ -m $ -A oclgl.exclude @@ -48,3 +55,15 @@ add_custom_target(test_oclgl WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst USES_TERMINAL) + +foreach(TEST ${TESTS}) + add_custom_target(test.ocltst.oclgl.${TEST} + COMMAND + ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" + $ -m $ -t ${TEST} + DEPENDS + ocltst oclgl amdocl64 + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR}/tests/ocltst + USES_TERMINAL) +endforeach() diff --git a/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt index f9d3334fce..b1a01d9218 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt +++ b/projects/clr/opencl/tests/ocltst/module/perf/CMakeLists.txt @@ -1,85 +1,91 @@ -set(OCLPERF_SOURCES - 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 - 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) - -if(OPENGL_FOUND AND GLEW_FOUND) - set(OCLPERF_SOURCES - ${OCLPERF_SOURCES} - OCLPerfSepia.cpp) -endif() +set(TESTS + OCLPerf3DImageWriteSpeed + OCLPerfAES256 + OCLPerfAtomicSpeed20 + OCLPerfAtomicSpeed + OCLPerfBufferCopyOverhead + OCLPerfBufferCopySpeed + OCLPerfBufferReadSpeed + OCLPerfBufferWriteSpeed + OCLPerfCommandQueue + OCLPerfConcurrency + OCLPerfCPUMemSpeed + OCLPerfDeviceConcurrency + OCLPerfDeviceEnqueue + OCLPerfDeviceEnqueue2 + OCLPerfDeviceEnqueueEvent + OCLPerfDeviceEnqueueSier + OCLPerfDevMemReadSpeed + OCLPerfDevMemWriteSpeed + OCLPerfDispatchSpeed + OCLPerfDoubleDMA + OCLPerfDoubleDMASeq + OCLPerfFillBuffer + OCLPerfFillImage + OCLPerfFlush + OCLPerfGenericBandwidth + OCLPerfGenoilSiaMiner + OCLPerfImageCopyCorners + OCLPerfImageCopySpeed + OCLPerfImageCreate + OCLPerfImageMapUnmap + OCLPerfImageReadSpeed + OCLPerfImageReadsRGBA + OCLPerfImageReadWrite + OCLPerfImageSampleRate + OCLPerfImageWriteSpeed + OCLPerfKernelArguments + OCLPerfKernelThroughput + OCLPerfLDSLatency + OCLPerfLDSReadSpeed + OCLPerfMandelbrot + OCLPerfMapBufferReadSpeed + OCLPerfMapBufferWriteSpeed + OCLPerfMapImageReadSpeed + OCLPerfMapImageWriteSpeed + OCLPerfMatrixTranspose + OCLPerfMemCombine + OCLPerfMemCreate + OCLPerfMemLatency + OCLPerfPinnedBufferReadSpeed + OCLPerfPinnedBufferWriteSpeed + OCLPerfPipeCopySpeed + OCLPerfProgramGlobalRead + OCLPerfProgramGlobalWrite + OCLPerfSampleRate + OCLPerfScalarReplArrayElem + OCLPerfSdiP2PCopy + OCLPerfSHA256 + OCLPerfSVMAlloc + OCLPerfSVMKernelArguments + OCLPerfSVMMap + OCLPerfSVMMemcpy + OCLPerfSVMMemFill + OCLPerfSVMSampleRate + OCLPerfTextureMemLatency + OCLPerfUAVReadSpeed + OCLPerfUAVReadSpeedHostMem + OCLPerfUAVWriteSpeedHostMem + OCLPerfUncoalescedRead + OCLPerfVerticalFetch +) add_library(oclperf SHARED - ${OCLPERF_SOURCES} + TestList.cpp $) +foreach(TEST ${TESTS}) + target_sources(oclperf + PRIVATE + ${TEST}.cpp) +endforeach() + +if(OPENGL_FOUND AND GLEW_FOUND) + target_sources(oclperf + PRIVATE + OCLPerfSepia.cpp) +endif() + set_target_properties(oclperf PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON @@ -112,9 +118,7 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/oclperf.exclude ${CMAKE_BINARY_DIR}/tests/ocltst/oclperf.exclude) -add_dependencies(ocltst oclperf) - -add_custom_target(test_oclperf +add_custom_target(test.ocltst.oclperf COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $ -m $ -A oclperf.exclude @@ -123,3 +127,15 @@ add_custom_target(test_oclperf WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst USES_TERMINAL) + +foreach(TEST ${TESTS}) + add_custom_target(test.ocltst.oclperf.${TEST} + COMMAND + ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" + $ -m $ -t ${TEST} + DEPENDS + ocltst oclperf amdocl64 + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR}/tests/ocltst + USES_TERMINAL) +endforeach() diff --git a/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt b/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt index 4de6a8cc70..91d82d22c5 100644 --- a/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt +++ b/projects/clr/opencl/tests/ocltst/module/runtime/CMakeLists.txt @@ -1,50 +1,59 @@ +set(TESTS + OCLAsyncMap + OCLAsyncTransfer + OCLAtomicCounter + OCLBlitKernel + OCLBufferFromImage + OCLCPUGuardPages + OCLCreateBuffer + OCLCreateContext + OCLCreateImage + OCLDeviceAtomic + OCLDeviceQueries + OCLDynamic + OCLDynamicBLines + OCLGenericAddressSpace + OCLGetQueueThreadID + OCLGlobalOffset + OCLImage2DFromBuffer + OCLImageCopyPartial + OCLKernelBinary + OCLLDS32K + OCLLinearFilter + OCLLiquidFlash + OCLMapCount + OCLMemDependency + OCLMemObjs + OCLMemoryInfo + OCLMultiQueue + OCLOfflineCompilation + OCLP2PBuffer + OCLPartialWrkgrp + OCLPerfCounters + OCLPersistent + OCLPinnedMemory + OCLPlatformAtomics + OCLProgramScopeVariables + OCLReadWriteImage + OCLRTQueue + OCLSDI + OCLSemaphore + OCLStablePState + OCLSVM + OCLThreadTrace + OCLUnalignedCopy +) + 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 $) +foreach(TEST ${TESTS}) + target_sources(oclruntime + PRIVATE + ${TEST}.cpp) +endforeach() + set_target_properties(oclruntime PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON @@ -77,9 +86,7 @@ add_custom_command( ${CMAKE_CURRENT_SOURCE_DIR}/oclruntime.exclude ${CMAKE_BINARY_DIR}/tests/ocltst/oclruntime.exclude) -add_dependencies(ocltst oclruntime) - -add_custom_target(test_oclruntime +add_custom_target(test.ocltst.oclruntime COMMAND ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" $ -m $ -A oclruntime.exclude @@ -88,3 +95,15 @@ add_custom_target(test_oclruntime WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/ocltst USES_TERMINAL) + +foreach(TEST ${TESTS}) + add_custom_target(test.ocltst.oclruntime.${TEST} + COMMAND + ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib:$ENV{LD_LIBRARY_PATH}" + $ -m $ -t ${TEST} + DEPENDS + ocltst oclruntime amdocl64 + WORKING_DIRECTORY + ${CMAKE_BINARY_DIR}/tests/ocltst + USES_TERMINAL) +endforeach()