mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-26 06:38:16 +08:00
Refactor CMakeLists.txt under 1_Utilities
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
project(topologyQuery LANGUAGES C CXX CUDA)
|
||||
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
|
||||
set(CMAKE_CUDA_ARCHITECTURES "native")
|
||||
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
|
||||
topologyQuery.cu
|
||||
)
|
||||
|
||||
# Add target for topologyQuery
|
||||
add_executable(topologyQuery ${SRC_FILES})
|
||||
add_executable(topologyQuery topologyQuery.cu)
|
||||
|
||||
target_compile_options(topologyQuery PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(topologyQuery PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(topologyQuery PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
Reference in New Issue
Block a user