-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
28 lines (22 loc) · 1.07 KB
/
CMakeLists.txt
File metadata and controls
28 lines (22 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
cmake_minimum_required(VERSION 3.19)
project(SpeciaLUT LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(CUDAToolkit)
if (DEFINED CUDAToolkit_VERSION)
message(STATUS "Found CUDA ${CUDAToolkit_VERSION} at ${CUDA_TOOLKIT_ROOT_DIR}")
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
add_compile_definitions(USE_CUDA __STRICT_ANSI__)
add_compile_options (-x cuda --cuda-gpu-arch=sm_35 -Wno-unknown-cuda-version)
elseif (WIN32) #if (CMAKE_CXX_COMPILER_ID STREQUAL NVIDIA)
add_compile_options(-Xcompiler "/std:c++20")
endif()
endif()
add_executable(SpeciaLUT_test specialut.hpp main.cpp)
add_executable(SpeciaLUT_benchmark specialut.hpp benchmark.cpp)
if (DEFINED CUDAToolkit_VERSION)
target_include_directories(SpeciaLUT_test SYSTEM PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
target_link_libraries(SpeciaLUT_test PRIVATE CUDA::cudart_static)
target_include_directories(SpeciaLUT_benchmark SYSTEM PUBLIC ${CUDAToolkit_INCLUDE_DIRS})
target_link_libraries(SpeciaLUT_benchmark PRIVATE CUDA::cudart_static)
endif()