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
This commit is contained in:
Daniele 2024-06-04 12:09:15 +00:00 committed by GitHub
parent b226c1227b
commit 987d743d6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -557,12 +557,17 @@ if (LLAMA_VULKAN)
endif() endif()
if (LLAMA_HIPBLAS) if (LLAMA_HIPBLAS)
if ($ENV{ROCM_PATH}) if (NOT EXISTS $ENV{ROCM_PATH})
set(ROCM_PATH $ENV{ROCM_PATH}) if (NOT EXISTS /opt/rocm)
set(ROCM_PATH /usr)
else()
set(ROCM_PATH /opt/rocm)
endif()
else() else()
set(ROCM_PATH /opt/rocm) set(ROCM_PATH $ENV{ROCM_PATH})
endif() endif()
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}/lib64/cmake")
# CMake on Windows doesn't support the HIP language yet # CMake on Windows doesn't support the HIP language yet
if(WIN32) if(WIN32)