diff --git a/CMakeLists.txt b/CMakeLists.txt index e55d091bb4e..76da1dbe978 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,6 +138,9 @@ if(WITH_CUDA) set(ROCM_HOME "/opt/rocm" CACHE FILEPATH "Path to AMD ROCm") list(APPEND CMAKE_MODULE_PATH "${ROCM_HOME}/hip/cmake") find_package(HIP 1.5.18494 MODULE REQUIRED) + # patch HCC_PATH environment variable and reload HIP (for ROCm 3.0/3.1) + set(HCC_PATH "${HIP_ROOT_DIR}") + find_package(HIP 1.5.18494 MODULE REQUIRED) find_package(CUDACompilerHIP 6.0 REQUIRED) elseif (WITH_CUDA_COMPILER STREQUAL "clang") set(CMAKE_CUDA_STANDARD 8.0) diff --git a/cmake/FindCUDACompilerHIP.cmake b/cmake/FindCUDACompilerHIP.cmake index 5f3d0d10755..4e9d54d30f2 100644 --- a/cmake/FindCUDACompilerHIP.cmake +++ b/cmake/FindCUDACompilerHIP.cmake @@ -34,8 +34,6 @@ string(REGEX CMAKE_CUDA_COMPILER_VERSION "${HIPCC_VERSION_STRING}") -set(HCC_PATH "${HIP_ROOT_DIR}") - list(APPEND HIP_HCC_FLAGS "-I${HIP_ROOT_DIR}/include -I${ROCM_HOME}/include -Wno-c99-designator -Wno-macro-redefined -Wno-duplicate-decl-specifier -std=c++${CMAKE_CXX_STANDARD}") list(APPEND HIP_HCC_FLAGS "-pedantic -Wall -Wextra -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-missing-braces -Wno-gnu-anonymous-struct -Wno-nested-anon-types -Wno-gnu-zero-variadic-macro-arguments") if(WARNINGS_ARE_ERRORS)