@@ -10,14 +10,14 @@ set(UR_HIP_PLATFORM "AMD" CACHE STRING "UR HIP platform, AMD or NVIDIA")
1010
1111# Set default ROCm installation directory
1212set (UR_HIP_ROCM_DIR "/opt/rocm" CACHE STRING "ROCm installation dir" )
13-
14- set (UR_HIP_INCLUDE_DIR "${UR_HIP_ROCM_DIR} /include" )
15-
13+ # Allow custom location of HIP/HSA include and HIP library directories
14+ set (UR_HIP_INCLUDE_DIR "${UR_HIP_ROCM_DIR} /include" CACHE PATH
15+ "Custom ROCm HIP include dir" )
1616set (UR_HIP_HSA_INCLUDE_DIRS
17- "${UR_HIP_ROCM_DIR} /hsa/include;${UR_HIP_ROCM_DIR} /include" )
18-
19- # Set HIP lib dir
20- set (UR_HIP_LIB_DIR " ${UR_HIP_ROCM_DIR} /lib " )
17+ "${UR_HIP_ROCM_DIR} /hsa/include;${UR_HIP_ROCM_DIR} /include" CACHE FILEPATH
18+ "Custom ROCm HSA include dir" )
19+ set (UR_HIP_LIB_DIR " ${UR_HIP_ROCM_DIR} / lib" CACHE PATH
20+ "Custom ROCm HIP library dir " )
2121
2222# Check if HIP library path exists (AMD platform only)
2323if ("${UR_HIP_PLATFORM} " STREQUAL "AMD" )
@@ -31,7 +31,8 @@ if("${UR_HIP_PLATFORM}" STREQUAL "AMD")
3131 " please check ROCm installation." )
3232 endif ()
3333
34- # Check if HSA include path exists
34+ # Check if HSA include path exists. In rocm-6.0.0 the layout of HSA
35+ # directory has changed, check for the new location as well.
3536 foreach (D IN LISTS UR_HIP_HSA_INCLUDE_DIRS)
3637 if (EXISTS "${D} " )
3738 set (UR_HIP_HSA_INCLUDE_DIR "${D} " )
0 commit comments