diff options
author | Brad King <brad.king@kitware.com> | 2020-05-21 15:19:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-22 10:50:19 (GMT) |
commit | d8eee80e3091ebdc1af2208ec6e94d885b279be9 (patch) | |
tree | b3e9b51d85b895e0f89c75a6b71d95c6769f320e /Tests/CudaOnly | |
parent | 345d707cf0d68c27edcaa9f76ac3257303750b70 (diff) | |
parent | e55b21e24ee81f5433b8ec778aa341c485d6e149 (diff) | |
download | CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.zip CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.tar.gz CMake-d8eee80e3091ebdc1af2208ec6e94d885b279be9.tar.bz2 |
Merge branch 'backport-cuda-default-runtime' into cuda-default-runtime
Diffstat (limited to 'Tests/CudaOnly')
-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 69190c7..8244b91 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 0000000..24ff478 --- /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 0000000..766b775 --- /dev/null +++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/main.cu @@ -0,0 +1,5 @@ + +int main() +{ + return 0; +} |