Update DirectX samples

This commit is contained in:
Rob Armstrong
2024-12-18 11:28:26 -08:00
parent 25b33d2d04
commit 01b7ee41f6
8 changed files with 91 additions and 233 deletions

View File

@@ -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 $<$<COMPILE_LANGUAGE:CUDA>:--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 $<$<COMPILE_LANGUAGE:CUDA>:--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()

View File

@@ -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