mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-23 14:48:19 -05:00
4fe9f534f5
Architecture 30 was removed with CUDA 11, so most of the CUDA tests fail with it. Remove setting the architecture and bump the minimum version to 3.18, so CMP0104 takes effect and we can rely on the default architecture, which is guaranteed to be compilable. Use of __ldg() in ProperLinkFlags was removed as it only affects performance and is available only on sm_35 and above. Testing the functionality of CUDA_ARCHITECTURES is already covered by CudaOnly.Architecture and CudaOnly.CompileFlags.
34 lines
1.2 KiB
CMake
34 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.18)
|
|
project(CircularLinkLine CUDA)
|
|
|
|
#Goal for this example:
|
|
# Verify that we de-duplicate the device link line
|
|
# Verify that a de-duplicated link line still works with circular static libraries
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CUDA_STANDARD 11)
|
|
|
|
add_library(CUDACircularDeviceLinking1 STATIC file1.cu)
|
|
add_library(CUDACircularDeviceLinking2 STATIC file2.cu)
|
|
add_library(CUDACircularDeviceLinking3 STATIC file3.cu)
|
|
add_executable(CudaOnlyCircularLinkLine main.cu)
|
|
|
|
target_link_libraries(CUDACircularDeviceLinking1 PUBLIC CUDACircularDeviceLinking2)
|
|
target_link_libraries(CUDACircularDeviceLinking2 PUBLIC CUDACircularDeviceLinking3)
|
|
target_link_libraries(CUDACircularDeviceLinking3 PUBLIC CUDACircularDeviceLinking1)
|
|
|
|
target_link_libraries(CudaOnlyCircularLinkLine PRIVATE CUDACircularDeviceLinking3)
|
|
|
|
|
|
set_target_properties(CUDACircularDeviceLinking1
|
|
PROPERTIES
|
|
CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
set_target_properties(CUDACircularDeviceLinking2
|
|
PROPERTIES
|
|
CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
set_target_properties(CUDACircularDeviceLinking3
|
|
PROPERTIES
|
|
CUDA_SEPARABLE_COMPILATION ON)
|