diff --git a/Samples/5_Domain_Specific/CMakeLists.txt b/Samples/5_Domain_Specific/CMakeLists.txt index 0cf9529b..db46ed0c 100644 --- a/Samples/5_Domain_Specific/CMakeLists.txt +++ b/Samples/5_Domain_Specific/CMakeLists.txt @@ -26,11 +26,9 @@ add_subdirectory(postProcessGL) add_subdirectory(quasirandomGenerator) add_subdirectory(quasirandomGenerator_nvrtc) add_subdirectory(recursiveGaussian) -if (WIN32) -#add_subdirectory(simpleD3D11) -#add_subdirectory(simpleD3D11Texture) -#add_subdirectory(simpleD3D12) -endif() +add_subdirectory(simpleD3D11) +add_subdirectory(simpleD3D11Texture) +add_subdirectory(simpleD3D12) add_subdirectory(simpleGL) #add_subdirectory(simpleGLES) #add_subdirectory(simpleGLES_EGLOutput) diff --git a/Samples/5_Domain_Specific/simpleD3D11/CMakeLists.txt b/Samples/5_Domain_Specific/simpleD3D11/CMakeLists.txt index eb380b0d..6d474f42 100644 --- a/Samples/5_Domain_Specific/simpleD3D11/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleD3D11/CMakeLists.txt @@ -14,12 +14,31 @@ endif() # Include directories and libraries include_directories(../../../Common) -# Source file -# Add target for simpleD3D11 -add_executable(simpleD3D11 simpleD3D11.cu) +if(WIN32) + find_package(DirectX) -target_compile_options(simpleD3D11 PRIVATE $<$:--extended-lambda>) + if(${DirectX_FOUND}) -target_compile_features(simpleD3D11 PRIVATE cxx_std_17 cuda_std_17) + # Source file + # Add target for simpleD3D11 + add_executable(simpleD3D11 simpleD3D11.cpp sinewave_cuda.cu) -set_target_properties(simpleD3D11 PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + target_compile_options(simpleD3D11 PRIVATE $<$:--extended-lambda>) + + target_compile_features(simpleD3D11 PRIVATE cxx_std_17 cuda_std_17) + + set_target_properties(simpleD3D11 PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + + target_link_libraries(simpleD3D11 PRIVATE + DirectX::D3D11 + ) + + add_custom_command(TARGET simpleD3D11 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/data + ${CMAKE_CURRENT_BINARY_DIR}/data + ) + else() + message(STATUS "DirectX not found - will not build sample 'simpleD3D11'") + endif() +endif() diff --git a/Samples/5_Domain_Specific/simpleD3D11/Makefile b/Samples/5_Domain_Specific/simpleD3D11/Makefile deleted file mode 100644 index 2bdaa38b..00000000 --- a/Samples/5_Domain_Specific/simpleD3D11/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -################################################################################ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -################################################################################ -# -# Makefile project only supported on Mac OS X and Linux Platforms) -# -################################################################################ - -# Target rules -all: build - -build: - $(info >>> WARNING - simpleD3D11 is not supported on Linux - waiving sample <<<) - -run: build - -testrun: build - -clean: - -clobber: clean diff --git a/Samples/5_Domain_Specific/simpleD3D11Texture/CMakeLists.txt b/Samples/5_Domain_Specific/simpleD3D11Texture/CMakeLists.txt index 1c614037..eb1f811f 100644 --- a/Samples/5_Domain_Specific/simpleD3D11Texture/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleD3D11Texture/CMakeLists.txt @@ -14,12 +14,36 @@ endif() # Include directories and libraries include_directories(../../../Common) -# Source file -# Add target for simpleD3D11Texture -add_executable(simpleD3D11Texture simpleD3D11Texture.cu) +if(WIN32) + find_package(DirectX) -target_compile_options(simpleD3D11Texture PRIVATE $<$:--extended-lambda>) + if(${DirectX_FOUND}) -target_compile_features(simpleD3D11Texture PRIVATE cxx_std_17 cuda_std_17) + # Source file + # Add target for simpleD3D11Texture + add_executable(simpleD3D11Texture + simpleD3D11Texture.cpp + texture_2d.cu + texture_3d.cu + texture_cube.cu + ) -set_target_properties(simpleD3D11Texture PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + target_compile_options(simpleD3D11Texture PRIVATE $<$:--extended-lambda>) + + target_compile_features(simpleD3D11Texture PRIVATE cxx_std_17 cuda_std_17) + + set_target_properties(simpleD3D11Texture PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + + target_link_libraries(simpleD3D11Texture PRIVATE + DirectX::D3D11 + ) + + add_custom_command(TARGET simpleD3D11Texture POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/data + ${CMAKE_CURRENT_BINARY_DIR}/data + ) + else() + message(STATUS "DirectX not found - will not build sample 'simpleD3D11Texture'") + endif() +endif() diff --git a/Samples/5_Domain_Specific/simpleD3D11Texture/Makefile b/Samples/5_Domain_Specific/simpleD3D11Texture/Makefile deleted file mode 100644 index 8ecd6bee..00000000 --- a/Samples/5_Domain_Specific/simpleD3D11Texture/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -################################################################################ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -################################################################################ -# -# Makefile project only supported on Mac OS X and Linux Platforms) -# -################################################################################ - -# Target rules -all: build - -build: - $(info >>> WARNING - simpleD3D11Texture is not supported on Linux - waiving sample <<<) - -run: build - -testrun: build - -clean: - -clobber: clean diff --git a/Samples/5_Domain_Specific/simpleD3D12/CMakeLists.txt b/Samples/5_Domain_Specific/simpleD3D12/CMakeLists.txt index 0fa540bb..79b05cae 100644 --- a/Samples/5_Domain_Specific/simpleD3D12/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleD3D12/CMakeLists.txt @@ -14,12 +14,39 @@ endif() # Include directories and libraries include_directories(../../../Common) -# Source file -# Add target for simpleD3D12 -add_executable(simpleD3D12 simpleD3D12.cu) +if(WIN32) + find_package(DirectX) -target_compile_options(simpleD3D12 PRIVATE $<$:--extended-lambda>) + if(${DirectX_FOUND}) -target_compile_features(simpleD3D12 PRIVATE cxx_std_17 cuda_std_17) + # Source file + # Add target for simpleD3D12 + add_executable(simpleD3D12 + DX12CudaSample.cpp + Main.cpp + Win32Application.cpp + simpleD3D12.cpp + stdafx.cpp + sinewave_cuda.cu + ) -set_target_properties(simpleD3D12 PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + target_compile_options(simpleD3D12 PRIVATE $<$:--extended-lambda>) + + target_compile_features(simpleD3D12 PRIVATE cxx_std_17 cuda_std_17) + + set_target_properties(simpleD3D12 PROPERTIES CUDA_SEPARABLE_COMPILATION ON) + + target_link_libraries(simpleD3D12 PRIVATE + DirectX::D3D12 + ) + + add_custom_command(TARGET simpleD3D11 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_file + ${CMAKE_CURRENT_SOURCE_DIR}/shaders.hlsl + ${CMAKE_CURRENT_BINARY_DIR}/shaders.hlsl + ) + + else() + message(STATUS "DirectX not found - will not build sample 'simpleD3D12'") + endif() +endif() diff --git a/Samples/5_Domain_Specific/simpleD3D12/Makefile b/Samples/5_Domain_Specific/simpleD3D12/Makefile deleted file mode 100644 index bb725d09..00000000 --- a/Samples/5_Domain_Specific/simpleD3D12/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -################################################################################ -# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of NVIDIA CORPORATION nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY -# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -################################################################################ -# -# Makefile project only supported on Mac OS X and Linux Platforms) -# -################################################################################ - -# Target rules -all: build - -build: - $(info >>> WARNING - simpleD3D12 is not supported on Linux - waiving sample <<<) - -run: build - -testrun: build - -clean: - -clobber: clean diff --git a/Samples/5_Domain_Specific/simpleD3D12/NsightEclipse.xml b/Samples/5_Domain_Specific/simpleD3D12/NsightEclipse.xml deleted file mode 100644 index 05093475..00000000 --- a/Samples/5_Domain_Specific/simpleD3D12/NsightEclipse.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - simpleD3D12 - - cudaWaitExternalSemaphoresAsync - cudaExternalMemoryGetMappedBuffer - cudaImportExternalSemaphore - cudaFree - cudaSetDevice - cudaSignalExternalSemaphoresAsync - cudaGetDeviceProperties - cudaStreamSynchronize - cudaDestroyExternalMemory - cudaStreamCreate - cudaImportExternalMemory - cudaGetDeviceCount - cudaDestroyExternalSemaphore - - - whole - - ./ - ../ - ../../../Common - - - Graphics Interop - CUDA DX12 Interop - Image Processing - - - D3D - d3d12 - - - - - - true - simpleD3D12.cpp - - DirectX12 - - - 1:CUDA Basic Topics - 2:Graphics Interop - - sm50 - sm52 - sm53 - sm60 - sm61 - sm70 - sm72 - sm75 - sm80 - sm86 - sm87 - sm89 - sm90 - - - windows10 - - - - all - - Simple D3D12 CUDA Interop - exe -