Commit 00ec7f9c by Jon Soifer Committed by masahi

[Build] Explicitly link to cublasLt if it exists (#4776)

* Explicitly link to cublasLt

* Only link cublasLt if it's found

Co-authored-by: Jon Soifer <jonso@microsoft.com>
parent 9056fc40
...@@ -50,6 +50,9 @@ if(USE_CUDA) ...@@ -50,6 +50,9 @@ if(USE_CUDA)
file(GLOB CONTRIB_CUBLAS_SRCS src/runtime/contrib/cublas/*.cc) file(GLOB CONTRIB_CUBLAS_SRCS src/runtime/contrib/cublas/*.cc)
list(APPEND RUNTIME_SRCS ${CONTRIB_CUBLAS_SRCS}) list(APPEND RUNTIME_SRCS ${CONTRIB_CUBLAS_SRCS})
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUBLAS_LIBRARY}) list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUBLAS_LIBRARY})
if(NOT CUDA_CUBLASLT_LIBRARY STREQUAL "CUDA_CUBLASLT_LIBRARY-NOTFOUND")
list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUBLASLT_LIBRARY})
endif()
endif(USE_CUBLAS) endif(USE_CUBLAS)
else(USE_CUDA) else(USE_CUDA)
......
...@@ -70,6 +70,9 @@ macro(find_cuda use_cuda) ...@@ -70,6 +70,9 @@ macro(find_cuda use_cuda)
find_library(CUDA_CUBLAS_LIBRARY cublas find_library(CUDA_CUBLAS_LIBRARY cublas
${CUDA_TOOLKIT_ROOT_DIR}/lib/x64 ${CUDA_TOOLKIT_ROOT_DIR}/lib/x64
${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32) ${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32)
find_library(CUDA_CUBLASLT_LIBRARY cublaslt
${CUDA_TOOLKIT_ROOT_DIR}/lib/x64
${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32)
else(MSVC) else(MSVC)
find_library(_CUDA_CUDA_LIBRARY cuda find_library(_CUDA_CUDA_LIBRARY cuda
PATHS ${CUDA_TOOLKIT_ROOT_DIR} PATHS ${CUDA_TOOLKIT_ROOT_DIR}
...@@ -88,6 +91,9 @@ macro(find_cuda use_cuda) ...@@ -88,6 +91,9 @@ macro(find_cuda use_cuda)
find_library(CUDA_CUBLAS_LIBRARY cublas find_library(CUDA_CUBLAS_LIBRARY cublas
${CUDA_TOOLKIT_ROOT_DIR}/lib64 ${CUDA_TOOLKIT_ROOT_DIR}/lib64
${CUDA_TOOLKIT_ROOT_DIR}/lib) ${CUDA_TOOLKIT_ROOT_DIR}/lib)
find_library(CUDA_CUBLASLT_LIBRARY cublaslt
${CUDA_TOOLKIT_ROOT_DIR}/lib64
${CUDA_TOOLKIT_ROOT_DIR}/lib)
endif(MSVC) endif(MSVC)
message(STATUS "Found CUDA_TOOLKIT_ROOT_DIR=" ${CUDA_TOOLKIT_ROOT_DIR}) message(STATUS "Found CUDA_TOOLKIT_ROOT_DIR=" ${CUDA_TOOLKIT_ROOT_DIR})
message(STATUS "Found CUDA_CUDA_LIBRARY=" ${CUDA_CUDA_LIBRARY}) message(STATUS "Found CUDA_CUDA_LIBRARY=" ${CUDA_CUDA_LIBRARY})
...@@ -95,5 +101,6 @@ macro(find_cuda use_cuda) ...@@ -95,5 +101,6 @@ macro(find_cuda use_cuda)
message(STATUS "Found CUDA_NVRTC_LIBRARY=" ${CUDA_NVRTC_LIBRARY}) message(STATUS "Found CUDA_NVRTC_LIBRARY=" ${CUDA_NVRTC_LIBRARY})
message(STATUS "Found CUDA_CUDNN_LIBRARY=" ${CUDA_CUDNN_LIBRARY}) message(STATUS "Found CUDA_CUDNN_LIBRARY=" ${CUDA_CUDNN_LIBRARY})
message(STATUS "Found CUDA_CUBLAS_LIBRARY=" ${CUDA_CUBLAS_LIBRARY}) message(STATUS "Found CUDA_CUBLAS_LIBRARY=" ${CUDA_CUBLAS_LIBRARY})
message(STATUS "Found CUDA_CUBLASLT_LIBRARY=" ${CUDA_CUBLASLT_LIBRARY})
endif(CUDA_FOUND) endif(CUDA_FOUND)
endmacro(find_cuda) endmacro(find_cuda)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment