diff options
author | Brad King <brad.king@kitware.com> | 2020-05-22 10:55:22 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-22 06:55:37 -0400 |
commit | b54280beb7d32976269d037edfb06b60d6ce0862 (patch) | |
tree | d0bf21c46d31812322203a889ee508a637b257b3 /Tests | |
parent | 23acffe5ddadea24db999e34081544cb1bc40823 (diff) | |
parent | d8eee80e3091ebdc1af2208ec6e94d885b279be9 (diff) | |
download | cmake-b54280beb7d32976269d037edfb06b60d6ce0862.tar.gz |
Merge topic 'cuda-default-runtime'
d8eee80e30 Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime
e55b21e24e CUDA: Compute CMAKE_CUDA_RUNTIME_LIBRARY default from toolchain
1086e930dc CUDA: Propagate CMAKE_CUDA_RUNTIME_LIBRARY state to try_compile
a4ea293153 Help: Correct CMAKE_CUDA_RUNTIME_LIBRARY applicability
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4762
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CudaOnly/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt index 69190c7c98..8244b91640 100644 --- a/Tests/CudaOnly/CMakeLists.txt +++ b/Tests/CudaOnly/CMakeLists.txt @@ -9,6 +9,8 @@ ADD_TEST_MACRO(CudaOnly.Toolkit CudaOnlyToolkit) ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs) if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang") + ADD_TEST_MACRO(CudaOnly.SharedRuntimeViaCUDAFlags CudaOnlySharedRuntimeViaCUDAFlags) + # Separable compilation is currently only supported on NVCC. Disable tests # using it for other compilers. ADD_TEST_MACRO(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine) diff --git a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt new file mode 100644 index 0000000000..24ff4781ad --- /dev/null +++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.17) +project(SharedRuntimeViaCUDAFlags NONE) + +set(CMAKE_CUDA_FLAGS "") +string(APPEND CMAKE_CUDA_FLAGS "-cudart shared") + +enable_language(CUDA) + +add_executable(CudaOnlySharedRuntimeViaCUDAFlags main.cu) + +if(UNIX) + # Help the shared cuda runtime find libcudart as it is not located + # in a default system searched location + set_property(TARGET CudaOnlySharedRuntimeViaCUDAFlags PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}) +endif() diff --git a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu new file mode 100644 index 0000000000..766b7751bf --- /dev/null +++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} |