mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-25 22:28:17 +08:00
Refactor CMakeLists.txt under 4_CUDA_Libraries
This commit is contained in:
@@ -1,15 +1,27 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
project(cuSolverSp_LowlevelCholesky 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
|
||||
cuSolverSp_LowlevelCholesky.cpp
|
||||
mmio.c
|
||||
mmio_wrapper.cpp
|
||||
)
|
||||
|
||||
# Add target for cuSolverSp_LowlevelCholesky
|
||||
add_executable(cuSolverSp_LowlevelCholesky ${SRC_FILES})
|
||||
add_executable(cuSolverSp_LowlevelCholesky cuSolverSp_LowlevelCholesky.cpp mmio.c mmio_wrapper.cpp)
|
||||
|
||||
target_compile_options(cuSolverSp_LowlevelCholesky PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(cuSolverSp_LowlevelCholesky PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(cuSolverSp_LowlevelCholesky PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
target_include_directories(cuSolverSp_LowlevelCholesky PRIVATE
|
||||
|
||||
Reference in New Issue
Block a user