diff options
author | Daniele <57776841+daniandtheweb@users.noreply.github.com> | 2024-06-04 12:09:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-04 14:09:15 +0200 |
commit | 987d743d6bc4cee4bde6820733ea33a2abc0afac (patch) | |
tree | 26775b0970f8619550ace00bc6f81b397d604c46 | |
parent | b226c1227bcf6412076ecf787421135fd2c42ef0 (diff) |
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
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 620305ca..76ea2741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -557,12 +557,17 @@ if (LLAMA_VULKAN) endif() if (LLAMA_HIPBLAS) - if ($ENV{ROCM_PATH}) - set(ROCM_PATH $ENV{ROCM_PATH}) + if (NOT EXISTS $ENV{ROCM_PATH}) + if (NOT EXISTS /opt/rocm) + set(ROCM_PATH /usr) + else() + set(ROCM_PATH /opt/rocm) + endif() else() - set(ROCM_PATH /opt/rocm) + set(ROCM_PATH $ENV{ROCM_PATH}) endif() 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 if(WIN32) |