diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dd20c7b..92e580e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,4 +22,7 @@ endif() set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --extended-lambda") +# Include installation configuration before processing samples +include(cmake/InstallSamples.cmake) + add_subdirectory(Samples) diff --git a/Common/helper_multiprocess.h b/Common/helper_multiprocess.h index 7335e406..c1033579 100644 --- a/Common/helper_multiprocess.h +++ b/Common/helper_multiprocess.h @@ -54,8 +54,14 @@ #endif #include +// The Unix domain sockets creating folder on QNX has been restricted to qnx6-mounted directories since QNX SDP 8.0.3. +#if defined(__QNX__) + #include + inline std::string getSocketFolder() { + return "/storage"; + } // Simple filesystem compatibility for GCC 8.x -#if defined(__GNUC__) && __GNUC__ < 9 +#elif defined(__GNUC__) && __GNUC__ < 9 #include #include inline std::string getSocketFolder() { diff --git a/README.md b/README.md index 41e746fa..32a822e5 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,72 @@ To build samples with new CUDA Toolkit(CUDA 13.0 or later) and UMD(Version 580 o cmake -DCMAKE_PREFIX_PATH=/usr/local/cuda/lib64/stubs/ .. ``` +## Install Samples + +### Installation Path Structure + +The installation system automatically organizes samples into a structured directory layout based on: +- **Target Architecture**: ${CMAKE_SYSTEM_PROCESSOR}, e.g. `x64`, `aarch64`, `amd64`, etc. +- **Target OS**: `linux`, `windows`, `darwin`, `qnx` +- **Build Type**: `release`, `debug`, etc. + +The default installation path is: `build/bin/${TARGET_ARCH}/${TARGET_OS}/${BUILD_TYPE}` + +**Examples:** +- Linux x86_64 Release: `build/bin/x64/linux/release` +- Linux aarch64 Release: `build/bin/aarch64/linux/release` +- Windows amd64 Release: `build/bin/amd64/windows/release` + +### Customizing Installation Paths + +You can customize the installation location using CMake variables during the configuration step: + +- `CMAKE_INSTALL_PREFIX`: Changes the root installation directory (default: `build/bin`) + ``` + cmake -DCMAKE_INSTALL_PREFIX=/custom/path .. + ``` + This will install to: `/custom/path/${TARGET_ARCH}/${TARGET_OS}/${BUILD_TYPE}` + +- `CUDA_SAMPLES_INSTALL_DIR`: Specifies the exact final installation directory (overrides the structured path) + ``` + cmake -DCUDA_SAMPLES_INSTALL_DIR=/exact/install/path .. + ``` + +### Install Samples on Linux + +**Prerequisites:** You must first configure the project with CMake as described in the [Building CUDA Samples - Linux](#linux) or [Building]section. + +After configuring and building, install the samples: + +``` +cd build/ +make install +``` + +### Install Samples on Windows + +**Prerequisites:** You must first configure the project with CMake as described in the [Building CUDA Samples - Windows](#windows) section. + +#### Using Command Line + +After configuring with CMake, build and install from the `x64 Native Tools Command Prompt for VS`: + +```cmd +cd build +cmake --build . --config Release +cmake --install . --config Release +``` + +**Note:** Replace `Release` with `Debug` if you want to install debug builds. For multi-configuration generators (like Visual Studio), the `--config` flag determines which build type to install. + +#### Using Visual Studio IDE + +Alternatively, open the generated solution file `CUDA_Samples.sln` in Visual Studio: +1. Select the desired configuration (`Release` or `Debug`) +2. Build the solution (F7 or Build > Build Solution) +3. Right-click on the `INSTALL` target under `CMakePredefinedTargets` in Solution Explorer +4. Select "Build" + ## Running All Samples as Tests It's important to note that the CUDA samples are _not_ intended as a validation suite for CUDA. They do not cover corner cases, they do not completely cover the @@ -383,6 +449,9 @@ Samples that demonstrate performance optimization. ### [7. libNVVM](./Samples/7_libNVVM/README.md) Samples that demonstrate the use of libNVVVM and NVVM IR. +### [8. Platform Specific](./Samples/8_Platform_Specific/Tegra/README.md) +Samples that are specific to certain platforms (Tegra, cuDLA, NvMedia, NvSci, OpenGL ES). + ## Dependencies Some CUDA Samples rely on third-party applications and/or libraries, or features provided by the CUDA Toolkit and Driver, to either build or execute. These dependencies are listed below. diff --git a/Samples/0_Introduction/UnifiedMemoryStreams/CMakeLists.txt b/Samples/0_Introduction/UnifiedMemoryStreams/CMakeLists.txt index d92baee3..b86e9cb1 100644 --- a/Samples/0_Introduction/UnifiedMemoryStreams/CMakeLists.txt +++ b/Samples/0_Introduction/UnifiedMemoryStreams/CMakeLists.txt @@ -49,3 +49,7 @@ target_compile_features(UnifiedMemoryStreams PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenMP not found - will not build sample 'UnifiedMemoryStreams'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/asyncAPI/CMakeLists.txt b/Samples/0_Introduction/asyncAPI/CMakeLists.txt index 33d160df..ec50945b 100644 --- a/Samples/0_Introduction/asyncAPI/CMakeLists.txt +++ b/Samples/0_Introduction/asyncAPI/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(asyncAPI PRIVATE $<$:--extended-la target_compile_features(asyncAPI PRIVATE cxx_std_17 cuda_std_17) set_target_properties(asyncAPI PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/clock/CMakeLists.txt b/Samples/0_Introduction/clock/CMakeLists.txt index e274a40e..b9d71781 100644 --- a/Samples/0_Introduction/clock/CMakeLists.txt +++ b/Samples/0_Introduction/clock/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(clock PRIVATE $<$:--extended-lambd target_compile_features(clock PRIVATE cxx_std_17 cuda_std_17) set_target_properties(clock PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt b/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt index 94fa4691..9d5abe4c 100644 --- a/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/clock_nvrtc/CMakeLists.txt @@ -37,3 +37,7 @@ add_custom_command(TARGET clock_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/clock_kernel.cu ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/cudaOpenMP/CMakeLists.txt b/Samples/0_Introduction/cudaOpenMP/CMakeLists.txt index 97749d58..991936c1 100644 --- a/Samples/0_Introduction/cudaOpenMP/CMakeLists.txt +++ b/Samples/0_Introduction/cudaOpenMP/CMakeLists.txt @@ -37,3 +37,7 @@ target_compile_features(cudaOpenMP PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenMP not found - will not build sample 'cudaOpenMP'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/fp16ScalarProduct/CMakeLists.txt b/Samples/0_Introduction/fp16ScalarProduct/CMakeLists.txt index 0906205c..3f2a3d34 100644 --- a/Samples/0_Introduction/fp16ScalarProduct/CMakeLists.txt +++ b/Samples/0_Introduction/fp16ScalarProduct/CMakeLists.txt @@ -27,3 +27,7 @@ target_compile_options(fp16ScalarProduct PRIVATE $<$:--ex target_compile_features(fp16ScalarProduct PRIVATE cxx_std_17 cuda_std_17) set_target_properties(fp16ScalarProduct PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/matrixMul/CMakeLists.txt b/Samples/0_Introduction/matrixMul/CMakeLists.txt index 004967e2..9293df3f 100644 --- a/Samples/0_Introduction/matrixMul/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMul/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(matrixMul PRIVATE $<$:--extended-l target_compile_features(matrixMul PRIVATE cxx_std_17 cuda_std_17) set_target_properties(matrixMul PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt b/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt index c777fbd6..735cbe62 100644 --- a/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMulDrv/CMakeLists.txt @@ -66,3 +66,7 @@ add_custom_target(generate_fatbin_matmulDrv ALL DEPENDS ${CUDA_FATBIN_FILE}) # Ensure matrixMulDrv depends on the fatbin add_dependencies(matrixMulDrv generate_fatbin_matmulDrv) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt b/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt index 3058893e..6cd324cd 100644 --- a/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt @@ -45,3 +45,7 @@ target_link_libraries(matrixMulDynlinkJIT PUBLIC if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") target_link_libraries(matrixMulDynlinkJIT PUBLIC dl) endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt b/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt index 48c4d32d..adaa1d48 100644 --- a/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMul_nvrtc/CMakeLists.txt @@ -55,3 +55,7 @@ add_custom_command(TARGET matrixMul_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CUDA_INCLUDE_DIR}/cccl/cuda ${CMAKE_CURRENT_BINARY_DIR}/cuda ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/mergeSort/CMakeLists.txt b/Samples/0_Introduction/mergeSort/CMakeLists.txt index e8036b72..cc8747ca 100644 --- a/Samples/0_Introduction/mergeSort/CMakeLists.txt +++ b/Samples/0_Introduction/mergeSort/CMakeLists.txt @@ -31,3 +31,7 @@ set_target_properties(mergeSort PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(mergeSort PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAWBarrier/CMakeLists.txt b/Samples/0_Introduction/simpleAWBarrier/CMakeLists.txt index 18f001e2..7bcb8360 100644 --- a/Samples/0_Introduction/simpleAWBarrier/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAWBarrier/CMakeLists.txt @@ -35,3 +35,7 @@ target_compile_options(simpleAWBarrier PRIVATE $<$:--exte target_compile_features(simpleAWBarrier PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleAWBarrier PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAssert/CMakeLists.txt b/Samples/0_Introduction/simpleAssert/CMakeLists.txt index 87d328c4..ab0406c8 100644 --- a/Samples/0_Introduction/simpleAssert/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAssert/CMakeLists.txt @@ -31,3 +31,7 @@ target_compile_options(simpleAssert PRIVATE $<$:--extende target_compile_features(simpleAssert PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleAssert PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt b/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt index 263d7963..d473058e 100644 --- a/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAssert_nvrtc/CMakeLists.txt @@ -37,3 +37,7 @@ add_custom_command(TARGET simpleAssert_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/simpleAssert_kernel.cu ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAtomicIntrinsics/CMakeLists.txt b/Samples/0_Introduction/simpleAtomicIntrinsics/CMakeLists.txt index 4203a937..7ec8e447 100644 --- a/Samples/0_Introduction/simpleAtomicIntrinsics/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAtomicIntrinsics/CMakeLists.txt @@ -29,3 +29,7 @@ target_compile_options(simpleAtomicIntrinsics PRIVATE $<$ target_compile_features(simpleAtomicIntrinsics PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleAtomicIntrinsics PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt b/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt index 3aac1e90..9c659d62 100644 --- a/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAtomicIntrinsics_nvrtc/CMakeLists.txt @@ -38,3 +38,7 @@ add_custom_command(TARGET simpleAtomicIntrinsics_nvrtc POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/simpleAtomicIntrinsics_kernel.cuh ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleAttributes/CMakeLists.txt b/Samples/0_Introduction/simpleAttributes/CMakeLists.txt index 389fdfc8..d481f57b 100644 --- a/Samples/0_Introduction/simpleAttributes/CMakeLists.txt +++ b/Samples/0_Introduction/simpleAttributes/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleAttributes PRIVATE $<$:--ext target_compile_features(simpleAttributes PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleAttributes PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleCUDA2GL/CMakeLists.txt b/Samples/0_Introduction/simpleCUDA2GL/CMakeLists.txt index 64a46f06..661eba02 100644 --- a/Samples/0_Introduction/simpleCUDA2GL/CMakeLists.txt +++ b/Samples/0_Introduction/simpleCUDA2GL/CMakeLists.txt @@ -86,3 +86,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'simpleCUDA2GL'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleCallback/CMakeLists.txt b/Samples/0_Introduction/simpleCallback/CMakeLists.txt index 1c907a6d..8c19b28f 100644 --- a/Samples/0_Introduction/simpleCallback/CMakeLists.txt +++ b/Samples/0_Introduction/simpleCallback/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleCallback PRIVATE $<$:--exten target_compile_features(simpleCallback PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleCallback PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleCooperativeGroups/CMakeLists.txt b/Samples/0_Introduction/simpleCooperativeGroups/CMakeLists.txt index e1d3d5d9..cd0659f0 100644 --- a/Samples/0_Introduction/simpleCooperativeGroups/CMakeLists.txt +++ b/Samples/0_Introduction/simpleCooperativeGroups/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleCooperativeGroups PRIVATE $<$:- target_compile_features(simpleCubemapTexture PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleCubemapTexture PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt b/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt index 0774b4d5..a05e5b60 100644 --- a/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt +++ b/Samples/0_Introduction/simpleDrvRuntime/CMakeLists.txt @@ -68,3 +68,7 @@ add_custom_target(generate_fatbin_simpleDrv ALL DEPENDS ${CUDA_FATBIN_FILE}) # Ensure simpleDrvRuntime depends on the fatbin add_dependencies(simpleDrvRuntime generate_fatbin_simpleDrv) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleHyperQ/CMakeLists.txt b/Samples/0_Introduction/simpleHyperQ/CMakeLists.txt index add335e5..160d058f 100644 --- a/Samples/0_Introduction/simpleHyperQ/CMakeLists.txt +++ b/Samples/0_Introduction/simpleHyperQ/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleHyperQ PRIVATE $<$:--extende target_compile_features(simpleHyperQ PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleHyperQ PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleIPC/CMakeLists.txt b/Samples/0_Introduction/simpleIPC/CMakeLists.txt index 424f98ca..2e88a7e0 100644 --- a/Samples/0_Introduction/simpleIPC/CMakeLists.txt +++ b/Samples/0_Introduction/simpleIPC/CMakeLists.txt @@ -32,3 +32,7 @@ else() set_target_properties(simpleIPC PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleLayeredTexture/CMakeLists.txt b/Samples/0_Introduction/simpleLayeredTexture/CMakeLists.txt index a60a9d27..86ad2817 100644 --- a/Samples/0_Introduction/simpleLayeredTexture/CMakeLists.txt +++ b/Samples/0_Introduction/simpleLayeredTexture/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleLayeredTexture PRIVATE $<$:- target_compile_features(simpleLayeredTexture PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleLayeredTexture PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleMPI/CMakeLists.txt b/Samples/0_Introduction/simpleMPI/CMakeLists.txt index 3c781f03..77b78c10 100644 --- a/Samples/0_Introduction/simpleMPI/CMakeLists.txt +++ b/Samples/0_Introduction/simpleMPI/CMakeLists.txt @@ -44,3 +44,7 @@ target_compile_features(simpleMPI PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "MPI not found - will not build sample 'simpleMPI'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleMultiCopy/CMakeLists.txt b/Samples/0_Introduction/simpleMultiCopy/CMakeLists.txt index 0e922b68..1e2d809e 100644 --- a/Samples/0_Introduction/simpleMultiCopy/CMakeLists.txt +++ b/Samples/0_Introduction/simpleMultiCopy/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleMultiCopy PRIVATE $<$:--exte target_compile_features(simpleMultiCopy PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleMultiCopy PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleMultiGPU/CMakeLists.txt b/Samples/0_Introduction/simpleMultiGPU/CMakeLists.txt index 81ed2c4e..e88e0c29 100644 --- a/Samples/0_Introduction/simpleMultiGPU/CMakeLists.txt +++ b/Samples/0_Introduction/simpleMultiGPU/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleMultiGPU PRIVATE $<$:--exten target_compile_features(simpleMultiGPU PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleMultiGPU PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleOccupancy/CMakeLists.txt b/Samples/0_Introduction/simpleOccupancy/CMakeLists.txt index c5081c68..fbd4ec77 100644 --- a/Samples/0_Introduction/simpleOccupancy/CMakeLists.txt +++ b/Samples/0_Introduction/simpleOccupancy/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleOccupancy PRIVATE $<$:--exte target_compile_features(simpleOccupancy PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleOccupancy PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleP2P/CMakeLists.txt b/Samples/0_Introduction/simpleP2P/CMakeLists.txt index f229e4b4..ddfe6c11 100644 --- a/Samples/0_Introduction/simpleP2P/CMakeLists.txt +++ b/Samples/0_Introduction/simpleP2P/CMakeLists.txt @@ -32,3 +32,7 @@ else() set_target_properties(simpleP2P PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simplePitchLinearTexture/CMakeLists.txt b/Samples/0_Introduction/simplePitchLinearTexture/CMakeLists.txt index 3aaee214..7a72745c 100644 --- a/Samples/0_Introduction/simplePitchLinearTexture/CMakeLists.txt +++ b/Samples/0_Introduction/simplePitchLinearTexture/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simplePitchLinearTexture PRIVATE $<$:--extende target_compile_features(simplePrintf PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simplePrintf PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleStreams/CMakeLists.txt b/Samples/0_Introduction/simpleStreams/CMakeLists.txt index 2c9723b3..8e4be29e 100644 --- a/Samples/0_Introduction/simpleStreams/CMakeLists.txt +++ b/Samples/0_Introduction/simpleStreams/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleStreams PRIVATE $<$:--extend target_compile_features(simpleStreams PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleStreams PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleSurfaceWrite/CMakeLists.txt b/Samples/0_Introduction/simpleSurfaceWrite/CMakeLists.txt index f48cbd2a..f7c5d5fc 100644 --- a/Samples/0_Introduction/simpleSurfaceWrite/CMakeLists.txt +++ b/Samples/0_Introduction/simpleSurfaceWrite/CMakeLists.txt @@ -35,3 +35,7 @@ add_custom_command(TARGET simpleSurfaceWrite POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleTemplates/CMakeLists.txt b/Samples/0_Introduction/simpleTemplates/CMakeLists.txt index 939ba37d..e4ae61e1 100644 --- a/Samples/0_Introduction/simpleTemplates/CMakeLists.txt +++ b/Samples/0_Introduction/simpleTemplates/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleTemplates PRIVATE $<$:--exte target_compile_features(simpleTemplates PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleTemplates PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleTexture/CMakeLists.txt b/Samples/0_Introduction/simpleTexture/CMakeLists.txt index 8522dbb4..d6a37b65 100644 --- a/Samples/0_Introduction/simpleTexture/CMakeLists.txt +++ b/Samples/0_Introduction/simpleTexture/CMakeLists.txt @@ -42,3 +42,7 @@ add_custom_command(TARGET simpleTexture POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_rotated.pgm ${CMAKE_CURRENT_BINARY_DIR}/ ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleTexture3D/CMakeLists.txt b/Samples/0_Introduction/simpleTexture3D/CMakeLists.txt index 9dc04d43..f6baaf28 100644 --- a/Samples/0_Introduction/simpleTexture3D/CMakeLists.txt +++ b/Samples/0_Introduction/simpleTexture3D/CMakeLists.txt @@ -90,3 +90,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'simpleTexture3D'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt b/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt index 19f7f079..e9e36b02 100644 --- a/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt +++ b/Samples/0_Introduction/simpleTextureDrv/CMakeLists.txt @@ -79,3 +79,7 @@ add_custom_target(generate_fatbin_textureDrv ALL DEPENDS ${CUDA_FATBIN_FILE}) # Ensure simpleTextureDrv depends on the fatbin add_dependencies(simpleTextureDrv generate_fatbin_textureDrv) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleVoteIntrinsics/CMakeLists.txt b/Samples/0_Introduction/simpleVoteIntrinsics/CMakeLists.txt index c999b003..11fa110f 100644 --- a/Samples/0_Introduction/simpleVoteIntrinsics/CMakeLists.txt +++ b/Samples/0_Introduction/simpleVoteIntrinsics/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleVoteIntrinsics PRIVATE $<$:- target_compile_features(simpleVoteIntrinsics PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleVoteIntrinsics PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/simpleZeroCopy/CMakeLists.txt b/Samples/0_Introduction/simpleZeroCopy/CMakeLists.txt index c20b3c98..536271db 100644 --- a/Samples/0_Introduction/simpleZeroCopy/CMakeLists.txt +++ b/Samples/0_Introduction/simpleZeroCopy/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleZeroCopy PRIVATE $<$:--exten target_compile_features(simpleZeroCopy PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleZeroCopy PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt b/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt index 9dba6850..7e37ff90 100644 --- a/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt +++ b/Samples/0_Introduction/systemWideAtomics/CMakeLists.txt @@ -36,3 +36,7 @@ else() message(STATUS "Will not build sample systemWideAtomics - requires Linux OS") endif() endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/template/CMakeLists.txt b/Samples/0_Introduction/template/CMakeLists.txt index 3e408dee..42e614e9 100644 --- a/Samples/0_Introduction/template/CMakeLists.txt +++ b/Samples/0_Introduction/template/CMakeLists.txt @@ -29,3 +29,7 @@ target_compile_options(template PRIVATE $<$:--extended-la target_compile_features(template PRIVATE cxx_std_17 cuda_std_17) set_target_properties(template PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/vectorAdd/CMakeLists.txt b/Samples/0_Introduction/vectorAdd/CMakeLists.txt index e1f4c2e1..b3f03225 100644 --- a/Samples/0_Introduction/vectorAdd/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAdd/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(vectorAdd PRIVATE $<$:--extended-l target_compile_features(vectorAdd PRIVATE cxx_std_17 cuda_std_17) set_target_properties(vectorAdd PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt b/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt index 0b6a3477..a08c02c9 100644 --- a/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAddDrv/CMakeLists.txt @@ -65,3 +65,7 @@ add_custom_target(generate_fatbin_vectorAdd ALL DEPENDS ${CUDA_FATBIN_FILE}) # Ensure matrixMulDrv depends on the fatbin add_dependencies(vectorAddDrv generate_fatbin_vectorAdd) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/vectorAddMMAP/CMakeLists.txt b/Samples/0_Introduction/vectorAddMMAP/CMakeLists.txt index c8b9949b..8989d1c3 100644 --- a/Samples/0_Introduction/vectorAddMMAP/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAddMMAP/CMakeLists.txt @@ -61,3 +61,7 @@ else() # Ensure matrixMulDrv depends on the fatbin add_dependencies(vectorAddMMAP generate_fatbin_vectorAddMMAP) endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt b/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt index 5f5ca542..75350c96 100644 --- a/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt +++ b/Samples/0_Introduction/vectorAdd_nvrtc/CMakeLists.txt @@ -37,3 +37,7 @@ add_custom_command(TARGET vectorAdd_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/vectorAdd_kernel.cu ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/1_Utilities/deviceQuery/CMakeLists.txt b/Samples/1_Utilities/deviceQuery/CMakeLists.txt index eed2acd4..110d95cd 100644 --- a/Samples/1_Utilities/deviceQuery/CMakeLists.txt +++ b/Samples/1_Utilities/deviceQuery/CMakeLists.txt @@ -36,3 +36,7 @@ target_include_directories(deviceQuery PRIVATE target_link_libraries(deviceQuery PUBLIC CUDA::cudart ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/1_Utilities/deviceQueryDrv/CMakeLists.txt b/Samples/1_Utilities/deviceQueryDrv/CMakeLists.txt index c891ef03..ecb57221 100644 --- a/Samples/1_Utilities/deviceQueryDrv/CMakeLists.txt +++ b/Samples/1_Utilities/deviceQueryDrv/CMakeLists.txt @@ -35,3 +35,7 @@ target_include_directories(deviceQueryDrv PRIVATE target_link_libraries(deviceQueryDrv PUBLIC CUDA::cuda_driver ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/1_Utilities/topologyQuery/CMakeLists.txt b/Samples/1_Utilities/topologyQuery/CMakeLists.txt index e8b236b9..7d83b778 100644 --- a/Samples/1_Utilities/topologyQuery/CMakeLists.txt +++ b/Samples/1_Utilities/topologyQuery/CMakeLists.txt @@ -32,3 +32,7 @@ else() set_target_properties(topologyQuery PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_CrossGPU/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_CrossGPU/CMakeLists.txt index f576cd75..4db89334 100644 --- a/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_CrossGPU/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_CrossGPU/CMakeLists.txt @@ -48,3 +48,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample EGLStream_CUDA_CrossGPU - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/CMakeLists.txt index ced3a650..b02abc04 100644 --- a/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/EGLStream_CUDA_Interop/CMakeLists.txt @@ -49,3 +49,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample EGLStream_CUDA_Interop - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/FunctionPointers/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/FunctionPointers/CMakeLists.txt index af85634f..be26e2dc 100644 --- a/Samples/2_Concepts_and_Techniques/FunctionPointers/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/FunctionPointers/CMakeLists.txt @@ -60,7 +60,7 @@ if(${OpenGL_FOUND}) add_custom_command(TARGET FunctionPointers POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data - ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR}/data ) if(WIN32) @@ -90,3 +90,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'FunctionPointers'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineP/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineP/CMakeLists.txt index a2a6d274..191b97ba 100644 --- a/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineP/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineP/CMakeLists.txt @@ -33,3 +33,7 @@ target_include_directories(MC_EstimatePiInlineP PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineQ/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineQ/CMakeLists.txt index b14574d8..da2e1cac 100644 --- a/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineQ/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/MC_EstimatePiInlineQ/CMakeLists.txt @@ -37,3 +37,7 @@ target_include_directories(MC_EstimatePiInlineQ PUBLIC target_link_libraries(MC_EstimatePiInlineQ PUBLIC CUDA::curand ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/MC_EstimatePiP/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/MC_EstimatePiP/CMakeLists.txt index 13809deb..66ff5979 100644 --- a/Samples/2_Concepts_and_Techniques/MC_EstimatePiP/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/MC_EstimatePiP/CMakeLists.txt @@ -37,3 +37,7 @@ target_include_directories(MC_EstimatePiP PUBLIC target_link_libraries(MC_EstimatePiP PUBLIC CUDA::curand ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/MC_EstimatePiQ/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/MC_EstimatePiQ/CMakeLists.txt index 27347048..bc06b8db 100644 --- a/Samples/2_Concepts_and_Techniques/MC_EstimatePiQ/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/MC_EstimatePiQ/CMakeLists.txt @@ -37,3 +37,7 @@ target_include_directories(MC_EstimatePiQ PUBLIC target_link_libraries(MC_EstimatePiQ PUBLIC CUDA::curand ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/MC_SingleAsianOptionP/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/MC_SingleAsianOptionP/CMakeLists.txt index 662ac04c..e1d497a3 100644 --- a/Samples/2_Concepts_and_Techniques/MC_SingleAsianOptionP/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/MC_SingleAsianOptionP/CMakeLists.txt @@ -33,3 +33,7 @@ target_include_directories(MC_SingleAsianOptionP PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/README.md b/Samples/2_Concepts_and_Techniques/README.md index b333bfdb..6d3596ca 100644 --- a/Samples/2_Concepts_and_Techniques/README.md +++ b/Samples/2_Concepts_and_Techniques/README.md @@ -10,9 +10,6 @@ This sample implements a separable convolution filter of a 2D signal with a gaus ### [convolutionTexture](./convolutionTexture) Texture-based implementation of a separable 2D convolution with a gaussian kernel. Used for performance comparison against convolutionSeparable. -### [cuHook](./cuHook) -This sample demonstrates how to build and use an intercept library with CUDA. The library has to be loaded via LD_PRELOAD, e.g. LD_PRELOAD=/libcuhook.so.1 ./cuHook - ### [dct8x8](./dct8x8) This sample demonstrates how Discrete Cosine Transform (DCT) for blocks of 8 by 8 pixels can be performed using CUDA: a naive implementation by definition and a more traditional approach used in many libraries. As opposed to implementing DCT in a fragment shader, CUDA allows for an easier and more efficient implementation. @@ -22,9 +19,6 @@ Demonstrates CUDA and EGL Streams interop, where consumer's EGL Stream is on one ### [EGLStream_CUDA_Interop](./EGLStream_CUDA_Interop) Demonstrates data exchange between CUDA and EGL Streams. -### [EGLSync_CUDAEvent_Interop](./EGLSync_CUDAEvent_Interop) -Demonstrates interoperability between CUDA Event and EGL Sync/EGL Image using which one can achieve synchronization on GPU itself for GL-EGL-CUDA operations instead of blocking CPU for synchronization. - ### [eigenvalues](./eigenvalues) The computation of all or a subset of all eigenvalues is an important problem in Linear Algebra, statistics, physics, and many other fields. This sample demonstrates a parallel implementation of a bisection algorithm for the computation of all eigenvalues of a tridiagonal symmetric matrix of arbitrary size with CUDA. diff --git a/Samples/2_Concepts_and_Techniques/boxFilter/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/boxFilter/CMakeLists.txt index 1a3e3668..8273fa7f 100644 --- a/Samples/2_Concepts_and_Techniques/boxFilter/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/boxFilter/CMakeLists.txt @@ -58,23 +58,9 @@ if(${OpenGL_FOUND}) # Copy data files to output directory add_custom_command(TARGET boxFilter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot1024.ppm - ${CMAKE_CURRENT_BINARY_DIR}/ - ) - - # Copy data files to output directory - add_custom_command(TARGET boxFilter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_14.ppm - ${CMAKE_CURRENT_BINARY_DIR}/ - ) - - # Copy data files to output directory - add_custom_command(TARGET boxFilter POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_22.ppm - ${CMAKE_CURRENT_BINARY_DIR}/ + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/data + ${CMAKE_CURRENT_BINARY_DIR}/data ) if(WIN32) @@ -104,3 +90,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'boxFilter'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/convolutionSeparable/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/convolutionSeparable/CMakeLists.txt index 9700d3da..5fe32b58 100644 --- a/Samples/2_Concepts_and_Techniques/convolutionSeparable/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/convolutionSeparable/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(convolutionSeparable PROPERTIES CUDA_SEPARABLE_COMPILATION target_include_directories(convolutionSeparable PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/convolutionTexture/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/convolutionTexture/CMakeLists.txt index 53933f43..a9589288 100644 --- a/Samples/2_Concepts_and_Techniques/convolutionTexture/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/convolutionTexture/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(convolutionTexture PROPERTIES CUDA_SEPARABLE_COMPILATION O target_include_directories(convolutionTexture PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/dct8x8/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/dct8x8/CMakeLists.txt index 3d91e837..4bd93758 100644 --- a/Samples/2_Concepts_and_Techniques/dct8x8/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/dct8x8/CMakeLists.txt @@ -53,3 +53,7 @@ add_custom_command(TARGET dct8x8 POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data/teapot512.bmp ${CMAKE_CURRENT_BINARY_DIR}/ ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/eigenvalues/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/eigenvalues/CMakeLists.txt index 7e2c61ff..af6f0355 100644 --- a/Samples/2_Concepts_and_Techniques/eigenvalues/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/eigenvalues/CMakeLists.txt @@ -49,3 +49,7 @@ add_custom_command(TARGET eigenvalues POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data/reference.dat ${CMAKE_CURRENT_BINARY_DIR}/ ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/histogram/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/histogram/CMakeLists.txt index 4562f495..e646362a 100644 --- a/Samples/2_Concepts_and_Techniques/histogram/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/histogram/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(histogram PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(histogram PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/imageDenoising/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/imageDenoising/CMakeLists.txt index a7ec3b89..aeab370b 100644 --- a/Samples/2_Concepts_and_Techniques/imageDenoising/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/imageDenoising/CMakeLists.txt @@ -91,3 +91,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'imageDenoising'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/inlinePTX/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/inlinePTX/CMakeLists.txt index 415ba3af..5ae41446 100644 --- a/Samples/2_Concepts_and_Techniques/inlinePTX/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/inlinePTX/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(inlinePTX PRIVATE $<$:--extended-l target_compile_features(inlinePTX PRIVATE cxx_std_17 cuda_std_17) set_target_properties(inlinePTX PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt index e4fef34b..0a429aa1 100644 --- a/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/inlinePTX_nvrtc/CMakeLists.txt @@ -39,3 +39,7 @@ add_custom_command(TARGET inlinePTX_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/inlinePTX_kernel.cu ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/interval/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/interval/CMakeLists.txt index 3171afd5..d0d7e097 100644 --- a/Samples/2_Concepts_and_Techniques/interval/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/interval/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(interval PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(interval PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/particles/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/particles/CMakeLists.txt index 9e1badf9..7441b7d8 100644 --- a/Samples/2_Concepts_and_Techniques/particles/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/particles/CMakeLists.txt @@ -93,3 +93,7 @@ target_compile_features(particles PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'particles'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/radixSortThrust/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/radixSortThrust/CMakeLists.txt index d9010971..291522c0 100644 --- a/Samples/2_Concepts_and_Techniques/radixSortThrust/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/radixSortThrust/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(radixSortThrust PRIVATE $<$:--exte target_compile_features(radixSortThrust PRIVATE cxx_std_17 cuda_std_17) set_target_properties(radixSortThrust PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/reduction/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/reduction/CMakeLists.txt index 2c5df2fc..4f2c1fa3 100644 --- a/Samples/2_Concepts_and_Techniques/reduction/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/reduction/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(reduction PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(reduction PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/reductionMultiBlockCG/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/reductionMultiBlockCG/CMakeLists.txt index 02b9f84d..8be01c85 100644 --- a/Samples/2_Concepts_and_Techniques/reductionMultiBlockCG/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/reductionMultiBlockCG/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(reductionMultiBlockCG PRIVATE $<$: target_compile_features(reductionMultiBlockCG PRIVATE cxx_std_17 cuda_std_17) set_target_properties(reductionMultiBlockCG PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/scalarProd/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/scalarProd/CMakeLists.txt index fb99c066..9defe3d1 100644 --- a/Samples/2_Concepts_and_Techniques/scalarProd/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/scalarProd/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(scalarProd PRIVATE $<$:--extended- target_compile_features(scalarProd PRIVATE cxx_std_17 cuda_std_17) set_target_properties(scalarProd PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/scan/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/scan/CMakeLists.txt index 23e130cd..a2de5f22 100644 --- a/Samples/2_Concepts_and_Techniques/scan/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/scan/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(scan PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(scan PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/segmentationTreeThrust/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/segmentationTreeThrust/CMakeLists.txt index cfab78cc..35279fee 100644 --- a/Samples/2_Concepts_and_Techniques/segmentationTreeThrust/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/segmentationTreeThrust/CMakeLists.txt @@ -49,3 +49,7 @@ add_custom_command(TARGET segmentationTreeThrust POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data/ref_09.ppm ${CMAKE_CURRENT_BINARY_DIR}/ ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/shfl_scan/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/shfl_scan/CMakeLists.txt index 27a27b2b..7292f91c 100644 --- a/Samples/2_Concepts_and_Techniques/shfl_scan/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/shfl_scan/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(shfl_scan PRIVATE $<$:--extended-l target_compile_features(shfl_scan PRIVATE cxx_std_17 cuda_std_17) set_target_properties(shfl_scan PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/sortingNetworks/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/sortingNetworks/CMakeLists.txt index 3b3cf079..fbefb053 100644 --- a/Samples/2_Concepts_and_Techniques/sortingNetworks/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/sortingNetworks/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(sortingNetworks PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(sortingNetworks PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/streamOrderedAllocation/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/streamOrderedAllocation/CMakeLists.txt index 1d276c50..d57efb15 100644 --- a/Samples/2_Concepts_and_Techniques/streamOrderedAllocation/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/streamOrderedAllocation/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(streamOrderedAllocation PRIVATE $<$:- target_compile_features(threadFenceReduction PRIVATE cxx_std_17 cuda_std_17) set_target_properties(threadFenceReduction PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt index cd04098a..81b626ff 100644 --- a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt @@ -70,3 +70,7 @@ add_custom_target(generate_fatbin_threadMigration ALL DEPENDS ${CUDA_FATBIN_FILE # Ensure matrixMulDrv depends on the fatbin add_dependencies(threadMigration generate_fatbin_threadMigration) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/StreamPriorities/CMakeLists.txt b/Samples/3_CUDA_Features/StreamPriorities/CMakeLists.txt index 4ca5c426..d2b347bb 100644 --- a/Samples/3_CUDA_Features/StreamPriorities/CMakeLists.txt +++ b/Samples/3_CUDA_Features/StreamPriorities/CMakeLists.txt @@ -36,3 +36,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample StreamPriorities - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/bf16TensorCoreGemm/CMakeLists.txt b/Samples/3_CUDA_Features/bf16TensorCoreGemm/CMakeLists.txt index 3e949ec6..4bec1151 100644 --- a/Samples/3_CUDA_Features/bf16TensorCoreGemm/CMakeLists.txt +++ b/Samples/3_CUDA_Features/bf16TensorCoreGemm/CMakeLists.txt @@ -33,3 +33,7 @@ target_compile_options(bf16TensorCoreGemm PRIVATE $<$:--e target_compile_features(bf16TensorCoreGemm PRIVATE cxx_std_17 cuda_std_17) set_target_properties(bf16TensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/binaryPartitionCG/CMakeLists.txt b/Samples/3_CUDA_Features/binaryPartitionCG/CMakeLists.txt index 7045500c..25c46b45 100644 --- a/Samples/3_CUDA_Features/binaryPartitionCG/CMakeLists.txt +++ b/Samples/3_CUDA_Features/binaryPartitionCG/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(binaryPartitionCG PRIVATE $<$:--ex target_compile_features(binaryPartitionCG PRIVATE cxx_std_17 cuda_std_17) set_target_properties(binaryPartitionCG PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/bindlessTexture/CMakeLists.txt b/Samples/3_CUDA_Features/bindlessTexture/CMakeLists.txt index bf2be94c..ee742504 100644 --- a/Samples/3_CUDA_Features/bindlessTexture/CMakeLists.txt +++ b/Samples/3_CUDA_Features/bindlessTexture/CMakeLists.txt @@ -90,3 +90,7 @@ target_compile_features(bindlessTexture PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'bindlessTexture'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt b/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt index edbd7698..54de78a3 100644 --- a/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpAdvancedQuicksort/CMakeLists.txt @@ -38,3 +38,7 @@ target_compile_options(cdpAdvancedQuicksort PRIVATE $<$:- target_compile_features(cdpAdvancedQuicksort PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cdpAdvancedQuicksort PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cdpBezierTessellation/CMakeLists.txt b/Samples/3_CUDA_Features/cdpBezierTessellation/CMakeLists.txt index fec2f807..3eba90fa 100644 --- a/Samples/3_CUDA_Features/cdpBezierTessellation/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpBezierTessellation/CMakeLists.txt @@ -37,3 +37,7 @@ target_compile_options(cdpBezierTessellation PRIVATE $<$: target_compile_features(cdpBezierTessellation PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cdpBezierTessellation PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cdpQuadtree/CMakeLists.txt b/Samples/3_CUDA_Features/cdpQuadtree/CMakeLists.txt index 85fe0c8c..1ecbfac1 100644 --- a/Samples/3_CUDA_Features/cdpQuadtree/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpQuadtree/CMakeLists.txt @@ -37,3 +37,7 @@ target_compile_options(cdpQuadtree PRIVATE $<$:--extended target_compile_features(cdpQuadtree PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cdpQuadtree PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cdpSimplePrint/CMakeLists.txt b/Samples/3_CUDA_Features/cdpSimplePrint/CMakeLists.txt index 726a555d..00c42182 100644 --- a/Samples/3_CUDA_Features/cdpSimplePrint/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpSimplePrint/CMakeLists.txt @@ -37,3 +37,7 @@ target_compile_options(cdpSimplePrint PRIVATE $<$:--exten target_compile_features(cdpSimplePrint PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cdpSimplePrint PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cdpSimpleQuicksort/CMakeLists.txt b/Samples/3_CUDA_Features/cdpSimpleQuicksort/CMakeLists.txt index e6eabe4e..07ab4d6e 100644 --- a/Samples/3_CUDA_Features/cdpSimpleQuicksort/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cdpSimpleQuicksort/CMakeLists.txt @@ -37,3 +37,7 @@ target_compile_options(cdpSimpleQuicksort PRIVATE $<$:--e target_compile_features(cdpSimpleQuicksort PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cdpSimpleQuicksort PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cudaCompressibleMemory/CMakeLists.txt b/Samples/3_CUDA_Features/cudaCompressibleMemory/CMakeLists.txt index d0f72466..20416c6f 100644 --- a/Samples/3_CUDA_Features/cudaCompressibleMemory/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cudaCompressibleMemory/CMakeLists.txt @@ -36,3 +36,7 @@ target_include_directories(cudaCompressibleMemory PRIVATE target_link_libraries(cudaCompressibleMemory PRIVATE CUDA::cuda_driver ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/cudaTensorCoreGemm/CMakeLists.txt b/Samples/3_CUDA_Features/cudaTensorCoreGemm/CMakeLists.txt index d4505bab..fc5c0894 100644 --- a/Samples/3_CUDA_Features/cudaTensorCoreGemm/CMakeLists.txt +++ b/Samples/3_CUDA_Features/cudaTensorCoreGemm/CMakeLists.txt @@ -29,3 +29,7 @@ target_compile_options(cudaTensorCoreGemm PRIVATE $<$:--e target_compile_features(cudaTensorCoreGemm PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cudaTensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/dmmaTensorCoreGemm/CMakeLists.txt b/Samples/3_CUDA_Features/dmmaTensorCoreGemm/CMakeLists.txt index cb94a68b..d3aa179c 100644 --- a/Samples/3_CUDA_Features/dmmaTensorCoreGemm/CMakeLists.txt +++ b/Samples/3_CUDA_Features/dmmaTensorCoreGemm/CMakeLists.txt @@ -35,3 +35,7 @@ target_compile_options(dmmaTensorCoreGemm PRIVATE $<$:--e target_compile_features(dmmaTensorCoreGemm PRIVATE cxx_std_17 cuda_std_17) set_target_properties(dmmaTensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/globalToShmemAsyncCopy/CMakeLists.txt b/Samples/3_CUDA_Features/globalToShmemAsyncCopy/CMakeLists.txt index caf971b0..47abd5e0 100644 --- a/Samples/3_CUDA_Features/globalToShmemAsyncCopy/CMakeLists.txt +++ b/Samples/3_CUDA_Features/globalToShmemAsyncCopy/CMakeLists.txt @@ -35,3 +35,7 @@ target_compile_options(globalToShmemAsyncCopy PRIVATE $<$ target_compile_features(globalToShmemAsyncCopy PRIVATE cxx_std_17 cuda_std_17) set_target_properties(globalToShmemAsyncCopy PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/graphConditionalNodes/CMakeLists.txt b/Samples/3_CUDA_Features/graphConditionalNodes/CMakeLists.txt index 07ded88d..5e7cd329 100644 --- a/Samples/3_CUDA_Features/graphConditionalNodes/CMakeLists.txt +++ b/Samples/3_CUDA_Features/graphConditionalNodes/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(graphConditionalNodes PRIVATE $<$: target_compile_features(graphConditionalNodes PRIVATE cxx_std_17 cuda_std_17) set_target_properties(graphConditionalNodes PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/graphMemoryFootprint/CMakeLists.txt b/Samples/3_CUDA_Features/graphMemoryFootprint/CMakeLists.txt index 315f6aa3..29d206b9 100644 --- a/Samples/3_CUDA_Features/graphMemoryFootprint/CMakeLists.txt +++ b/Samples/3_CUDA_Features/graphMemoryFootprint/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(graphMemoryFootprint PRIVATE $<$:- target_compile_features(graphMemoryFootprint PRIVATE cxx_std_17 cuda_std_17) set_target_properties(graphMemoryFootprint PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/graphMemoryNodes/CMakeLists.txt b/Samples/3_CUDA_Features/graphMemoryNodes/CMakeLists.txt index f202923b..aeabc6bc 100644 --- a/Samples/3_CUDA_Features/graphMemoryNodes/CMakeLists.txt +++ b/Samples/3_CUDA_Features/graphMemoryNodes/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(graphMemoryNodes PRIVATE $<$:--ext target_compile_features(graphMemoryNodes PRIVATE cxx_std_17 cuda_std_17) set_target_properties(graphMemoryNodes PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/immaTensorCoreGemm/CMakeLists.txt b/Samples/3_CUDA_Features/immaTensorCoreGemm/CMakeLists.txt index bd31d4af..7d711938 100644 --- a/Samples/3_CUDA_Features/immaTensorCoreGemm/CMakeLists.txt +++ b/Samples/3_CUDA_Features/immaTensorCoreGemm/CMakeLists.txt @@ -29,3 +29,7 @@ target_compile_options(immaTensorCoreGemm PRIVATE $<$:--e target_compile_features(immaTensorCoreGemm PRIVATE cxx_std_17 cuda_std_17) set_target_properties(immaTensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/jacobiCudaGraphs/CMakeLists.txt b/Samples/3_CUDA_Features/jacobiCudaGraphs/CMakeLists.txt index 84ad80d4..a39b81af 100644 --- a/Samples/3_CUDA_Features/jacobiCudaGraphs/CMakeLists.txt +++ b/Samples/3_CUDA_Features/jacobiCudaGraphs/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(jacobiCudaGraphs PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(jacobiCudaGraphs PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt index b57e9187..9856efbe 100644 --- a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt +++ b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt @@ -69,3 +69,7 @@ add_custom_target(generate_memMapIpc_ptx ALL DEPENDS ${CUDA_PTX_FILE}) # Ensure memMapIPCDrv depends on the fatbin add_dependencies(memMapIPCDrv generate_memMapIpc_ptx) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/newdelete/CMakeLists.txt b/Samples/3_CUDA_Features/newdelete/CMakeLists.txt index e361a5f6..4437a6d3 100644 --- a/Samples/3_CUDA_Features/newdelete/CMakeLists.txt +++ b/Samples/3_CUDA_Features/newdelete/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(newdelete PRIVATE $<$:--extended-l target_compile_features(newdelete PRIVATE cxx_std_17 cuda_std_17) set_target_properties(newdelete PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt b/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt index 575949b0..15ad74f5 100644 --- a/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt +++ b/Samples/3_CUDA_Features/ptxjit/CMakeLists.txt @@ -62,3 +62,7 @@ add_custom_target(generate_ptxjit_ptx ALL DEPENDS ${CUDA_PTX_FILE}) # Ensure ptxjit depends on the fatbin add_dependencies(ptxjit generate_ptxjit_ptx) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/simpleCudaGraphs/CMakeLists.txt b/Samples/3_CUDA_Features/simpleCudaGraphs/CMakeLists.txt index 1f61707c..b6a18373 100644 --- a/Samples/3_CUDA_Features/simpleCudaGraphs/CMakeLists.txt +++ b/Samples/3_CUDA_Features/simpleCudaGraphs/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(simpleCudaGraphs PRIVATE $<$:--ext target_compile_features(simpleCudaGraphs PRIVATE cxx_std_17 cuda_std_17) set_target_properties(simpleCudaGraphs PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/tf32TensorCoreGemm/CMakeLists.txt b/Samples/3_CUDA_Features/tf32TensorCoreGemm/CMakeLists.txt index 084d52f5..6599a6ff 100644 --- a/Samples/3_CUDA_Features/tf32TensorCoreGemm/CMakeLists.txt +++ b/Samples/3_CUDA_Features/tf32TensorCoreGemm/CMakeLists.txt @@ -35,3 +35,7 @@ target_compile_options(tf32TensorCoreGemm PRIVATE $<$:--e target_compile_features(tf32TensorCoreGemm PRIVATE cxx_std_17 cuda_std_17) set_target_properties(tf32TensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/3_CUDA_Features/warpAggregatedAtomicsCG/CMakeLists.txt b/Samples/3_CUDA_Features/warpAggregatedAtomicsCG/CMakeLists.txt index d17465f7..e3046b34 100644 --- a/Samples/3_CUDA_Features/warpAggregatedAtomicsCG/CMakeLists.txt +++ b/Samples/3_CUDA_Features/warpAggregatedAtomicsCG/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(warpAggregatedAtomicsCG PRIVATE $<$:--extended target_compile_features(lineOfSight PRIVATE cxx_std_17 cuda_std_17) set_target_properties(lineOfSight PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/matrixMulCUBLAS/CMakeLists.txt b/Samples/4_CUDA_Libraries/matrixMulCUBLAS/CMakeLists.txt index 7edf4311..260cf239 100644 --- a/Samples/4_CUDA_Libraries/matrixMulCUBLAS/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/matrixMulCUBLAS/CMakeLists.txt @@ -37,3 +37,7 @@ target_link_libraries(matrixMulCUBLAS PRIVATE CUDA::cudart CUDA::cublas ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/nvJPEG/CMakeLists.txt b/Samples/4_CUDA_Libraries/nvJPEG/CMakeLists.txt index ab3f1fb9..215cc96e 100644 --- a/Samples/4_CUDA_Libraries/nvJPEG/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/nvJPEG/CMakeLists.txt @@ -44,3 +44,7 @@ add_custom_command(TARGET nvJPEG POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/images ${CMAKE_CURRENT_BINARY_DIR}/images ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/nvJPEG_encoder/CMakeLists.txt b/Samples/4_CUDA_Libraries/nvJPEG_encoder/CMakeLists.txt index a07fc77a..47ebb087 100644 --- a/Samples/4_CUDA_Libraries/nvJPEG_encoder/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/nvJPEG_encoder/CMakeLists.txt @@ -50,3 +50,7 @@ add_custom_command(TARGET nvJPEG_encoder POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/encode_output ${CMAKE_CURRENT_BINARY_DIR}/encode_output ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/oceanFFT/CMakeLists.txt b/Samples/4_CUDA_Libraries/oceanFFT/CMakeLists.txt index c0d8ceb7..99aa0e07 100644 --- a/Samples/4_CUDA_Libraries/oceanFFT/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/oceanFFT/CMakeLists.txt @@ -93,3 +93,7 @@ target_compile_features(oceanFFT PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'oceanFFT'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/randomFog/CMakeLists.txt b/Samples/4_CUDA_Libraries/randomFog/CMakeLists.txt index 35ecc07e..635a2960 100644 --- a/Samples/4_CUDA_Libraries/randomFog/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/randomFog/CMakeLists.txt @@ -111,3 +111,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'randomFog'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUBLAS/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUBLAS/CMakeLists.txt index 6c1b3e76..cc7f7149 100644 --- a/Samples/4_CUDA_Libraries/simpleCUBLAS/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUBLAS/CMakeLists.txt @@ -37,3 +37,7 @@ target_link_libraries(simpleCUBLAS PRIVATE CUDA::cudart CUDA::cublas ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUBLASXT/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUBLASXT/CMakeLists.txt index cf3ed66e..72d33680 100644 --- a/Samples/4_CUDA_Libraries/simpleCUBLASXT/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUBLASXT/CMakeLists.txt @@ -37,3 +37,7 @@ target_link_libraries(simpleCUBLASXT PRIVATE CUDA::cudart CUDA::cublas ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/CMakeLists.txt index 6df3d654..01f8c8a0 100644 --- a/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUBLAS_LU/CMakeLists.txt @@ -37,3 +37,7 @@ target_link_libraries(simpleCUBLAS_LU PRIVATE CUDA::cudart CUDA::cublas ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUFFT/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUFFT/CMakeLists.txt index 5373206c..a3db2d0a 100644 --- a/Samples/4_CUDA_Libraries/simpleCUFFT/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUFFT/CMakeLists.txt @@ -37,3 +37,7 @@ set_target_properties(simpleCUFFT PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(simpleCUFFT PRIVATE CUDA::cufft ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUFFT_2d_MGPU/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUFFT_2d_MGPU/CMakeLists.txt index 64783b2f..28d435f6 100644 --- a/Samples/4_CUDA_Libraries/simpleCUFFT_2d_MGPU/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUFFT_2d_MGPU/CMakeLists.txt @@ -41,3 +41,7 @@ set_target_properties(simpleCUFFT_2d_MGPU PROPERTIES CUDA_SEPARABLE_COMPILATION target_link_libraries(simpleCUFFT_2d_MGPU PRIVATE CUDA::cufft ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUFFT_MGPU/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUFFT_MGPU/CMakeLists.txt index 34aa1146..4f0f1aaa 100644 --- a/Samples/4_CUDA_Libraries/simpleCUFFT_MGPU/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUFFT_MGPU/CMakeLists.txt @@ -37,3 +37,7 @@ set_target_properties(simpleCUFFT_MGPU PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_link_libraries(simpleCUFFT_MGPU PRIVATE CUDA::cufft ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/simpleCUFFT_callback/CMakeLists.txt b/Samples/4_CUDA_Libraries/simpleCUFFT_callback/CMakeLists.txt index 5676f904..341796e9 100644 --- a/Samples/4_CUDA_Libraries/simpleCUFFT_callback/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/simpleCUFFT_callback/CMakeLists.txt @@ -37,3 +37,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample simpleCUFFT_callback - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt b/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt index d9116f36..744a4920 100644 --- a/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt +++ b/Samples/4_CUDA_Libraries/watershedSegmentationNPP/CMakeLists.txt @@ -65,3 +65,7 @@ add_custom_command(TARGET watershedSegmentationNPP POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/Rocks_512x512_8u_Gray.raw $/ ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/BlackScholes/CMakeLists.txt b/Samples/5_Domain_Specific/BlackScholes/CMakeLists.txt index 07bb26fb..01329a83 100644 --- a/Samples/5_Domain_Specific/BlackScholes/CMakeLists.txt +++ b/Samples/5_Domain_Specific/BlackScholes/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(BlackScholes PRIVATE $<$:--extende target_compile_features(BlackScholes PRIVATE cxx_std_17 cuda_std_17) set_target_properties(BlackScholes PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/BlackScholes_nvrtc/CMakeLists.txt b/Samples/5_Domain_Specific/BlackScholes_nvrtc/CMakeLists.txt index f2745669..eae3d403 100644 --- a/Samples/5_Domain_Specific/BlackScholes_nvrtc/CMakeLists.txt +++ b/Samples/5_Domain_Specific/BlackScholes_nvrtc/CMakeLists.txt @@ -39,3 +39,7 @@ add_custom_command(TARGET BlackScholes_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/BlackScholes_kernel.cuh ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/FDTD3d/CMakeLists.txt b/Samples/5_Domain_Specific/FDTD3d/CMakeLists.txt index f979400a..1a1d50b2 100644 --- a/Samples/5_Domain_Specific/FDTD3d/CMakeLists.txt +++ b/Samples/5_Domain_Specific/FDTD3d/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(FDTD3d PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(FDTD3d PRIVATE inc ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/HSOpticalFlow/CMakeLists.txt b/Samples/5_Domain_Specific/HSOpticalFlow/CMakeLists.txt index cef22b31..b80b2466 100644 --- a/Samples/5_Domain_Specific/HSOpticalFlow/CMakeLists.txt +++ b/Samples/5_Domain_Specific/HSOpticalFlow/CMakeLists.txt @@ -38,3 +38,7 @@ add_custom_command(TARGET HSOpticalFlow POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/Mandelbrot/CMakeLists.txt b/Samples/5_Domain_Specific/Mandelbrot/CMakeLists.txt index b8cfcfa3..4bfcc926 100644 --- a/Samples/5_Domain_Specific/Mandelbrot/CMakeLists.txt +++ b/Samples/5_Domain_Specific/Mandelbrot/CMakeLists.txt @@ -90,3 +90,7 @@ target_compile_features(Mandelbrot PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'Mandelbrot'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/MonteCarloMultiGPU/CMakeLists.txt b/Samples/5_Domain_Specific/MonteCarloMultiGPU/CMakeLists.txt index 0df7a327..1c8522c7 100644 --- a/Samples/5_Domain_Specific/MonteCarloMultiGPU/CMakeLists.txt +++ b/Samples/5_Domain_Specific/MonteCarloMultiGPU/CMakeLists.txt @@ -36,3 +36,7 @@ target_include_directories(MonteCarloMultiGPU PRIVATE target_link_libraries(MonteCarloMultiGPU PRIVATE CUDA::curand ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/NV12toBGRandResize/CMakeLists.txt b/Samples/5_Domain_Specific/NV12toBGRandResize/CMakeLists.txt index 4559468c..765a82a6 100644 --- a/Samples/5_Domain_Specific/NV12toBGRandResize/CMakeLists.txt +++ b/Samples/5_Domain_Specific/NV12toBGRandResize/CMakeLists.txt @@ -38,3 +38,7 @@ add_custom_command(TARGET NV12toBGRandResize POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/README.md b/Samples/5_Domain_Specific/README.md index 6ad1ea7d..b7809e86 100644 --- a/Samples/5_Domain_Specific/README.md +++ b/Samples/5_Domain_Specific/README.md @@ -35,15 +35,9 @@ Naturally(Hadamard)-ordered Fast Walsh Transform for batching vectors of arbitra ### [FDTD3d](./FDTD3d) This sample applies a finite differences time domain progression stencil on a 3D surface. -### [fluidsD3D9](./fluidsD3D9) -An example of fluid simulation using CUDA and CUFFT, with Direct3D 9 rendering. A Direct3D Capable device is required. - ### [fluidsGL](./fluidsGL) An example of fluid simulation using CUDA and CUFFT, with OpenGL rendering. -### [fluidsGLES](./fluidsGLES) -An example of fluid simulation using CUDA and CUFFT, with OpenGLES rendering. - ### [HSOpticalFlow](./HSOpticalFlow) Variational optical flow estimation example. Uses textures for image operations. Shows how simple PDE solver can be accelerated with CUDA. @@ -57,10 +51,7 @@ This sample extracts a geometric isosurface from a volume dataset using the marc This sample evaluates fair call price for a given set of European options using the Monte Carlo approach, taking advantage of all CUDA-capable GPUs installed in the system. This sample use double precision hardware if a GTX 200 class GPU is present. The sample also takes advantage of CUDA 4.0 capability to supporting using a single CPU thread to control multiple GPUs ### [nbody](./nbody) -This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in CUDA. This sample accompanies the GPU Gems 3 chapter "Fast N-Body Simulation with CUDA". With CUDA 5.5, performance on Tesla K20c has increased to over 1.8TFLOP/s single precision. Double Performance has also improved on all Kepler and Fermi GPU architectures as well. Starting in CUDA 4.0, the nBody sample has been updated to take advantage of new features to easily scale the n-body simulation across multiple GPUs in a single PC. Adding "-numbodies=" to the command line will allow users to set # of bodies for simulation. Adding “-numdevices=” to the command line option will cause the sample to use N devices (if available) for simulation. In this mode, the position and velocity data for all bodies are read from system memory using “zero copy” rather than from device memory. For a small number of devices (4 or fewer) and a large enough number of bodies, bandwidth is not a bottleneck so we can achieve strong scaling across these devices. - -### [nbody_opengles](./nbody_opengles) -This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in CUDA. Unlike the OpenGL nbody sample, there is no user interaction. +This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in CUDA. This sample accompanies the GPU Gems 3 chapter "Fast N-Body Simulation with CUDA". With CUDA 5.5, performance on Tesla K20c has increased to over 1.8TFLOP/s single precision. Double Performance has also improved on all Kepler and Fermi GPU architectures as well. Starting in CUDA 4.0, the nBody sample has been updated to take advantage of new features to easily scale the n-body simulation across multiple GPUs in a single PC. Adding "-numbodies=" to the command line will allow users to set # of bodies for simulation. Adding "-numdevices=" to the command line option will cause the sample to use N devices (if available) for simulation. In this mode, the position and velocity data for all bodies are read from system memory using "zero copy" rather than from device memory. For a small number of devices (4 or fewer) and a large enough number of bodies, bandwidth is not a bottleneck so we can achieve strong scaling across these devices. ### [nbody_screen](./nbody_screen) This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in CUDA. Unlike the OpenGL nbody sample, there is no user interaction. @@ -83,15 +74,6 @@ This sample implements Niederreiter Quasirandom Sequence Generator and Inverse C ### [recursiveGaussian](./recursiveGaussian) This sample implements a Gaussian blur using Deriche's recursive method. The advantage of this method is that the execution time is independent of the filter width. -### [simpleD3D10](./simpleD3D10) -Simple program which demonstrates interoperability between CUDA and Direct3D10. The program generates a vertex array with CUDA and uses Direct3D10 to render the geometry. A Direct3D Capable device is required. - -### [simpleD3D10RenderTarget](./simpleD3D10RenderTarget) -Simple program which demonstrates interop of rendertargets between Direct3D10 and CUDA. The program uses RenderTarget positions with CUDA and generates a histogram with visualization. A Direct3D10 Capable device is required. - -### [simpleD3D10Texture](./simpleD3D10Texture) -Simple program which demonstrates how to interoperate CUDA with Direct3D10 Texture. The program creates a number of D3D10 Textures (2D, 3D, and CubeMap) which are generated from CUDA kernels. Direct3D then renders the results on the screen. A Direct3D10 Capable device is required. - ### [simpleD3D11](./simpleD3D11) Simple program which demonstrates how to use the CUDA D3D11 External Resource Interoperability APIs to update D3D11 buffers from CUDA and synchronize between D3D11 and CUDA with Keyed Mutexes. @@ -102,21 +84,9 @@ Simple program which demonstrates Direct3D11 Texture interoperability with CUDA. ### [simpleD3D12](./simpleD3D12) A program which demonstrates Direct3D12 interoperability with CUDA. The program creates a sinewave in DX12 vertex buffer which is created using CUDA kernels. DX12 and CUDA synchronizes using DirectX12 Fences. Direct3D then renders the results on the screen. A DirectX12 Capable NVIDIA GPU is required on Windows10 or higher OS. -### [simpleD3D9](./simpleD3D9) -Simple program which demonstrates interoperability between CUDA and Direct3D9. The program generates a vertex array with CUDA and uses Direct3D9 to render the geometry. A Direct3D capable device is required. - -### [simpleD3D9Texture](./simpleD3D9Texture) -Simple program which demonstrates Direct3D9 Texture interoperability with CUDA. The program creates a number of D3D9 Textures (2D, 3D, and CubeMap) which are written to from CUDA kernels. Direct3D then renders the results on the screen. A Direct3D capable device is required. - ### [simpleGL](./simpleGL) Simple program which demonstrates interoperability between CUDA and OpenGL. The program modifies vertex positions with CUDA and uses OpenGL to render the geometry. -### [simpleGLES](./simpleGLES) -Demonstrates data exchange between CUDA and OpenGL ES (aka Graphics interop). The program modifies vertex positions with CUDA and uses OpenGL ES to render the geometry. - -### [simpleGLES_EGLOutput](./simpleGLES_EGLOutput) -Demonstrates data exchange between CUDA and OpenGL ES (aka Graphics interop). The program modifies vertex positions with CUDA and uses OpenGL ES to render the geometry, and shows how to render directly to the display using the EGLOutput mechanism and the DRM library. - ### [simpleGLES_screen](./simpleGLES_screen) Demonstrates data exchange between CUDA and OpenGL ES (aka Graphics interop). The program modifies vertex positions with CUDA and uses OpenGL ES to render the geometry. @@ -126,9 +96,6 @@ This sample demonstrates Vulkan CUDA Interop. CUDA imports the Vulkan vertex buf ### [simpleVulkanMMAP](./simpleVulkanMMAP) This sample demonstrates Vulkan CUDA Interop via cuMemMap APIs. CUDA exports buffers that Vulkan imports as vertex buffer. CUDA invokes kernels to operate on vertices and synchronizes with Vulkan through vulkan semaphores imported by CUDA. This sample depends on Vulkan SDK, GLFW3 libraries, for building this sample please refer to "Build_instructions.txt" provided in this sample's directory -### [SLID3D10Texture](./SLID3D10Texture) -Simple program which demonstrates SLI with Direct3D10 Texture interoperability with CUDA. The program creates a D3D10 Texture which is written to from a CUDA kernel. Direct3D then renders the results on the screen. A Direct3D Capable device is required. - ### [smokeParticles](./smokeParticles) Smoke simulation with volumetric shadows using half-angle slicing technique. Uses CUDA for procedural simulation, Thrust Library for sorting algorithms, and OpenGL for graphics rendering. @@ -141,9 +108,6 @@ This sample implements Sobol Quasirandom Sequence Generator. ### [stereoDisparity](./stereoDisparity) A CUDA program that demonstrates how to compute a stereo disparity map using SIMD SAD (Sum of Absolute Difference) intrinsics. Requires Compute Capability 2.0 or higher. -### [VFlockingD3D10](./VFlockingD3D10) -The sample models formation of V-shaped flocks by big birds, such as geese and cranes. The algorithms of such flocking are borrowed from the paper "V-like formations in flocks of artificial birds" from Artificial Life, Vol. 14, No. 2, 2008. The sample has CPU- and GPU-based implementations. Press 'g' to toggle between them. The GPU-based simulation works many times faster than the CPU-based one. The printout in the console window reports the simulation time per step. Press 'r' to reset the initial distribution of birds. - ### [volumeFiltering](./volumeFiltering) This sample demonstrates 3D Volumetric Filtering using 3D Textures and 3D Surface Writes. diff --git a/Samples/5_Domain_Specific/SobelFilter/CMakeLists.txt b/Samples/5_Domain_Specific/SobelFilter/CMakeLists.txt index bc4f1848..31d1694f 100644 --- a/Samples/5_Domain_Specific/SobelFilter/CMakeLists.txt +++ b/Samples/5_Domain_Specific/SobelFilter/CMakeLists.txt @@ -89,3 +89,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'SobelFilter'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/SobolQRNG/CMakeLists.txt b/Samples/5_Domain_Specific/SobolQRNG/CMakeLists.txt index 5ce5817e..341c4f2d 100644 --- a/Samples/5_Domain_Specific/SobolQRNG/CMakeLists.txt +++ b/Samples/5_Domain_Specific/SobolQRNG/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(SobolQRNG PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(SobolQRNG PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/bicubicTexture/CMakeLists.txt b/Samples/5_Domain_Specific/bicubicTexture/CMakeLists.txt index b8c8aade..4e4f375b 100644 --- a/Samples/5_Domain_Specific/bicubicTexture/CMakeLists.txt +++ b/Samples/5_Domain_Specific/bicubicTexture/CMakeLists.txt @@ -90,3 +90,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'bicubicTexture'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/bilateralFilter/CMakeLists.txt b/Samples/5_Domain_Specific/bilateralFilter/CMakeLists.txt index fe574eb6..94a8b1ca 100644 --- a/Samples/5_Domain_Specific/bilateralFilter/CMakeLists.txt +++ b/Samples/5_Domain_Specific/bilateralFilter/CMakeLists.txt @@ -91,3 +91,7 @@ target_compile_features(bilateralFilter PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'bilateralFilter'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/binomialOptions/CMakeLists.txt b/Samples/5_Domain_Specific/binomialOptions/CMakeLists.txt index 5f49e7fc..63eaf820 100644 --- a/Samples/5_Domain_Specific/binomialOptions/CMakeLists.txt +++ b/Samples/5_Domain_Specific/binomialOptions/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(binomialOptions PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_include_directories(binomialOptions PUBLIC ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/binomialOptions_nvrtc/CMakeLists.txt b/Samples/5_Domain_Specific/binomialOptions_nvrtc/CMakeLists.txt index b48e71e0..dcde9f41 100644 --- a/Samples/5_Domain_Specific/binomialOptions_nvrtc/CMakeLists.txt +++ b/Samples/5_Domain_Specific/binomialOptions_nvrtc/CMakeLists.txt @@ -57,3 +57,7 @@ add_custom_command(TARGET binomialOptions_nvrtc POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/realtype.h ${CMAKE_CURRENT_BINARY_DIR} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/convolutionFFT2D/CMakeLists.txt b/Samples/5_Domain_Specific/convolutionFFT2D/CMakeLists.txt index d734b34f..4e61664f 100644 --- a/Samples/5_Domain_Specific/convolutionFFT2D/CMakeLists.txt +++ b/Samples/5_Domain_Specific/convolutionFFT2D/CMakeLists.txt @@ -36,3 +36,7 @@ target_include_directories(convolutionFFT2D PRIVATE target_link_libraries(convolutionFFT2D PUBLIC CUDA::cufft ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/dwtHaar1D/CMakeLists.txt b/Samples/5_Domain_Specific/dwtHaar1D/CMakeLists.txt index d69c75a0..0e1bfdbf 100644 --- a/Samples/5_Domain_Specific/dwtHaar1D/CMakeLists.txt +++ b/Samples/5_Domain_Specific/dwtHaar1D/CMakeLists.txt @@ -34,3 +34,7 @@ add_custom_command(TARGET dwtHaar1D POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/dxtc/CMakeLists.txt b/Samples/5_Domain_Specific/dxtc/CMakeLists.txt index e5e633fc..90b336ba 100644 --- a/Samples/5_Domain_Specific/dxtc/CMakeLists.txt +++ b/Samples/5_Domain_Specific/dxtc/CMakeLists.txt @@ -34,3 +34,7 @@ add_custom_command(TARGET dxtc POST_BUILD ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/fastWalshTransform/CMakeLists.txt b/Samples/5_Domain_Specific/fastWalshTransform/CMakeLists.txt index 285f5d75..d893e7a3 100644 --- a/Samples/5_Domain_Specific/fastWalshTransform/CMakeLists.txt +++ b/Samples/5_Domain_Specific/fastWalshTransform/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(fastWalshTransform PRIVATE $<$:--e target_compile_features(fastWalshTransform PRIVATE cxx_std_17 cuda_std_17) set_target_properties(fastWalshTransform PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/fluidsGL/CMakeLists.txt b/Samples/5_Domain_Specific/fluidsGL/CMakeLists.txt index 2a30ef43..b9e70239 100644 --- a/Samples/5_Domain_Specific/fluidsGL/CMakeLists.txt +++ b/Samples/5_Domain_Specific/fluidsGL/CMakeLists.txt @@ -91,3 +91,7 @@ target_compile_features(fluidsGL PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'fluidsGL'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/marchingCubes/CMakeLists.txt b/Samples/5_Domain_Specific/marchingCubes/CMakeLists.txt index e38e19c5..7970b60b 100644 --- a/Samples/5_Domain_Specific/marchingCubes/CMakeLists.txt +++ b/Samples/5_Domain_Specific/marchingCubes/CMakeLists.txt @@ -84,3 +84,7 @@ target_compile_features(marchingCubes PRIVATE cxx_std_17 cuda_std_17) else() message(STATUS "OpenGL not found - will not build sample 'marchingCubes'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/nbody/CMakeLists.txt b/Samples/5_Domain_Specific/nbody/CMakeLists.txt index 8b748611..e8ff90a3 100644 --- a/Samples/5_Domain_Specific/nbody/CMakeLists.txt +++ b/Samples/5_Domain_Specific/nbody/CMakeLists.txt @@ -83,3 +83,7 @@ if(${OpenGL_FOUND}) else() message(STATUS "OpenGL not found - will not build sample 'nbody'") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/5_Domain_Specific/p2pBandwidthLatencyTest/CMakeLists.txt b/Samples/5_Domain_Specific/p2pBandwidthLatencyTest/CMakeLists.txt index c33cbceb..0f60b103 100644 --- a/Samples/5_Domain_Specific/p2pBandwidthLatencyTest/CMakeLists.txt +++ b/Samples/5_Domain_Specific/p2pBandwidthLatencyTest/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(p2pBandwidthLatencyTest PRIVATE $<$:- target_compile_features(LargeKernelParameter PRIVATE cxx_std_17 cuda_std_17) set_target_properties(LargeKernelParameter PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/6_Performance/UnifiedMemoryPerf/CMakeLists.txt b/Samples/6_Performance/UnifiedMemoryPerf/CMakeLists.txt index fc242dd3..9ebabf27 100644 --- a/Samples/6_Performance/UnifiedMemoryPerf/CMakeLists.txt +++ b/Samples/6_Performance/UnifiedMemoryPerf/CMakeLists.txt @@ -32,3 +32,7 @@ set_target_properties(UnifiedMemoryPerf PROPERTIES CUDA_SEPARABLE_COMPILATION ON target_include_directories(UnifiedMemoryPerf PRIVATE ${CUDAToolkit_INCLUDE_DIRS} ) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/6_Performance/alignedTypes/CMakeLists.txt b/Samples/6_Performance/alignedTypes/CMakeLists.txt index 32592218..fc74c459 100644 --- a/Samples/6_Performance/alignedTypes/CMakeLists.txt +++ b/Samples/6_Performance/alignedTypes/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(alignedTypes PRIVATE $<$:--extende target_compile_features(alignedTypes PRIVATE cxx_std_17 cuda_std_17) set_target_properties(alignedTypes PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/6_Performance/cudaGraphsPerfScaling/CMakeLists.txt b/Samples/6_Performance/cudaGraphsPerfScaling/CMakeLists.txt index 3ac8c997..0a89460c 100644 --- a/Samples/6_Performance/cudaGraphsPerfScaling/CMakeLists.txt +++ b/Samples/6_Performance/cudaGraphsPerfScaling/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(cudaGraphsPerfScaling PRIVATE $<$: target_compile_features(cudaGraphsPerfScaling PRIVATE cxx_std_17 cuda_std_17) set_target_properties(cudaGraphsPerfScaling PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/6_Performance/transpose/CMakeLists.txt b/Samples/6_Performance/transpose/CMakeLists.txt index 38c5b502..5c92d03c 100644 --- a/Samples/6_Performance/transpose/CMakeLists.txt +++ b/Samples/6_Performance/transpose/CMakeLists.txt @@ -28,3 +28,7 @@ target_compile_options(transpose PRIVATE $<$:--extended-l target_compile_features(transpose PRIVATE cxx_std_17 cuda_std_17) set_target_properties(transpose PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/7_libNVVM/CMakeLists.txt b/Samples/7_libNVVM/CMakeLists.txt index 08310559..83605b83 100644 --- a/Samples/7_libNVVM/CMakeLists.txt +++ b/Samples/7_libNVVM/CMakeLists.txt @@ -91,13 +91,12 @@ endif() set(CMAKE_INSTALL_RPATH "${LIBNVVM_RPATH}") message(STATUS "Using rpath: ${CMAKE_INSTALL_RPATH}") -# On Windows, locate the nvvm.dll so we can install it. +# On Windows, locate the nvvm.dll so we can install it later. if (WIN32) find_file(NVVM_DLL nvvm64_40_0.dll PATHS "${LIBNVVM_HOME}/bin" "${LIBNVVM_HOME}/bin/x64/") if (NOT NVVM_DLL) message(FATAL_ERROR "Found nvvm .h/.lib, but not .dll") endif() - install(FILES ${NVVM_DLL} DESTINATION bin) file(COPY ${NVVM_DLL} DESTINATION "${CMAKE_BINARY_DIR}") endif (WIN32) @@ -128,3 +127,18 @@ add_subdirectory(simple) add_subdirectory(syscalls) add_subdirectory(ptxgen) add_subdirectory(uvmlite) + +# Include InstallSamples to set CUDA_SAMPLES_INSTALL_DIR +# libNVVM samples will use this variable for installation +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake") +include(InstallSamples) + +# Install nvvm DLL to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if (WIN32 AND NVVM_DLL) + if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(FILES ${NVVM_DLL} DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) + else() + install(FILES ${NVVM_DLL} DESTINATION bin) + endif() +endif() diff --git a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt index 0a6dea2e..719b17d1 100644 --- a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt @@ -80,7 +80,13 @@ add_library(mathfuncs64 STATIC math-funcs.cu) set_target_properties(mathfuncs64 PROPERTIES PREFIX "lib" OUTPUT_NAME "mathfuncs64" SUFFIX ".a" CUDA_SEPERABLE_COMPILATION ON) -install(TARGETS cuda-c-linking mathfuncs64 DESTINATION bin) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(TARGETS cuda-c-linking mathfuncs64 DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) +else() + install(TARGETS cuda-c-linking mathfuncs64 DESTINATION bin) +endif() if (WIN32) add_custom_command( diff --git a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt index 576b6f2d..9b11eec3 100644 --- a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt @@ -39,5 +39,19 @@ set_tests_properties(test-cuda-shared-memory-shared_memory test-cuda-shared-memory-extern_shared_memory PROPERTIES FIXTURES_REQUIRED PTXGENTEST) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin/cuda-shared-memory (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(FILES shared_memory.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}/cuda-shared-memory) + install(FILES extern_shared_memory.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}/cuda-shared-memory) +else() + install(FILES shared_memory.ll DESTINATION bin/cuda-shared-memory) + install(FILES extern_shared_memory.ll DESTINATION bin/cuda-shared-memory) +endif() + file(COPY shared_memory.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") file(COPY extern_shared_memory.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + +# Copy the .ll files to the folder of executable file for full testing +file(COPY shared_memory.ll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/cuda-shared-memory) +file(COPY extern_shared_memory.ll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/cuda-shared-memory) diff --git a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt index 4617fab3..fafae9cd 100644 --- a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt +++ b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt @@ -41,8 +41,15 @@ else (WIN32) set_target_properties(dsl PROPERTIES LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}") endif (WIN32) -install(TARGETS dsl DESTINATION bin) -install(FILES dsl-gpu64.ll DESTINATION bin) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(TARGETS dsl DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) + install(FILES dsl-gpu64.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) +else() + install(TARGETS dsl DESTINATION bin) + install(FILES dsl-gpu64.ll DESTINATION bin) +endif() # 'dsl' will load dsl-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). diff --git a/Samples/7_libNVVM/ptxgen/CMakeLists.txt b/Samples/7_libNVVM/ptxgen/CMakeLists.txt index b13866a8..9170003c 100644 --- a/Samples/7_libNVVM/ptxgen/CMakeLists.txt +++ b/Samples/7_libNVVM/ptxgen/CMakeLists.txt @@ -48,7 +48,15 @@ else (WIN32) LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}") endif (WIN32) -install(TARGETS ptxgen DESTINATION bin) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(TARGETS ptxgen DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) + install(FILES test.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) +else() + install(TARGETS ptxgen DESTINATION bin) + install(FILES test.ll DESTINATION bin) +endif() add_custom_command( TARGET ptxgen diff --git a/Samples/7_libNVVM/simple/CMakeLists.txt b/Samples/7_libNVVM/simple/CMakeLists.txt index 16331e6b..384838f8 100644 --- a/Samples/7_libNVVM/simple/CMakeLists.txt +++ b/Samples/7_libNVVM/simple/CMakeLists.txt @@ -40,8 +40,15 @@ else (WIN32) LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}") endif (WIN32) -install(TARGETS simple DESTINATION bin) -install(FILES simple-gpu64.ll DESTINATION bin) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(TARGETS simple DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) + install(FILES simple-gpu64.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) +else() + install(TARGETS simple DESTINATION bin) + install(FILES simple-gpu64.ll DESTINATION bin) +endif() # 'simple' will load simple-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). diff --git a/Samples/7_libNVVM/syscalls/CMakeLists.txt b/Samples/7_libNVVM/syscalls/CMakeLists.txt index 3ea3ced7..f5f8993b 100644 --- a/Samples/7_libNVVM/syscalls/CMakeLists.txt +++ b/Samples/7_libNVVM/syscalls/CMakeLists.txt @@ -36,5 +36,19 @@ add_test(NAME test-syscalls-vprintf set_tests_properties(test-syscalls-vprintf test-syscalls-malloc-free PROPERTIES FIXTURES_REQUIRED PTXGENTEST) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin/syscalls (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(FILES malloc-free.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}/syscalls) + install(FILES vprintf.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}/syscalls) +else() + install(FILES malloc-free.ll DESTINATION bin/syscalls) + install(FILES vprintf.ll DESTINATION bin/syscalls) +endif() + file(COPY malloc-free.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") file(COPY vprintf.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") + +# Copy the .ll files to the folder of executable file for full testing +file(COPY malloc-free.ll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/syscalls) +file(COPY vprintf.ll DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../ptxgen/syscalls) diff --git a/Samples/7_libNVVM/uvmlite/CMakeLists.txt b/Samples/7_libNVVM/uvmlite/CMakeLists.txt index 0ed6e969..c8ba5cdd 100644 --- a/Samples/7_libNVVM/uvmlite/CMakeLists.txt +++ b/Samples/7_libNVVM/uvmlite/CMakeLists.txt @@ -44,8 +44,15 @@ else (WIN32) LINK_FLAGS "-Wl,-rpath,${LIBNVVM_RPATH}") endif () -install(TARGETS uvmlite DESTINATION bin) -install(FILES uvmlite64.ll DESTINATION bin) +# Install to CUDA_SAMPLES_INSTALL_DIR if defined (for unified installation), +# otherwise install to bin (for standalone libNVVM build) +if(DEFINED CUDA_SAMPLES_INSTALL_DIR) + install(TARGETS uvmlite DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) + install(FILES uvmlite64.ll DESTINATION ${CUDA_SAMPLES_INSTALL_DIR}) +else() + install(TARGETS uvmlite DESTINATION bin) + install(FILES uvmlite64.ll DESTINATION bin) +endif() # 'uvmlite' will load uvmlite64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). diff --git a/Samples/8_Platform_Specific/Tegra/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/CMakeLists.txt index 356c2a13..fb976832 100644 --- a/Samples/8_Platform_Specific/Tegra/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/CMakeLists.txt @@ -10,3 +10,7 @@ add_subdirectory(fluidsGLES) add_subdirectory(nbody_opengles) add_subdirectory(simpleGLES) add_subdirectory(simpleGLES_EGLOutput) + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/EGLSync_CUDAEvent_Interop/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/EGLSync_CUDAEvent_Interop/CMakeLists.txt index b75b8356..32b2a0be 100644 --- a/Samples/8_Platform_Specific/Tegra/EGLSync_CUDAEvent_Interop/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/EGLSync_CUDAEvent_Interop/CMakeLists.txt @@ -64,3 +64,7 @@ else() message(STATUS "Will not build sample EGLSync_CUDAEvent_Interop - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/README.md b/Samples/8_Platform_Specific/Tegra/README.md new file mode 100644 index 00000000..3326567a --- /dev/null +++ b/Samples/8_Platform_Specific/Tegra/README.md @@ -0,0 +1,38 @@ +# 8. Platform_Specific/Tegra + + +### [cudaNvSciNvMedia](./cudaNvSciNvMedia) +This sample demonstrates CUDA-NvMedia interop via NvSciBuf/NvSciSync APIs. Note that this sample only supports cross build from x86_64 to aarch64, aarch64 native build is not supported. For detailed workflow of the sample please check cudaNvSciNvMedia_Readme.pdf in the sample directory. + +### [cudaNvSciBufMultiplanar](./cudaNvSciBufMultiplanar) +This sample demonstrates CUDA-NvSciBuf Interop for Multiplanar images. A YUV 420 multiplanar image is flipped and allocated using NvSciBuf APIs and imported into CUDA with CUDA External Resource Interoperability. A CUDA surface is created from the corresponding mapped CUDA array and again bit flipping is performed on the surface. The result is copied back to a YUV image which is compared against the input. + +### [cuDLAErrorReporting](./cuDLAErrorReporting) +This sample demonstrates how DLA errors can be detected via CUDA. + +### [cuDLAHybridMode](./cuDLAHybridMode) +This sample demonstrates cuDLA hybrid mode wherein DLA can be programmed using CUDA. + +### [cuDLALayerwiseStatsHybrid](./cuDLALayerwiseStatsHybrid) +This sample is used to provide layerwise statistics to the application in the cuDLA hybrid mode wherein DLA is programmed using CUDA. + +### [cuDLALayerwiseStatsStandalone](./cuDLALayerwiseStatsStandalone) +This sample is used to provide layerwise statistics to the application in cuDLA standalone mode where DLA is programmed without using CUDA. + +### [cuDLAStandaloneMode](./cuDLAStandaloneMode) +This sample demonstrates cuDLA standalone mode wherein DLA can be programmed without using CUDA. + +### [EGLSync_CUDAEvent_Interop](./EGLSync_CUDAEvent_Interop) +Demonstrates interoperability between CUDA Event and EGL Sync/EGL Image using which one can achieve synchronization on GPU itself for GL-EGL-CUDA operations instead of blocking CPU for synchronization. + +### [fluidsGLES](./fluidsGLES) +An example of fluid simulation using CUDA and CUFFT, with OpenGLES rendering. + +### [nbody_opengles](./nbody_opengles) +This sample demonstrates efficient all-pairs simulation of a gravitational n-body simulation in CUDA. Unlike the OpenGL nbody sample, there is no user interaction. + +### [simpleGLES](./simpleGLES) +Demonstrates data exchange between CUDA and OpenGL ES (aka Graphics interop). The program modifies vertex positions with CUDA and uses OpenGL ES to render the geometry. + +### [simpleGLES_EGLOutput](./simpleGLES_EGLOutput) +Demonstrates data exchange between CUDA and OpenGL ES (aka Graphics interop). The program modifies vertex positions with CUDA and uses OpenGL ES to render the geometry, and shows how to render directly to the display using the EGLOutput mechanism and the DRM library. diff --git a/Samples/8_Platform_Specific/Tegra/cuDLAErrorReporting/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cuDLAErrorReporting/CMakeLists.txt index 69107ced..10580406 100644 --- a/Samples/8_Platform_Specific/Tegra/cuDLAErrorReporting/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cuDLAErrorReporting/CMakeLists.txt @@ -47,3 +47,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cuDLAErrorReporting - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cuDLAHybridMode/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cuDLAHybridMode/CMakeLists.txt index cc4b2a4e..b0dab5ca 100644 --- a/Samples/8_Platform_Specific/Tegra/cuDLAHybridMode/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cuDLAHybridMode/CMakeLists.txt @@ -47,3 +47,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cuDLAHybridMode - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsHybrid/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsHybrid/CMakeLists.txt index 59873278..be17b563 100644 --- a/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsHybrid/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsHybrid/CMakeLists.txt @@ -47,3 +47,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cuDLALayerwiseStatsHybrid - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsStandalone/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsStandalone/CMakeLists.txt index 6781a02e..8d7eee3a 100644 --- a/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsStandalone/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cuDLALayerwiseStatsStandalone/CMakeLists.txt @@ -54,3 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cuDLALayerwiseStatsStandalone - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cuDLAStandaloneMode/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cuDLAStandaloneMode/CMakeLists.txt index e8279495..86b3ffed 100644 --- a/Samples/8_Platform_Specific/Tegra/cuDLAStandaloneMode/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cuDLAStandaloneMode/CMakeLists.txt @@ -54,3 +54,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cuDLAStandaloneMode - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cudaNvSciBufMultiplanar/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cudaNvSciBufMultiplanar/CMakeLists.txt index fa04e68f..b6708b16 100644 --- a/Samples/8_Platform_Specific/Tegra/cudaNvSciBufMultiplanar/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cudaNvSciBufMultiplanar/CMakeLists.txt @@ -58,3 +58,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cudaNvSciBufMultiplanar - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/cudaNvSciNvMedia/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/cudaNvSciNvMedia/CMakeLists.txt index 03f82c00..b043622f 100644 --- a/Samples/8_Platform_Specific/Tegra/cudaNvSciNvMedia/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/cudaNvSciNvMedia/CMakeLists.txt @@ -89,3 +89,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample cudaNvSciNvMedia - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/fluidsGLES/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/fluidsGLES/CMakeLists.txt index ede94814..9f04ae7a 100644 --- a/Samples/8_Platform_Specific/Tegra/fluidsGLES/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/fluidsGLES/CMakeLists.txt @@ -70,3 +70,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample fluidsGLES - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/nbody_opengles/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/nbody_opengles/CMakeLists.txt index 842c920b..d55101c5 100644 --- a/Samples/8_Platform_Specific/Tegra/nbody_opengles/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/nbody_opengles/CMakeLists.txt @@ -61,3 +61,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample nbody_opengles - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/simpleGLES/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/simpleGLES/CMakeLists.txt index f2c99c5f..3d88898b 100644 --- a/Samples/8_Platform_Specific/Tegra/simpleGLES/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/simpleGLES/CMakeLists.txt @@ -70,3 +70,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample simpleGLES - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/Samples/8_Platform_Specific/Tegra/simpleGLES_EGLOutput/CMakeLists.txt b/Samples/8_Platform_Specific/Tegra/simpleGLES_EGLOutput/CMakeLists.txt index 8a252ac5..7c362e1d 100644 --- a/Samples/8_Platform_Specific/Tegra/simpleGLES_EGLOutput/CMakeLists.txt +++ b/Samples/8_Platform_Specific/Tegra/simpleGLES_EGLOutput/CMakeLists.txt @@ -76,3 +76,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") else() message(STATUS "Will not build sample simpleGLES_EGLOutput - requires Linux OS") endif() + +# Include installation configuration +include(${CMAKE_CURRENT_SOURCE_DIR}/../../../../cmake/InstallSamples.cmake) +setup_samples_install() diff --git a/cmake/InstallSamples.cmake b/cmake/InstallSamples.cmake new file mode 100644 index 00000000..ee6f269c --- /dev/null +++ b/cmake/InstallSamples.cmake @@ -0,0 +1,329 @@ +# InstallSamples.cmake +# Configuration for installing CUDA samples to organized directory structure +# +# This module sets up installation paths organized by: +# - Target Architecture (x86_64, aarch64, etc.) +# - Target OS (linux, windows, darwin) +# - Build Type (release, debug) +# +# Default installation path: build/bin/${TARGET_ARCH}/${TARGET_OS}/${BUILD_TYPE} +# +# Installation structure: +# - Executables: installed to flat root directory only (easy access) +# - Data files (.ll, .ptx, .fatbin, etc.): installed to subdirectories (preserves relative paths) +# - run_tests.py handles path resolution automatically for both nested and flat structures +# +# Users can override by setting CMAKE_INSTALL_PREFIX or CUDA_SAMPLES_INSTALL_DIR + +# Configure paths only once (but always define the function below) +if(NOT CUDA_SAMPLES_INSTALL_CONFIGURED) + set(CUDA_SAMPLES_INSTALL_CONFIGURED TRUE CACHE INTERNAL "InstallSamples configuration guard") + + # Detect target architecture - use lowercase of CMAKE_SYSTEM_PROCESSOR + string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" TARGET_ARCH_TEMP) + set(TARGET_ARCH "${TARGET_ARCH_TEMP}" CACHE INTERNAL "Target architecture") + + # Detect target OS + if(WIN32) + set(TARGET_OS_TEMP "windows") + elseif(APPLE) + set(TARGET_OS_TEMP "darwin") + elseif(UNIX) + if(CMAKE_SYSTEM_NAME MATCHES QNX) + set(TARGET_OS_TEMP "qnx") + else() + set(TARGET_OS_TEMP "linux") + endif() + else() + set(TARGET_OS_TEMP "unknown") + endif() + set(TARGET_OS "${TARGET_OS_TEMP}" CACHE INTERNAL "Target OS") + + # Detect if using multi-config generator (Visual Studio, Xcode, Ninja Multi-Config) + get_property(MULTI_CONFIG_TEMP GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + set(MULTI_CONFIG "${MULTI_CONFIG_TEMP}" CACHE INTERNAL "Multi-config generator flag") + + # Get build type + if(MULTI_CONFIG) + # Multi-config generators: use $ which is evaluated at build/install time + set(BUILD_TYPE_EXPR "$>" CACHE INTERNAL "Build type expression") + set(BUILD_TYPE_MSG "multi-config (specified at build time)") + else() + # Single-config generators: use CMAKE_BUILD_TYPE (default to release if not specified) + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release") + endif() + string(TOLOWER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_LOWER_TEMP) + set(BUILD_TYPE_EXPR "${BUILD_TYPE_LOWER_TEMP}" CACHE INTERNAL "Build type expression") + set(BUILD_TYPE_MSG "${BUILD_TYPE_LOWER_TEMP}") + endif() + + # Set default install prefix to build/bin if not explicitly set by user + # Use the root binary directory (where CMakeCache.txt is located) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + # Find the directory containing CMakeCache.txt (the root build directory) + set(ROOT_BINARY_DIR "${CMAKE_BINARY_DIR}") + set(PREV_DIR "") + set(MAX_ITERATIONS 50) + set(ITERATION 0) + while(NOT EXISTS "${ROOT_BINARY_DIR}/CMakeCache.txt" + AND NOT "${ROOT_BINARY_DIR}" STREQUAL "/" + AND NOT "${ROOT_BINARY_DIR}" STREQUAL "" + AND NOT "${ROOT_BINARY_DIR}" STREQUAL "${PREV_DIR}" + AND ITERATION LESS MAX_ITERATIONS) + set(PREV_DIR "${ROOT_BINARY_DIR}") + get_filename_component(ROOT_BINARY_DIR "${ROOT_BINARY_DIR}" DIRECTORY) + math(EXPR ITERATION "${ITERATION} + 1") + endwhile() + # If CMakeCache.txt wasn't found, fall back to CMAKE_BINARY_DIR + if(NOT EXISTS "${ROOT_BINARY_DIR}/CMakeCache.txt") + set(ROOT_BINARY_DIR "${CMAKE_BINARY_DIR}") + endif() + set(CMAKE_INSTALL_PREFIX "${ROOT_BINARY_DIR}/bin" CACHE PATH "Installation directory" FORCE) + endif() + + # Create the installation path: bin/$(TARGET_ARCH)/$(TARGET_OS)/$(BUILD_TYPE) + # For multi-config generators, this will be evaluated at install time + set(CUDA_SAMPLES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${TARGET_OS}/${BUILD_TYPE_EXPR}" CACHE INTERNAL "Install directory for samples") + + # Print installation configuration + message(STATUS "CUDA Samples installation configured:") + message(STATUS " Architecture: ${TARGET_ARCH}") + message(STATUS " OS: ${TARGET_OS}") + message(STATUS " Build Type: ${BUILD_TYPE_MSG}") + message(STATUS " Install Prefix: ${CMAKE_INSTALL_PREFIX}") + if(NOT MULTI_CONFIG) + message(STATUS " Install Directory: ${CUDA_SAMPLES_INSTALL_DIR}") + else() + message(STATUS " Install Directory: ${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${TARGET_OS}/") + endif() +endif() + +# Function to setup installation for regular samples +# This should be called after all targets are defined +function(setup_samples_install) + # Create an install script that will copy executables and specific file types + # All files are copied to flat root directory + # This script runs at install time, after the build is complete + install(CODE " + # Determine the actual install directory based on the configuration + # CMAKE_INSTALL_CONFIG_NAME is available at install time for multi-config generators + if(DEFINED CMAKE_INSTALL_CONFIG_NAME) + string(TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" INSTALL_BUILD_TYPE) + else() + set(INSTALL_BUILD_TYPE \"${BUILD_TYPE_EXPR}\") + endif() + set(INSTALL_DIR \"${CMAKE_INSTALL_PREFIX}/${TARGET_ARCH}/${TARGET_OS}/\${INSTALL_BUILD_TYPE}\") + + # Search in the current project's binary directory for built executables + file(GLOB_RECURSE BINARY_FILES + LIST_DIRECTORIES false + \"${CMAKE_CURRENT_BINARY_DIR}/*\") + + # Copy data files from sample's own data directory + file(GLOB_RECURSE SAMPLE_DATA_FILES + LIST_DIRECTORIES false + \"${CMAKE_CURRENT_SOURCE_DIR}/data/*\") + + # Copy shared data files from Common/data directory + # Try both paths: ../../../Common (for regular samples) and ../../../../Common (for Tegra) + set(COMMON_DATA_FILES \"\") + if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data\") + file(GLOB_RECURSE COMMON_DATA_FILES + LIST_DIRECTORIES false + \"${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/data/*\") + elseif(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/../../../../Common/data\") + file(GLOB_RECURSE COMMON_DATA_FILES + LIST_DIRECTORIES false + \"${CMAKE_CURRENT_SOURCE_DIR}/../../../../Common/data/*\") + endif() + + # Copy shared library files from bin/win64 directory (Windows only) + # These are pre-built DLLs like freeglut.dll, glew64.dll, etc. + set(SHARED_LIB_FILES \"\") + if(CMAKE_HOST_WIN32) + # Determine build configuration at install time + # CMAKE_INSTALL_CONFIG_NAME is set by CMake at install time for multi-config generators + if(DEFINED CMAKE_INSTALL_CONFIG_NAME) + string(TOLOWER \"\${CMAKE_INSTALL_CONFIG_NAME}\" INSTALL_CONFIG_LOWER) + else() + # Fallback for single-config generators + set(INSTALL_CONFIG_LOWER \"${BUILD_TYPE_EXPR}\") + endif() + + # Try multiple possible paths for bin/win64 directory + set(BIN_WIN64_PATHS + \"${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/\${INSTALL_CONFIG_LOWER}\" + \"${CMAKE_CURRENT_SOURCE_DIR}/../../../../bin/win64/\${INSTALL_CONFIG_LOWER}\" + \"${CMAKE_SOURCE_DIR}/bin/win64/\${INSTALL_CONFIG_LOWER}\" + ) + foreach(BIN_PATH IN LISTS BIN_WIN64_PATHS) + if(EXISTS \"\${BIN_PATH}\") + file(GLOB SHARED_LIB_FILES + LIST_DIRECTORIES false + \"\${BIN_PATH}/*.dll\") + if(SHARED_LIB_FILES) + break() + endif() + endif() + endforeach() + endif() + + # Combine all lists + set(SAMPLE_FILES \${BINARY_FILES} \${SAMPLE_DATA_FILES} \${COMMON_DATA_FILES} \${SHARED_LIB_FILES}) + + # Remove duplicates to avoid copying the same file multiple times + # This preserves the order, so files from earlier sources take precedence + list(REMOVE_DUPLICATES SAMPLE_FILES) + + set(INSTALLED_COUNT 0) + + # Filter to include executable files and specific file types + foreach(SAMPLE_FILE IN LISTS SAMPLE_FILES) + # Skip non-files + if(NOT IS_DIRECTORY \"\${SAMPLE_FILE}\") + get_filename_component(SAMPLE_EXT \"\${SAMPLE_FILE}\" EXT) + get_filename_component(SAMPLE_NAME \"\${SAMPLE_FILE}\" NAME) + + set(SHOULD_INSTALL FALSE) + + # Skip build artifacts, source files, and CMake files + # Note: .lib (Windows import libs) and .a (static libs) are excluded - link-time only + # .so (Linux shared libs) and .dll (Windows DLLs) are included - runtime dependencies + # Source files (.cu, .cpp, .c, .h, etc.) are excluded - not needed at runtime + if(NOT SAMPLE_EXT MATCHES \"\\\\.(o|a|cmake|obj|lib|exp|ilk|pdb|cu|cpp|cxx|cc|c|h|hpp|hxx|cuh|inl)$\" AND + NOT SAMPLE_NAME MATCHES \"^(Makefile|cmake_install\\\\.cmake)$\" AND + NOT \"\${SAMPLE_FILE}\" MATCHES \"/CMakeFiles/\" AND + NOT \"\${SAMPLE_FILE}\" MATCHES \"\\\\\\\\CMakeFiles\\\\\\\\\") + + # Check if file has required extension (fatbin, ptx, bc, raw, ppm) or is executable + if(SAMPLE_EXT MATCHES \"\\\\.(fatbin|ptx|bc|raw|ppm)$\") + set(SHOULD_INSTALL TRUE) + # Check for shared libraries: .dll (Windows) or .so (Linux) + elseif(SAMPLE_EXT MATCHES \"\\\\.(dll|so)$\") + set(SHOULD_INSTALL TRUE) + # On Windows, check for .exe extension + elseif(CMAKE_HOST_WIN32 AND SAMPLE_EXT MATCHES \"\\\\.(exe)$\") + set(SHOULD_INSTALL TRUE) + else() + # On Unix-like systems, check if file has executable permissions + if(NOT CMAKE_HOST_WIN32) + if(IS_SYMLINK \"\${SAMPLE_FILE}\" OR + (EXISTS \"\${SAMPLE_FILE}\" AND NOT IS_DIRECTORY \"\${SAMPLE_FILE}\")) + # Use test -x to check if file has executable permissions + execute_process( + COMMAND test -x \"\${SAMPLE_FILE}\" + RESULT_VARIABLE IS_EXEC + OUTPUT_QUIET ERROR_QUIET + ) + if(IS_EXEC EQUAL 0) + set(SHOULD_INSTALL TRUE) + endif() + endif() + endif() + endif() + endif() + + if(SHOULD_INSTALL) + get_filename_component(FILE_NAME \"\${SAMPLE_FILE}\" NAME) + set(DEST_FILE \"\${INSTALL_DIR}/\${FILE_NAME}\") + + # Determine file type based on extension + get_filename_component(FILE_EXT \"\${SAMPLE_FILE}\" EXT) + set(IS_EXECUTABLE FALSE) + set(IS_SHARED_LIB FALSE) + set(IS_DATA_FILE FALSE) + + # Check for known data file extensions first + if(FILE_EXT MATCHES \"\\\\.(fatbin|ptx|bc|raw|ppm)$\") + set(IS_DATA_FILE TRUE) + # Check if it's a shared library + elseif(FILE_EXT MATCHES \"\\\\.(dll|so)$\") + set(IS_SHARED_LIB TRUE) + # Check if it's an executable + else() + # On Windows, check for .exe extension (not .dll - those are libraries) + if(CMAKE_HOST_WIN32) + if(FILE_EXT MATCHES \"\\\\.(exe)$\") + set(IS_EXECUTABLE TRUE) + endif() + else() + # On Unix-like systems, check for no extension (typical for executables) + # .so files are shared libraries, not executables + if(FILE_EXT STREQUAL \"\") + set(IS_EXECUTABLE TRUE) + endif() + endif() + endif() + + get_filename_component(DEST_DIR \"\${DEST_FILE}\" DIRECTORY) + + # Check if this is a Common data file that already exists + # Skip copying to avoid redundant operations when multiple samples use the same files + set(SKIP_COPY FALSE) + if(\"\${SAMPLE_FILE}\" MATCHES \"/Common/data/\" AND EXISTS \"\${DEST_FILE}\") + set(SKIP_COPY TRUE) + endif() + + if(NOT SKIP_COPY) + if(IS_DATA_FILE) + # Data file (.raw, .ppm, .ptx, .fatbin, .bc) - copy without execute permissions + message(STATUS \"Installing data file: \${DEST_FILE}\") + if(CMAKE_HOST_WIN32) + file(COPY \"\${SAMPLE_FILE}\" DESTINATION \"\${DEST_DIR}\") + else() + file(COPY \"\${SAMPLE_FILE}\" + DESTINATION \"\${DEST_DIR}\" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE + GROUP_READ + WORLD_READ) + endif() + math(EXPR INSTALLED_COUNT \"\${INSTALLED_COUNT} + 1\") + elseif(IS_EXECUTABLE) + # File is executable - copy with execute permissions (Unix) or as-is (Windows) + message(STATUS \"Installing executable: \${DEST_FILE}\") + if(CMAKE_HOST_WIN32) + file(COPY \"\${SAMPLE_FILE}\" DESTINATION \"\${DEST_DIR}\") + else() + file(COPY \"\${SAMPLE_FILE}\" + DESTINATION \"\${DEST_DIR}\" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) + endif() + math(EXPR INSTALLED_COUNT \"\${INSTALLED_COUNT} + 1\") + elseif(IS_SHARED_LIB) + # Shared library - copy with appropriate permissions + message(STATUS \"Installing shared library: \${DEST_FILE}\") + if(CMAKE_HOST_WIN32) + file(COPY \"\${SAMPLE_FILE}\" DESTINATION \"\${DEST_DIR}\") + else() + file(COPY \"\${SAMPLE_FILE}\" + DESTINATION \"\${DEST_DIR}\" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE + GROUP_READ + WORLD_READ) + endif() + math(EXPR INSTALLED_COUNT \"\${INSTALLED_COUNT} + 1\") + else() + # Unknown file type - copy as regular file without execute permissions + message(STATUS \"Installing file: \${DEST_FILE}\") + if(CMAKE_HOST_WIN32) + file(COPY \"\${SAMPLE_FILE}\" DESTINATION \"\${DEST_DIR}\") + else() + file(COPY \"\${SAMPLE_FILE}\" + DESTINATION \"\${DEST_DIR}\" + FILE_PERMISSIONS OWNER_READ OWNER_WRITE + GROUP_READ + WORLD_READ) + endif() + math(EXPR INSTALLED_COUNT \"\${INSTALLED_COUNT} + 1\") + endif() + endif() # NOT SKIP_COPY + endif() + endif() + endforeach() + + message(STATUS \"Installation complete: \${INSTALLED_COUNT} files installed to \${INSTALL_DIR}\") + ") +endfunction() diff --git a/test_args.json b/test_args.json index 652b7d74..59eb1efc 100644 --- a/test_args.json +++ b/test_args.json @@ -17,25 +17,25 @@ }, { "args": [ - "../cuda-shared-memory/shared_memory.ll" + "cuda-shared-memory/shared_memory.ll" ], "description": "cuda-shared-memory shared_memory test" }, { "args": [ - "../cuda-shared-memory/extern_shared_memory.ll" + "cuda-shared-memory/extern_shared_memory.ll" ], "description": "cuda-shared-memory extern_shared_memory test" }, { "args": [ - "../syscalls/malloc-free.ll" + "syscalls/malloc-free.ll" ], "description": "syscalls malloc-free test" }, { "args": [ - "../syscalls/vprintf.ll" + "syscalls/vprintf.ll" ], "description": "syscalls vprintf test" }