File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -198,15 +198,18 @@ endif()
198198
199199# Detect and enable HIP
200200if (ENABLE_HIP)
201- if ("$ENV{CMAKE_PREFIX_PATH} " MATCHES "rocm" )
201+ if (NOT "$ENV{CMAKE_PREFIX_PATH} " MATCHES "rocm" AND NOT CMAKE_PREFIX_PATH MATCHES "rocm" AND EXISTS "/opt/rocm/lib/cmake/" )
202+ list (APPEND CMAKE_PREFIX_PATH "/opt/rocm/lib/cmake" )
203+ endif ()
204+ if ("$ENV{CMAKE_PREFIX_PATH} " MATCHES "rocm" OR CMAKE_PREFIX_PATH MATCHES "rocm" )
202205 set (CMAKE_HIP_STANDARD ${CMAKE_CXX_STANDARD} )
203206 set (CMAKE_HIP_STANDARD_REQUIRED TRUE )
204207 if (HIP_AMDGPUTARGET)
205208 set (AMDGPU_TARGETS "${HIP_AMDGPUTARGET} " CACHE STRING "AMD GPU targets to compile for" FORCE)
206209 set (GPU_TARGETS "${HIP_AMDGPUTARGET} " CACHE STRING "AMD GPU targets to compile for" FORCE)
207210 set (CMAKE_HIP_ARCHITECTURES "${HIP_AMDGPUTARGET} " CACHE STRING "AMD GPU targets to compile for" FORCE)
208211 endif ()
209- set (TMP_ROCM_DIR_LIST $ ENV{CMAKE_PREFIX_PATH} )
212+ set (TMP_ROCM_DIR_LIST " ${CMAKE_PREFIX_PATH} : $ ENV{CMAKE_PREFIX_PATH}" )
210213 string (REPLACE ":" ";" TMP_ROCM_DIR_LIST "${TMP_ROCM_DIR_LIST} " )
211214 list (FILTER TMP_ROCM_DIR_LIST INCLUDE REGEX rocm)
212215 list (POP_FRONT TMP_ROCM_DIR_LIST TMP_ROCM_DIR)
You can’t perform that action at this time.
0 commit comments