From a1bbf9aa3db5c1e4e026b197ab20495466ac45c5 Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Fri, 5 Feb 2016 07:15:46 -0600 Subject: [PATCH] Fix HIP_PLATFORM detection [ROCm/clr commit: 26854bb31c4aceba3ee4f8a540ed722aa585e46c] --- projects/clr/hipamd/tests/src/CMakeLists.txt | 32 +++++--------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/projects/clr/hipamd/tests/src/CMakeLists.txt b/projects/clr/hipamd/tests/src/CMakeLists.txt index a2b7056403..77882428e2 100644 --- a/projects/clr/hipamd/tests/src/CMakeLists.txt +++ b/projects/clr/hipamd/tests/src/CMakeLists.txt @@ -8,33 +8,20 @@ include_directories( ${PROJECT_SOURCE_DIR}/include ) set (HIP_Unit_Test_VERSION_MAJOR 1) set (HIP_Unit_Test_VERSION_MINOR 0) -set (CUDA_PATH $ENV{CUDA_PATH}) -if (NOT DEFINED CUDA_PATH) - set( CUDA_PATH /usr/local/cuda) -endif() - set (HIP_PATH $ENV{HIP_PATH}) if (NOT DEFINED HIP_PATH) set (HIP_PATH ../..) endif() -set (HIP_PLATFORM $ENV{HIP_PLATFORM}) -if (NOT DEFINED HIP_PLATFORM) - if (EXISTS $CUDA_PATH) - set (HIP_PLATFORM nvcc) - else() - set (HIP_PLATFORM hcc) - endif() -endif() - +execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM) +MESSAGE ("HIP_PATH=" ${HIP_PATH}) if (${HIP_PLATFORM} STREQUAL "hcc") - MESSAGE ("HCC") + MESSAGE ("HIP_PLATFORM=hcc") set (HC_PATH ${HIP_PATH}/hc) set (HSA_PATH /opt/hsa) - #--- # Add HSA library: add_library(hsa-runtime64 SHARED IMPORTED) @@ -51,12 +38,13 @@ if (${HIP_PLATFORM} STREQUAL "hcc") elseif (${HIP_PLATFORM} STREQUAL "nvcc") - MESSAGE ("NVCC") + MESSAGE ("HIP_PLATFORM=nvcc") # NVCC does not not support -rdynamic option set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ) set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS ) + else() - MESSAGE ("UNKNOWN HIP_PLATFORM=" ${HIP_PLATFORM}) + MESSAGE (FATAL_ERROR "UNKNOWN HIP_PLATFORM=" ${HIP_PLATFORM}) endif() set (HIPCC ${HIP_PATH}/bin/hipcc) @@ -109,11 +97,6 @@ macro (make_test_matches exe match_string) ) endmacro() - -#set(CMAKE_INSTALL_PREFIX "./install") -#install (TARGETS hipMemset DESTINATION bin) -#install (TARGETS hipEventRecord DESTINATION bin) - make_hip_executable (hip_ballot hip_ballot.cpp) make_hip_executable (hip_anyall hip_anyall.cpp) make_hip_executable (hip_popc hip_popc.cpp) @@ -121,7 +104,7 @@ 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 (hipInfo hipInfo.cpp) -make_hip_executable (hipMemset hipMemset.cpp) +make_hip_executable (hipSetValidDevices hipSetValidDevices.cpp) make_hip_executable (hipMemcpy hipMemcpy.cpp) make_hip_executable (hipEventRecord hipEventRecord.cpp) make_hip_executable (hipLanguageExtensions hipLanguageExtensions.cpp) @@ -145,6 +128,7 @@ 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 500M --memsetval 0xa6 ) # big copy make_test(hipGridLaunch " " ) +make_test(hipSetValidDevices " " ) make_test(hipMemcpy " " )