mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
[ROCm] Replace HIP_PATH with ROCM_PATH for rocm 6.0
This commit is contained in:
parent
5bdf58b8df
commit
d9839718aa
@ -446,15 +446,20 @@ endif()
|
||||
option(EIGEN_TEST_HIP "Add HIP support." OFF)
|
||||
if (EIGEN_TEST_HIP)
|
||||
|
||||
set(HIP_PATH "/opt/rocm/hip" CACHE STRING "Path to the HIP installation.")
|
||||
|
||||
if (EXISTS ${HIP_PATH})
|
||||
set(ROCM_PATH "/opt/rocm" CACHE STRING "Path to the ROCm installation.")
|
||||
|
||||
if (EXISTS ${ROCM_PATH}/hip)
|
||||
set(HIP_PATH ${ROCM_PATH}/hip)
|
||||
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/cmake)
|
||||
elseif (EXISTS ${ROCM_PATH}/lib/cmake/hip)
|
||||
set(HIP_PATH ${ROCM_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/lib/cmake/hip)
|
||||
else ()
|
||||
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but could not find the ROCm installation under ${ROCM_PATH}")
|
||||
endif()
|
||||
|
||||
find_package(HIP REQUIRED)
|
||||
if (HIP_FOUND)
|
||||
|
||||
execute_process(COMMAND ${HIP_PATH}/bin/hipconfig --platform OUTPUT_VARIABLE HIP_PLATFORM)
|
||||
|
||||
if ((${HIP_PLATFORM} STREQUAL "hcc") OR (${HIP_PLATFORM} STREQUAL "amd"))
|
||||
@ -472,9 +477,6 @@ if (EIGEN_TEST_HIP)
|
||||
message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
|
||||
endif()
|
||||
endif()
|
||||
else ()
|
||||
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but the specified HIP_PATH (${HIP_PATH}) does not exist")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EIGEN_TEST_SYCL)
|
||||
|
@ -287,10 +287,17 @@ endif()
|
||||
# Add HIP specific tests
|
||||
if (EIGEN_TEST_HIP)
|
||||
|
||||
set(HIP_PATH "/opt/rocm/hip" CACHE STRING "Path to the HIP installation.")
|
||||
set(ROCM_PATH "/opt/rocm" CACHE STRING "Path to the ROCm installation.")
|
||||
|
||||
if (EXISTS ${HIP_PATH})
|
||||
if (EXISTS ${ROCM_PATH}/hip)
|
||||
set(HIP_PATH ${ROCM_PATH}/hip)
|
||||
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/cmake)
|
||||
elseif (EXISTS ${ROCM_PATH}/lib/cmake/hip)
|
||||
set(HIP_PATH ${ROCM_PATH})
|
||||
list(APPEND CMAKE_MODULE_PATH ${HIP_PATH}/lib/cmake/hip)
|
||||
else ()
|
||||
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but could not find the ROCm installation under ${ROCM_PATH}")
|
||||
endif()
|
||||
|
||||
find_package(HIP REQUIRED)
|
||||
if (HIP_FOUND)
|
||||
@ -328,8 +335,4 @@ if (EIGEN_TEST_HIP)
|
||||
message(FATAL_ERROR "Unknown HIP_PLATFORM = ${HIP_PLATFORM}")
|
||||
endif()
|
||||
endif()
|
||||
else ()
|
||||
message(FATAL_ERROR "EIGEN_TEST_HIP is ON, but the specified HIP_PATH (${HIP_PATH}) does not exist")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user