Skip to content

Commit

Permalink
CMake: HIP_PATH from ROCM_PATH
Browse files Browse the repository at this point in the history
On machines like Crusher, `ROCM_PATH` is more likely to be available
then a `HIP_PATH` environment variable.

This is mainly needed for our hacky ROCTX hints.
  • Loading branch information
ax3l committed Sep 13, 2022
1 parent 9aa23c2 commit d8bde15
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Tools/CMake/AMReXParallelBackends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,12 @@ if (AMReX_HIP)
unset(_valid_hip_compilers)

if(NOT DEFINED HIP_PATH)
if(NOT DEFINED ENV{HIP_PATH})
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed")
else()
if(DEFINED ENV{HIP_PATH})
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed")
elseif(DEFINED ENV{ROCM_PATH})
set(HIP_PATH "$ENV{HIP_PATH}/hip" CACHE PATH "Path to which HIP has been installed")
else()
set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed")
endif()
endif()

Expand Down

0 comments on commit d8bde15

Please sign in to comment.