From c1301d000a4adfc49284c8fabef4d778c61419af Mon Sep 17 00:00:00 2001 From: Rob Armstrong Date: Tue, 17 Dec 2024 22:11:52 -0800 Subject: [PATCH] Resolve Windows build issues --- Samples/0_Introduction/clock_nvrtc/CMakeLists.txt | 1 + .../0_Introduction/matrixMul_nvrtc/CMakeLists.txt | 1 + .../0_Introduction/simpleAssert_nvrtc/CMakeLists.txt | 1 + .../simpleAtomicIntrinsics_nvrtc/CMakeLists.txt | 1 + .../0_Introduction/systemWideAtomics/CMakeLists.txt | 12 +++++++----- .../0_Introduction/vectorAdd_nvrtc/CMakeLists.txt | 1 + .../inlinePTX_nvrtc/CMakeLists.txt | 1 + 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt b/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt index 4748a0cd..e7895eec 100644 --- a/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt @@ -24,6 +24,7 @@ target_compile_features(clock_nvrtc PRIVATE cxx_std_17 cuda_std_17) target_link_libraries(clock_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy clock_kernel.cu to the output directory diff --git a/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt b/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt index 399086d1..5fa3734b 100644 --- a/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt @@ -24,6 +24,7 @@ target_compile_features(matrixMul_nvrtc PRIVATE cxx_std_17 cuda_std_17) target_link_libraries(matrixMul_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy clock_kernel.cu to the output directory diff --git a/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt b/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt index 2febc5d8..b3232155 100644 --- a/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt @@ -24,6 +24,7 @@ target_compile_features(simpleAssert_nvrtc PRIVATE cxx_std_17 cuda_std_17) target_link_libraries(simpleAssert_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy clock_kernel.cu to the output directory diff --git a/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt b/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt index 1fa0e9d7..63272fc3 100644 --- a/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt @@ -24,6 +24,7 @@ target_compile_features(simpleAtomicIntrinsics_nvrtc PRIVATE cxx_std_17 cuda_std target_link_libraries(simpleAtomicIntrinsics_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy clock_kernel.cu to the output directory diff --git a/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt b/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt index 368b904e..934189ba 100644 --- a/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt +++ b/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt @@ -15,11 +15,13 @@ endif() include_directories(../../../Common) # Source file -# Add target for systemWideAtomics -add_executable(systemWideAtomics systemWideAtomics.cu) +# Add target for systemWideAtomics (Linux-only) +if(NOT WIN32) + add_executable(systemWideAtomics systemWideAtomics.cu) -target_compile_options(systemWideAtomics PRIVATE $<$:--extended-lambda>) + target_compile_options(systemWideAtomics PRIVATE $<$:--extended-lambda>) -target_compile_features(systemWideAtomics PRIVATE cxx_std_17 cuda_std_17) + target_compile_features(systemWideAtomics PRIVATE cxx_std_17 cuda_std_17) -set_target_properties(systemWideAtomics PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + set_target_properties(systemWideAtomics PROPERTIES CUDA_SEPARABLE_COMPILATION ON) +endif() diff --git a/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt b/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt index c2510a4f..7dfc851f 100644 --- a/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt @@ -24,6 +24,7 @@ target_compile_features(vectorAdd_nvrtc PRIVATE cxx_std_17 cuda_std_17) target_link_libraries(vectorAdd_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy vectorAdd_kernel.cu to the output directory diff --git a/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt index 075120f8..fc97283d 100644 --- a/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt @@ -26,6 +26,7 @@ set_target_properties(inlinePTX_nvrtc PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(inlinePTX_nvrtc PRIVATE CUDA::nvrtc + CUDA::cuda_driver ) # Copy clock_kernel.cu to the output directory