diff options
author | Robert Maynard <rmaynard@nvidia.com> | 2023-12-14 19:05:28 (GMT) |
---|---|---|
committer | Robert Maynard <rmaynard@nvidia.com> | 2023-12-14 19:05:28 (GMT) |
commit | 04959e0285a1473a40b5053b453988aff9bb7534 (patch) | |
tree | 55a120317494a08dce12150a8d07172935686cf6 /Tests/CudaOnly/Toolkit | |
parent | 09a3c8b46b745be1edbd83bc0c22d15b2dc02552 (diff) | |
download | CMake-04959e0285a1473a40b5053b453988aff9bb7534.zip CMake-04959e0285a1473a40b5053b453988aff9bb7534.tar.gz CMake-04959e0285a1473a40b5053b453988aff9bb7534.tar.bz2 |
Tests: Verify CUDA::cupti existence on a subset of machines
When we know that the cupti library exists explicitly request the CUDA Toolkit test to verify the existence
Diffstat (limited to 'Tests/CudaOnly/Toolkit')
-rw-r--r-- | Tests/CudaOnly/Toolkit/CMakeLists.txt | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt index 506fc9f..b2694bf 100644 --- a/Tests/CudaOnly/Toolkit/CMakeLists.txt +++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt @@ -41,7 +41,6 @@ if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11) list(APPEND cuda_libs nvgraph) endif() - # Verify that all the CUDA:: targets and variables exist foreach (cuda_lib IN LISTS cuda_libs) if(NOT CUDA_${cuda_lib}_LIBRARY) @@ -81,5 +80,24 @@ foreach (cuda_lib nvrtc nvToolsExt OpenCL) endif() endforeach() +if(HAS_CUPTI) + set(cupti_libs ) + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.2) + list(APPEND cupti_libs cupti nvperf_target) + endif() + if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 11.3) + list(APPEND cupti_libs pcsamplingutil) + endif() + + foreach (cuda_lib IN LISTS cupti_libs) + if(NOT CUDA_${cuda_lib}_LIBRARY) + message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found") + endif() + if(NOT TARGET CUDA::${cuda_lib}) + message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found") + endif() + endforeach() +endif() + add_executable(CudaOnlyToolkit main.cu) target_link_libraries(CudaOnlyToolkit PRIVATE CUDA::toolkit) |