Skip to content

Commit 5c3a3dc

Browse files
authored
[flang][cuda] Add version in libCufRuntime name (#104506)
1 parent 019fbcc commit 5c3a3dc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

flang/runtime/CUDA/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88

99
include_directories(${CUDAToolkit_INCLUDE_DIRS})
1010

11-
add_flang_library(CufRuntime
11+
# libCufRuntime depends on a certain version of CUDA. To be able to have
12+
# multiple build of this library with different CUDA version, the version is
13+
# added to the library name.
14+
set(CUFRT_LIBNAME CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR})
15+
16+
add_flang_library(${CUFRT_LIBNAME}
1217
allocator.cpp
1318
descriptor.cpp
1419
)
@@ -19,7 +24,7 @@ else()
1924
set(CUDA_RT_TARGET CUDA::cudart_static)
2025
endif()
2126

22-
target_link_libraries(CufRuntime
27+
target_link_libraries(${CUFRT_LIBNAME}
2328
PRIVATE
2429
FortranRuntime
2530
${CUDA_RT_TARGET}

flang/unittests/Runtime/CUDA/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ add_flang_unittest(FlangCufRuntimeTests
66

77
target_link_libraries(FlangCufRuntimeTests
88
PRIVATE
9-
CufRuntime
9+
CufRuntime_cuda_${CUDAToolkit_VERSION_MAJOR}
1010
FortranRuntime
1111
)
1212

0 commit comments

Comments
 (0)