Refactor CMakeLists.txt under 5_Domain_Specific

This commit is contained in:
Rob Armstrong
2024-12-16 16:10:56 -08:00
parent 7d7e0777a5
commit 11fc617794
42 changed files with 852 additions and 220 deletions

View File

@@ -1,14 +1,27 @@
cmake_minimum_required(VERSION 3.20)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
project(BlackScholes_nvrtc LANGUAGES C CXX CUDA)
find_package(CUDAToolkit REQUIRED)
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
endif()
# Include directories and libraries
include_directories(../../../Common)
# Source file
set(SRC_FILES
BlackScholes.cpp
BlackScholes_gold.cpp
)
# Add target for BlackScholes_nvrtc
add_executable(BlackScholes_nvrtc ${SRC_FILES})
add_executable(BlackScholes_nvrtc BlackScholes.cpp BlackScholes_gold.cpp)
target_compile_options(BlackScholes_nvrtc PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(BlackScholes_nvrtc PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(BlackScholes_nvrtc PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(BlackScholes_nvrtc PRIVATE