From 988d616c1e4de86ca7ee5ced07dbabc6708a4b95 Mon Sep 17 00:00:00 2001 From: ROCm CI Service Account <66695075+rocm-ci@users.noreply.github.com> Date: Sat, 5 Nov 2022 05:44:41 +0530 Subject: [PATCH] SWDEV-354905 - prioritize -DROCM_PATH over env{ROCM_PATH} in hip tests (#3055) Change-Id: I943bc705641ceccda95b409d13b4e757c4e5ab23 [ROCm/hip commit: a9e9d9f99648a365ef81a44adeeb5b53f4db6796] --- projects/hip/tests/catch/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/hip/tests/catch/CMakeLists.txt b/projects/hip/tests/catch/CMakeLists.txt index e2924a561d..3f6c992059 100644 --- a/projects/hip/tests/catch/CMakeLists.txt +++ b/projects/hip/tests/catch/CMakeLists.txt @@ -57,13 +57,16 @@ else() # Set both compilers else windows cmake complains of mismatch cmake_path(SET CMAKE_CXX_COMPILER "${HIP_PATH}/bin/hipcc.bat") cmake_path(SET CMAKE_C_COMPILER "${HIP_PATH}/bin/hipcc.bat") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --rocm-path=${ROCM_PATH}") set(HIPCONFIG_EXECUTABLE "${HIP_PATH}/bin/hipconfig.bat") execute_process(COMMAND ${HIPCONFIG_EXECUTABLE} --version OUTPUT_VARIABLE HIP_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) endif() -# enforce c++17 for all tests +if(HIP_PLATFORM STREQUAL "amd") + # prioritize -DROCM_PATH over env{ROCM_PATH} for amd platform only + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --rocm-path=${ROCM_PATH}") +endif() +# enforce c++17 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++17") string(REPLACE "." ";" VERSION_LIST ${HIP_VERSION})