diff --git a/projects/clr/hipamd/tests/README.md b/projects/clr/hipamd/tests/README.md index d7ddf0ea68..c762b09ceb 100644 --- a/projects/clr/hipamd/tests/README.md +++ b/projects/clr/hipamd/tests/README.md @@ -14,16 +14,28 @@ $ make test ### How to add a new test -The tests/src/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests. +The tests/src/runtimeApi/memory/hipMemtest.cpp file contains a simple unit test and is a good starting point for other tests. Copy this to a new test name and modify tests/src/CMakefiles.txt to add the test to the build environment. +Recent versions of the test infrastructure use a hierarchy of folders. Each folder contains src and CMakefiles.txt file. +See the CMakefiles.txt files for description of the intended purpose for each sub-directory. + + #### Edit CMakefiles.txt: // Example: ``` -make_hip_executable (hipMemset hipMemset.cpp) +# Build the test executable: +build_hip_executable (hipMemset hipMemset.cpp) + + +# This runs the tests with the specified command-line testing. +# Multiple make_test may be specified. make_test(hipMemset " ") ``` +It is recommended to place the build and run steps adjacent in the CMakefiles.txt. + + ### Running tests: ``` ctest diff --git a/projects/clr/hipamd/tests/src/CMakeLists.txt b/projects/clr/hipamd/tests/src/CMakeLists.txt index 60e0472292..aa63a2a91a 100644 --- a/projects/clr/hipamd/tests/src/CMakeLists.txt +++ b/projects/clr/hipamd/tests/src/CMakeLists.txt @@ -8,6 +8,8 @@ endif() set (HIPCC ${HIP_PATH}/bin/hipcc) set (CMAKE_CXX_COMPILER ${HIPCC}) +message (CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER} ) + project (HIP_Unit_Tests) include(CTest) @@ -87,8 +89,8 @@ endif() add_library(test_common OBJECT test_common.cpp ) -# usage : make_hip_executable (exe_name CPP_FILES) -macro (make_hip_executable exe cpp) +# usage : build_hip_executable (exe_name CPP_FILES) +macro (build_hip_executable exe cpp) if (${HIP_PLATFORM} STREQUAL "hcc") if (${HIP_BUILD_LOCAL}) #target_link_libraries(${exe} hip_hcc) @@ -103,8 +105,8 @@ endmacro() # Make a hip executable, using libc++ -macro (make_hip_executable_libcpp exe cpp) - make_hip_executable( ${exe} ${cpp} ${ARGN} ) +macro (build_hip_executable_libcpp exe cpp) + build_hip_executable( ${exe} ${cpp} ${ARGN} ) if (${HIP_PLATFORM} STREQUAL "hcc") set_source_files_properties (${cpp} i${ARGN} PROPERTIES COMPILE_FLAGS --stdlib=libc++ ) endif() @@ -121,7 +123,7 @@ endfunction() macro (make_test exe ) string (REPLACE " " "" smush_args ${ARGN}) - set (testname ${exe}${smush_args}.tst) + set (testname ${PROJECT_NAME}/${exe}${smush_args}.tst) make_named_test(${exe} ${testname} ${ARGN}) endmacro() @@ -148,111 +150,52 @@ macro (make_test_matches exe match_string) ) endmacro() -macro (make_hip_executable_ldg exe cpp) - if (${HIP_PLATFORM} STREQUAL "hcc") - make_hip_executable( ${exe} ${cpp} ${ARGN} ) -else () -make_hip_executable( ${exe} ${cpp} ${ARGN} ) +macro (build_hip_executable_sm35 exe cpp) + build_hip_executable( ${exe} ${cpp} ${ARGN} ) + if (${HIP_PLATFORM} STREQUAL "nvcc") set_source_files_properties (${cpp} i${ARGN} PROPERTIES COMPILE_FLAGS --gpu-architecture=sm_35 ) -endif() + endif() endmacro() -#make_hip_executable (hipAPIStreamEnable hipAPIStreamEnable.cpp) -#make_hip_executable (hipAPIStreamDisable hipAPIStreamDisable.cpp) -make_hip_executable (hip_ballot hip_ballot.cpp) -make_hip_executable (hip_anyall hip_anyall.cpp) -make_hip_executable (hip_popc hip_popc.cpp) -make_hip_executable (hip_clz hip_clz.cpp) -make_hip_executable (hip_brev hip_brev.cpp) -make_hip_executable (hip_ffs hip_ffs.cpp) -make_hip_executable_ldg (hip_test_ldg hip_test_ldg.cpp) -make_hip_executable (hipGetDeviceAttribute hipGetDeviceAttribute.cpp) -make_hip_executable (hipEnvVar hipEnvVar.cpp) -make_hip_executable (hipEnvVarDriver hipEnvVarDriver.cpp) -make_hip_executable (hipMemcpy_simple hipMemcpy_simple.cpp) -make_hip_executable (hipMemcpy hipMemcpy.cpp) -make_hip_executable (hipMemcpyAsync hipMemcpyAsync.cpp) -make_hip_executable (hipMemset hipMemset.cpp) -make_hip_executable (hipEventRecord hipEventRecord.cpp) -make_hip_executable_libcpp (hipLanguageExtensions hipLanguageExtensions.cpp) -make_hip_executable (hipGridLaunch hipGridLaunch.cpp) +build_hip_executable (hipGetDeviceAttribute hipGetDeviceAttribute.cpp) +build_hip_executable (hipEnvVar hipEnvVar.cpp) +build_hip_executable (hipEnvVarDriver hipEnvVarDriver.cpp) +build_hip_executable (hipEventRecord hipEventRecord.cpp) -make_hip_executable_libcpp (hipHcc hipHcc.cpp) +build_hip_executable_libcpp (hipHcc hipHcc.cpp) #set_source_files_properties (hipHcc.cpp PROPERTIES COMPILE_FLAGS --stdlib=libc++ ) -make_hip_executable (hipSimpleAtomicsTest hipSimpleAtomicsTest.cpp) -make_hip_executable (hipMathFunctionsHost hipMathFunctions.cpp hipSinglePrecisionMathHost.cpp hipDoublePrecisionMathHost.cpp) -make_hip_executable (hipMathFunctionsDevice hipMathFunctions.cpp hipSinglePrecisionMathDevice.cpp hipDoublePrecisionMathDevice.cpp) -make_hip_executable (hipIntrinsics hipMathFunctions.cpp hipSinglePrecisionIntrinsics.cpp hipDoublePrecisionIntrinsics.cpp hipIntegerIntrinsics.cpp) -make_hip_executable_libcpp (hipPointerAttrib hipPointerAttrib.cpp) -make_hip_executable (hipMultiThreadStreams1 hipMultiThreadStreams1.cpp) -make_hip_executable (hipMultiThreadStreams2 hipMultiThreadStreams2.cpp) -make_hip_executable (hipHostAlloc hipHostAlloc.cpp) -make_hip_executable (hipStreamL5 hipStreamL5.cpp) -make_hip_executable (hipHostGetFlags hipHostGetFlags.cpp) -make_hip_executable (hipHostRegister hipHostRegister.cpp) -make_hip_executable (hipRandomMemcpyAsync hipRandomMemcpyAsync.cpp) -make_hip_executable (hipMemoryAllocate hipMemoryAllocate.cpp) -make_hip_executable (hipFuncSetDeviceFlags hipFuncSetDeviceFlags.cpp) -make_hip_executable (hipFuncGetDevice hipFuncGetDevice.cpp) -make_hip_executable (hipFuncSetDevice hipFuncSetDevice.cpp) -make_hip_executable (hipFuncDeviceSynchronize hipFuncDeviceSynchronize.cpp) -make_hip_executable (hipPeerToPeer_simple hipPeerToPeer_simple.cpp) -make_hip_executable (hipMemcpyAll hipMemcpyAll.cpp) -make_hip_executable (hipMultiThreadDevice hipMultiThreadDevice.cpp) -make_hip_executable (hipTestMemcpyPin hipTestMemcpyPin.cpp) -#make_hip_executable (hipDynamicShared hipDynamicShared.cpp) -make_hip_executable (hipTestDevice hipTestDevice.cpp) -make_hip_executable (hipTestDeviceDouble hipTestDeviceDouble.cpp) +build_hip_executable_libcpp (hipPointerAttrib hipPointerAttrib.cpp) +build_hip_executable (hipHostAlloc hipHostAlloc.cpp) +build_hip_executable (hipHostGetFlags hipHostGetFlags.cpp) +build_hip_executable (hipHostRegister hipHostRegister.cpp) +build_hip_executable (hipRandomMemcpyAsync hipRandomMemcpyAsync.cpp) +build_hip_executable (hipFuncSetDeviceFlags hipFuncSetDeviceFlags.cpp) +build_hip_executable (hipFuncGetDevice hipFuncGetDevice.cpp) +build_hip_executable (hipFuncSetDevice hipFuncSetDevice.cpp) +build_hip_executable (hipFuncDeviceSynchronize hipFuncDeviceSynchronize.cpp) +build_hip_executable (hipPeerToPeer_simple hipPeerToPeer_simple.cpp) +build_hip_executable (hipTestMemcpyPin hipTestMemcpyPin.cpp) +#build_hip_executable (hipDynamicShared hipDynamicShared.cpp) -make_test(hip_ballot " " ) -make_test(hip_anyall " " ) -make_test(hip_popc " " ) -make_test(hip_brev " " ) -make_test(hip_clz " " ) -make_test(hip_ffs " " ) make_test(hipEventRecord --iterations 10) -make_test(hipMemset " " ) -make_test(hipMemset --N 10 --memsetval 0x42 ) # small copy, just 10 bytes. -make_test(hipMemset --N 10013 --memsetval 0x5a ) # oddball size. -make_test(hipMemset --N 256M --memsetval 0xa6 ) # big copy -make_test(hipGridLaunch " " ) make_test(hipEnvVarDriver " " ) -make_test(hipMemcpyAll " ") #TODO -reenable #make_test(hipPointerAttrib " " ) -#make_test(hipMultiThreadStreams1 " " ) Fails if 0x3 specified, passes otherwise. -make_test(hipMultiThreadStreams2 " " ) -make_test(hipMemcpy_simple " " ) -make_named_test(hipMemcpy "hipMemcpy-modes" --tests 0x1 ) -make_named_test(hipMemcpy "hipMemcpy-size" --tests 0x6 ) -make_named_test(hipMemcpy "hipMemcpy-multithreaded" --tests 0x8 ) -make_test(hip_test_ldg " " ) -# Debug synchronization, then enable. -#make_named_test(hipMemcpy_simple "hipMemcpyAsync-simple" --async) make_test(hipHostAlloc " ") -#make_test(hipMemcpyAsync " " ) # BS- comment out since test appears broken - asks for device pointer but pointer was never allocated. #make_test(hipHostGetFlags " ") make_test(hipHcc " " ) make_test(hipHostRegister " ") -make_test(hipStreamL5 " ") make_test(hipRandomMemcpyAsync " ") -#make_test(hipAPIStreamEnable " ") -#make_test(hipAPIStreamDisable " ") make_test(hipFuncSetDeviceFlags " ") make_test(hipFuncGetDevice " ") make_test(hipFuncDeviceSynchronize " ") make_test(hipTestMemcpyPin " ") -make_test(hipTestDevice " ") -make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-serial" --tests 0x1) -make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-pyramid" --tests 0x4) -make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-nearzero" --tests 0x10) -make_test(hipMemoryAllocate " ") if (${HIP_MULTI_GPU}) make_test(hipPeerToPeer_simple " ") # use current device for copy, this fails. @@ -270,4 +213,6 @@ make_hipify_test(specialFunc.cu ) make_test(hipDynamicShared " ") # Add subdirs here: -add_subdirectory(launch_bounds) +add_subdirectory(deviceLib) +add_subdirectory(runtimeApi) +add_subdirectory(kernel) diff --git a/projects/clr/hipamd/tests/src/README.txt b/projects/clr/hipamd/tests/src/README.txt deleted file mode 100644 index dffce3dccd..0000000000 --- a/projects/clr/hipamd/tests/src/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -Unit tests for HIP API. - -To add a new test: diff --git a/projects/clr/hipamd/tests/src/deviceLib/CMakeLists.txt b/projects/clr/hipamd/tests/src/deviceLib/CMakeLists.txt new file mode 100644 index 0000000000..e2f8abbc0c --- /dev/null +++ b/projects/clr/hipamd/tests/src/deviceLib/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required (VERSION 2.6) + +project (deviceLib) + +include_directories( ${HIPTEST_SOURCE_DIR} ) + +build_hip_executable (hip_ballot hip_ballot.cpp) +make_test(hip_ballot " " ) + +build_hip_executable (hip_anyall hip_anyall.cpp) +make_test(hip_anyall " " ) + +build_hip_executable (hip_popc hip_popc.cpp) +make_test(hip_popc " " ) + +build_hip_executable (hip_clz hip_clz.cpp) +make_test(hip_clz " " ) + +build_hip_executable (hip_brev hip_brev.cpp) +make_test(hip_brev " " ) + +build_hip_executable (hip_ffs hip_ffs.cpp) +make_test(hip_ffs " " ) + +build_hip_executable_sm35 (hip_test_ldg hip_test_ldg.cpp) +make_test(hip_test_ldg " " ) + + +build_hip_executable (hipSimpleAtomicsTest hipSimpleAtomicsTest.cpp) +make_test(hipSimpleAtomicsTest " ") + +build_hip_executable (hipMathFunctionsHost hipMathFunctions.cpp hipSinglePrecisionMathHost.cpp hipDoublePrecisionMathHost.cpp) +make_test(hipMathFunctionsHost " ") + +build_hip_executable (hipMathFunctionsDevice hipMathFunctions.cpp hipSinglePrecisionMathDevice.cpp hipDoublePrecisionMathDevice.cpp) +make_test(hipMathFunctionsDevice " ") + +build_hip_executable (hipIntrinsics hipMathFunctions.cpp hipSinglePrecisionIntrinsics.cpp hipDoublePrecisionIntrinsics.cpp hipIntegerIntrinsics.cpp) +make_test(hipIntrinsics " ") + +build_hip_executable (hipTestDevice hipTestDevice.cpp) +make_test(hipTestDevice " ") + +build_hip_executable (hipTestDeviceDouble hipTestDeviceDouble.cpp) +make_test(hipTestDeviceDouble " ") + diff --git a/projects/clr/hipamd/tests/src/hipDoublePrecisionIntrinsics.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionIntrinsics.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipDoublePrecisionIntrinsics.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionIntrinsics.cpp diff --git a/projects/clr/hipamd/tests/src/hipDoublePrecisionMathDevice.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionMathDevice.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipDoublePrecisionMathDevice.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionMathDevice.cpp diff --git a/projects/clr/hipamd/tests/src/hipDoublePrecisionMathHost.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionMathHost.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipDoublePrecisionMathHost.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipDoublePrecisionMathHost.cpp diff --git a/projects/clr/hipamd/tests/src/hipIntegerIntrinsics.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipIntegerIntrinsics.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipIntegerIntrinsics.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipIntegerIntrinsics.cpp diff --git a/projects/clr/hipamd/tests/src/hipMathFunctions.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipMathFunctions.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMathFunctions.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipMathFunctions.cpp diff --git a/projects/clr/hipamd/tests/src/hipSimpleAtomicsTest.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipSimpleAtomicsTest.cpp similarity index 99% rename from projects/clr/hipamd/tests/src/hipSimpleAtomicsTest.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipSimpleAtomicsTest.cpp index d02252c7ea..2faee1b5de 100644 --- a/projects/clr/hipamd/tests/src/hipSimpleAtomicsTest.cpp +++ b/projects/clr/hipamd/tests/src/deviceLib/hipSimpleAtomicsTest.cpp @@ -26,6 +26,7 @@ THE SOFTWARE. // Includes HIP Runtime #include +#include #define EXIT_WAIVED 2 @@ -315,4 +316,6 @@ void runTest(int argc, char **argv) // Cleanup memory free(hOData); hipFree(dOData); + + passed(); } diff --git a/projects/clr/hipamd/tests/src/hipSinglePrecisionIntrinsics.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionIntrinsics.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipSinglePrecisionIntrinsics.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionIntrinsics.cpp diff --git a/projects/clr/hipamd/tests/src/hipSinglePrecisionMathDevice.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionMathDevice.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipSinglePrecisionMathDevice.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionMathDevice.cpp diff --git a/projects/clr/hipamd/tests/src/hipSinglePrecisionMathHost.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionMathHost.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipSinglePrecisionMathHost.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipSinglePrecisionMathHost.cpp diff --git a/projects/clr/hipamd/tests/src/hipTestDevice.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipTestDevice.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipTestDevice.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipTestDevice.cpp diff --git a/projects/clr/hipamd/tests/src/hipTestDeviceDouble.cpp b/projects/clr/hipamd/tests/src/deviceLib/hipTestDeviceDouble.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipTestDeviceDouble.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hipTestDeviceDouble.cpp diff --git a/projects/clr/hipamd/tests/src/hip_anyall.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_anyall.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_anyall.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_anyall.cpp diff --git a/projects/clr/hipamd/tests/src/hip_ballot.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_ballot.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_ballot.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_ballot.cpp diff --git a/projects/clr/hipamd/tests/src/hip_brev.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_brev.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_brev.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_brev.cpp diff --git a/projects/clr/hipamd/tests/src/hip_clz.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_clz.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_clz.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_clz.cpp diff --git a/projects/clr/hipamd/tests/src/hip_ffs.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_ffs.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_ffs.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_ffs.cpp diff --git a/projects/clr/hipamd/tests/src/hip_popc.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_popc.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hip_popc.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_popc.cpp diff --git a/projects/clr/hipamd/tests/src/hip_test_ldg.cpp b/projects/clr/hipamd/tests/src/deviceLib/hip_test_ldg.cpp similarity index 98% rename from projects/clr/hipamd/tests/src/hip_test_ldg.cpp rename to projects/clr/hipamd/tests/src/deviceLib/hip_test_ldg.cpp index 184493783a..fa4d402d5c 100644 --- a/projects/clr/hipamd/tests/src/hip_test_ldg.cpp +++ b/projects/clr/hipamd/tests/src/deviceLib/hip_test_ldg.cpp @@ -213,7 +213,6 @@ bool dataTypesRun2(){ HIP_ASSERT(hipMalloc((void**)&deviceB, NUM * sizeof(T))); HIP_ASSERT(hipMemcpy(deviceB, hostB, NUM*sizeof(T), hipMemcpyHostToDevice)); - hipLaunchKernel(vectoradd_float, dim3(WIDTH/THREADS_PER_BLOCK_X, HEIGHT/THREADS_PER_BLOCK_Y), dim3(THREADS_PER_BLOCK_X, THREADS_PER_BLOCK_Y), @@ -227,7 +226,7 @@ bool dataTypesRun2(){ // verify the results errors = 0; for (i = 0; i < NUM; i++) { -if (hostA[i].x != (hostB[i].x) && hostA[i].y != (hostB[i].y)) { + if (hostA[i].x != (hostB[i].x) && hostA[i].y != (hostB[i].y)) { errors++; } } @@ -235,7 +234,7 @@ if (hostA[i].x != (hostB[i].x) && hostA[i].y != (hostB[i].y)) { std::cout << "FAILED\n"<() & @@ -339,6 +339,7 @@ int main() { return -1; } +#if 1 errors = dataTypesRun2() & dataTypesRun2() & dataTypesRun2() & @@ -355,8 +356,10 @@ int main() { std::cout<<"Failed two element vector data types"<() & dataTypesRun4() & @@ -372,6 +375,7 @@ int main() { std::cout<<"Failed four element vector data types"< +#include #ifdef __HCC__ #include @@ -125,4 +126,5 @@ vectorADD(const hipLaunchParm lp, int main() { printf ("Hello world\n"); + passed(); } diff --git a/projects/clr/hipamd/tests/src/launch_bounds/hip_launch_bounds.cpp b/projects/clr/hipamd/tests/src/kernel/launch_bounds.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/launch_bounds/hip_launch_bounds.cpp rename to projects/clr/hipamd/tests/src/kernel/launch_bounds.cpp diff --git a/projects/clr/hipamd/tests/src/launch_bounds/CMakeLists.txt b/projects/clr/hipamd/tests/src/launch_bounds/CMakeLists.txt index d66b90a09c..838deb7879 100644 --- a/projects/clr/hipamd/tests/src/launch_bounds/CMakeLists.txt +++ b/projects/clr/hipamd/tests/src/launch_bounds/CMakeLists.txt @@ -4,5 +4,5 @@ project (launch_bounds) include_directories( ${HIPTEST_SOURCE_DIR} ) -make_hip_executable (hip_launch_bounds hip_launch_bounds.cpp) +build_hip_executable (hip_launch_bounds hip_launch_bounds.cpp) make_test(hip_launch_bounds " ") diff --git a/projects/clr/hipamd/tests/src/runtimeApi/CMakeLists.txt b/projects/clr/hipamd/tests/src/runtimeApi/CMakeLists.txt new file mode 100644 index 0000000000..86cc0ca1b1 --- /dev/null +++ b/projects/clr/hipamd/tests/src/runtimeApi/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required (VERSION 2.6) + +project (runtimeApi) + +add_subdirectory(memory) +add_subdirectory(multiThread) +add_subdirectory(stream) diff --git a/projects/clr/hipamd/tests/src/runtimeApi/memory/CMakeLists.txt b/projects/clr/hipamd/tests/src/runtimeApi/memory/CMakeLists.txt new file mode 100644 index 0000000000..fc6ea2f5d1 --- /dev/null +++ b/projects/clr/hipamd/tests/src/runtimeApi/memory/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required (VERSION 2.6) + +project (runtime_api) + +include_directories( ${HIPTEST_SOURCE_DIR} ) + +build_hip_executable (hipMemset hipMemset.cpp) +make_test(hipMemset " " ) +make_test(hipMemset --N 10 --memsetval 0x42 ) # small copy, just 10 bytes. +make_test(hipMemset --N 10013 --memsetval 0x5a ) # oddball size. +make_test(hipMemset --N 256M --memsetval 0xa6 ) # big copy + +build_hip_executable (hipMemcpy_simple hipMemcpy_simple.cpp) +make_test(hipMemcpy_simple " " ) + +build_hip_executable (hipMemcpy hipMemcpy.cpp) +make_named_test(hipMemcpy "hipMemcpy-modes" --tests 0x1 ) +make_named_test(hipMemcpy "hipMemcpy-size" --tests 0x6 ) +make_named_test(hipMemcpy "hipMemcpy-multithreaded" --tests 0x8 ) + +build_hip_executable (hipMemcpyAsync hipMemcpyAsync.cpp) +make_named_test(hipMemcpy_simple "hipMemcpyAsync-simple" --async) +#make_test(hipMemcpyAsync " " ) + +build_hip_executable (hipMemoryAllocate hipMemoryAllocate.cpp) + +build_hip_executable (hipMemcpyAll hipMemcpyAll.cpp) +make_test(hipMemcpyAll " ") + +# Debug synchronization, then enable. +make_test(hipMemoryAllocate " ") diff --git a/projects/clr/hipamd/tests/src/hipMemcpy.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemcpy.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpy.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemcpyAll.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAll.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemcpyAll.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAll.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAsync.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemcpyAsync.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAsync.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemcpyAsync2.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAsync2.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemcpyAsync2.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpyAsync2.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemcpy_simple.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemcpy_simple.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemcpy_simple.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemoryAllocate.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemoryAllocate.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemoryAllocate.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemoryAllocate.cpp diff --git a/projects/clr/hipamd/tests/src/hipMemset.cpp b/projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemset.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMemset.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/memory/hipMemset.cpp diff --git a/projects/clr/hipamd/tests/src/runtimeApi/multiThread/CMakeLists.txt b/projects/clr/hipamd/tests/src/runtimeApi/multiThread/CMakeLists.txt new file mode 100644 index 0000000000..6b9ff9bb7b --- /dev/null +++ b/projects/clr/hipamd/tests/src/runtimeApi/multiThread/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required (VERSION 2.6) + +project (runtime_api) + +include_directories( ${HIPTEST_SOURCE_DIR} ) + +build_hip_executable (hipMultiThreadStreams1 hipMultiThreadStreams1.cpp) +build_hip_executable (hipMultiThreadStreams2 hipMultiThreadStreams2.cpp) +build_hip_executable (hipMultiThreadDevice hipMultiThreadDevice.cpp) + +#make_test(hipMultiThreadStreams1 " " ) Fails if 0x3 specified, passes otherwise. +make_test(hipMultiThreadStreams2 " " ) +make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-serial" --tests 0x1) +make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-pyramid" --tests 0x4) +make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-nearzero" --tests 0x10) diff --git a/projects/clr/hipamd/tests/src/hipMultiThreadDevice.cpp b/projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMultiThreadDevice.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadDevice.cpp diff --git a/projects/clr/hipamd/tests/src/hipMultiThreadStreams1.cpp b/projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMultiThreadStreams1.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadStreams1.cpp diff --git a/projects/clr/hipamd/tests/src/hipMultiThreadStreams2.cpp b/projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipMultiThreadStreams2.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/multiThread/hipMultiThreadStreams2.cpp diff --git a/projects/clr/hipamd/tests/src/runtimeApi/stream/CMakeLists.txt b/projects/clr/hipamd/tests/src/runtimeApi/stream/CMakeLists.txt new file mode 100644 index 0000000000..9c16ca5e4c --- /dev/null +++ b/projects/clr/hipamd/tests/src/runtimeApi/stream/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 2.6) + +project (runtime_api) + +include_directories( ${HIPTEST_SOURCE_DIR} ) +build_hip_executable (hipAPIStreamEnable hipAPIStreamEnable.cpp) +build_hip_executable (hipAPIStreamDisable hipAPIStreamDisable.cpp) +build_hip_executable (hipStreamL5 hipStreamL5.cpp) + +# TODO - seg fault +#make_test(hipAPIStreamEnable " ") +#make_test(hipAPIStreamDisable " ") +make_test(hipStreamL5 " ") diff --git a/projects/clr/hipamd/tests/src/hipAPIStreamDisable.cpp b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipAPIStreamDisable.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipAPIStreamDisable.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/stream/hipAPIStreamDisable.cpp diff --git a/projects/clr/hipamd/tests/src/hipAPIStreamEnable.cpp b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipAPIStreamEnable.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipAPIStreamEnable.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/stream/hipAPIStreamEnable.cpp diff --git a/projects/clr/hipamd/tests/src/hipStream.h b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStream.h similarity index 100% rename from projects/clr/hipamd/tests/src/hipStream.h rename to projects/clr/hipamd/tests/src/runtimeApi/stream/hipStream.h diff --git a/projects/clr/hipamd/tests/src/hipStreamL5.cpp b/projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamL5.cpp similarity index 100% rename from projects/clr/hipamd/tests/src/hipStreamL5.cpp rename to projects/clr/hipamd/tests/src/runtimeApi/stream/hipStreamL5.cpp