Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7eecbc

Browse files
[#6529][feat] Add a CMake option in order to link statically with cublas/curand
Add 2 CMake options (CUBLAS/CURAND_DYNAMIC_LINKING)in order to link statically with cublas/curand.Linux only.OFF by default.Signed-off-by: William Tambellini <wtambellini@sdl.com>
1 parent6a44e5b commitb7eecbc

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

‎cpp/CMakeLists.txt‎

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ option(ENABLE_MULTI_DEVICE
4545
option(ENABLE_UCX"Enable building with UCX (Uniform Communication X) support"
4646
ON)
4747
option(NVRTC_DYNAMIC_LINKING"Link against the dynamic NVRTC libraries"OFF)
48+
option(CUBLAS_DYNAMIC_LINKING
49+
"Link against the dynamic cublas/cublasLt libraries"ON)
50+
option(CURAND_DYNAMIC_LINKING"Link against the dynamic curand library"ON)
51+
4852
option(ENABLE_NVSHMEM"Enable building with NVSHMEM support"OFF)
4953
option(USING_OSS_CUTLASS_LOW_LATENCY_GEMM
5054
"Using open sourced Cutlass low latency gemm kernel"ON)
@@ -156,9 +160,28 @@ setup_cuda_architectures()
156160
find_package(CUDAToolkit 11.2 REQUIRED COMPONENTS cudart_static cuda_driver
157161
cublas cublasLt curand nvml)
158162

159-
set(CUBLAS_LIB CUDA::cublas)
160-
set(CUBLASLT_LIB CUDA::cublasLt)
161-
set(CURAND_LIB CUDA::curand)
163+
if(CUBLAS_DYNAMIC_LINKING)
164+
set(CUBLAS_LIB CUDA::cublas)
165+
set(CUBLASLT_LIB CUDA::cublasLt)
166+
else()
167+
if(WIN32)
168+
message(FATAL_ERROR"Static cublas not available on windows")
169+
endif()
170+
message(DEBUG"Linking with static cublas libs")
171+
set(CUBLAS_LIB CUDA::cublas_static)
172+
set(CUBLASLT_LIB CUDA::cublasLt_static)
173+
endif()
174+
175+
if(CURAND_DYNAMIC_LINKING)
176+
set(CURAND_LIB CUDA::curand)
177+
else()
178+
if(WIN32)
179+
message(FATAL_ERROR"Static curand not available on windows")
180+
endif()
181+
message(DEBUG"Linking with static curand lib")
182+
set(CURAND_LIB CUDA::curand_static)
183+
endif()
184+
162185
set(CUDA_DRV_LIB CUDA::cuda_driver)
163186
set(CUDA_NVML_LIB CUDA::nvml)
164187
set(CUDA_RT_LIB CUDA::cudart_static)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp