mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-04-10 18:22:11 +01:00
Create CMakeLists.txt for cuDLALayerwiseStatsHybrid
This commit is contained in:
parent
f00f52d154
commit
8f1d565faa
@ -0,0 +1,43 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
project(cuDLALayerwiseStatsHybrid LANGUAGES C CXX CUDA)
|
||||
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
|
||||
set(CMAKE_CUDA_ARCHITECTURES 53 61 70 72 75 80 86 87 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)
|
||||
|
||||
find_library(CUDLA_LIB cudla PATHS ${CUDAToolkit_LIBRARY_DIR})
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
if(CUDLA_LIB)
|
||||
# Source file
|
||||
# Add target for cuDLALayerwiseStatsHybrid
|
||||
add_executable(cuDLALayerwiseStatsHybrid main.cu)
|
||||
|
||||
target_compile_options(cuDLALayerwiseStatsHybrid PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(cuDLALayerwiseStatsHybrid PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(cuDLALayerwiseStatsHybrid PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
target_include_directories(cuDLALayerwiseStatsHybrid PUBLIC
|
||||
${CUDAToolkit_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(cuDLALayerwiseStatsHybrid
|
||||
${CUDLA_LIB}
|
||||
)
|
||||
else()
|
||||
message(STATUS "CUDLA not found - will not build sample 'cuDLALayerwiseStatsHybrid'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Will not build sample cuDLALayerwiseStatsHybrid - requires Linux OS")
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user