From: Daniele Date: Tue, 4 Jun 2024 12:09:15 +0000 (+0000) Subject: Improve hipBLAS support in CMake (#7696) X-Git-Tag: upstream/0.0.4488~1405 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=987d743d6bc4cee4bde6820733ea33a2abc0afac;p=pkg%2Fggml%2Fsources%2Fllama.cpp 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 --- 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)