From e3a5ae4aca454586347c6f4a5d1e2d23b41aff4c Mon Sep 17 00:00:00 2001 From: Rob Armstrong Date: Tue, 4 Feb 2025 09:48:40 -0800 Subject: [PATCH] Library samples: Fix malformed CMakeLists.txt --- .../freeImageInteropNPP/CMakeLists.txt | 20 +++++++++--------- .../histEqualizationNPP/CMakeLists.txt | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/Samples/4_CUDA_Libraries/freeImageInteropNPP/CMakeLists.txt b/Samples/4_CUDA_Libraries/freeImageInteropNPP/CMakeLists.txt index f3409884..143c0090 100644 --- a/Samples/4_CUDA_Libraries/freeImageInteropNPP/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/freeImageInteropNPP/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(CUDAToolkit REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 72 75 80 86 87 89 90 100 101 120) +set(CMAKE_CUDA_ARCHITECTURES all-major) if(CMAKE_BUILD_TYPE STREQUAL "Debug") # set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive) endif() @@ -26,9 +26,9 @@ if(${FreeImage_FOUND}) # Add target for freeImageInteropNPP add_executable(freeImageInteropNPP freeImageInteropNPP.cpp) -target_compile_options(freeImageInteropNPP PRIVATE $<$:--extended-lambda>) + target_compile_options(freeImageInteropNPP PRIVATE $<$:--extended-lambda>) -target_compile_features(freeImageInteropNPP PRIVATE cxx_std_17 cuda_std_17) + target_compile_features(freeImageInteropNPP PRIVATE cxx_std_17 cuda_std_17) set_target_properties(freeImageInteropNPP PROPERTIES CUDA_SEPARABLE_COMPILATION ON) @@ -44,13 +44,13 @@ target_compile_features(freeImageInteropNPP PRIVATE cxx_std_17 cuda_std_17) CUDA::cudart ${FreeImage_LIBRARIES} ) + + # Copy data files to output directory + add_custom_command(TARGET freeImageInteropNPP POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm + ${CMAKE_CURRENT_BINARY_DIR}/ + ) else() message(STATUS "FreeImage not found - will not build sample 'freeImageInteropNPP'") endif() - -# Copy data files to output directory -add_custom_command(TARGET freeImageInteropNPP POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm - ${CMAKE_CURRENT_BINARY_DIR}/ -) diff --git a/Samples/4_CUDA_Libraries/histEqualizationNPP/CMakeLists.txt b/Samples/4_CUDA_Libraries/histEqualizationNPP/CMakeLists.txt index 79efe5ea..31fd34a9 100644 --- a/Samples/4_CUDA_Libraries/histEqualizationNPP/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/histEqualizationNPP/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(CUDAToolkit REQUIRED) set(CMAKE_POSITION_INDEPENDENT_CODE ON) -set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 72 75 80 86 87 89 90 100 101 120) +set(CMAKE_CUDA_ARCHITECTURES all-major) if(CMAKE_BUILD_TYPE STREQUAL "Debug") # set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive) endif() @@ -26,9 +26,9 @@ if(${FreeImage_FOUND}) # Add target for histEqualizationNPP add_executable(histEqualizationNPP histEqualizationNPP.cpp) -target_compile_options(histEqualizationNPP PRIVATE $<$:--extended-lambda>) + target_compile_options(histEqualizationNPP PRIVATE $<$:--extended-lambda>) -target_compile_features(histEqualizationNPP PRIVATE cxx_std_17 cuda_std_17) + target_compile_features(histEqualizationNPP PRIVATE cxx_std_17 cuda_std_17) set_target_properties(histEqualizationNPP PROPERTIES CUDA_SEPARABLE_COMPILATION ON) @@ -45,13 +45,14 @@ target_compile_features(histEqualizationNPP PRIVATE cxx_std_17 cuda_std_17) CUDA::cudart ${FreeImage_LIBRARIES} ) + + # Copy data files to output directory + add_custom_command(TARGET histEqualizationNPP POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm + ${CMAKE_CURRENT_BINARY_DIR}/ + ) + else() message(STATUS "FreeImage not found - will not build sample 'histEqualizationNPP'") endif() - -# Copy data files to output directory -add_custom_command(TARGET histEqualizationNPP POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/teapot512.pgm - ${CMAKE_CURRENT_BINARY_DIR}/ -)