Skip to content

Commit 987d743

Browse files
Improve hipBLAS support in CMake (#7696)
* Improve hipBLAS support in CMake This improves the detection of the correct CMAKE_PREFIX_PATH when using different distributions or a self-built ROCm SDK. * Set ROCM_PATH correctly
1 parent b226c12 commit 987d743

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,12 +557,17 @@ if (LLAMA_VULKAN)
557557
endif()
558558

559559
if (LLAMA_HIPBLAS)
560-
if ($ENV{ROCM_PATH})
561-
set(ROCM_PATH $ENV{ROCM_PATH})
560+
if (NOT EXISTS $ENV{ROCM_PATH})
561+
if (NOT EXISTS /opt/rocm)
562+
set(ROCM_PATH /usr)
563+
else()
564+
set(ROCM_PATH /opt/rocm)
565+
endif()
562566
else()
563-
set(ROCM_PATH /opt/rocm)
567+
set(ROCM_PATH $ENV{ROCM_PATH})
564568
endif()
565569
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
570+
list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}/lib64/cmake")
566571

567572
# CMake on Windows doesn't support the HIP language yet
568573
if(WIN32)

0 commit comments

Comments
 (0)