cmake : workarounds for cufile when CMake version < 3.25

This commit is contained in:
Georgi Gerganov 2023-05-20 13:22:47 +03:00
parent 3ec7941bad
commit a3586c526f

View file

@ -182,6 +182,7 @@ if (LLAMA_CUBLAS)
cmake_minimum_required(VERSION 3.17)
find_package(CUDAToolkit)
if (CUDAToolkit_FOUND)
message(STATUS "cuBLAS found")
@ -197,6 +198,23 @@ if (LLAMA_CUBLAS)
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cudart CUDA::cublas CUDA::cublasLt)
endif()
if (CMAKE_VERSION VERSION_LESS 3.25)
if (NOT MSVC)
if (LLAMA_STATIC)
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} -lcufile_static)
else()
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} -lcufile)
endif()
else()
message(FATAL "TODO: cufile on Windows")
endif()
else()
if (LLAMA_STATIC)
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cufile_static)
else()
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} CUDA::cufile)
endif()
endif()
else()
message(WARNING "cuBLAS not found")
endif()