-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
53 lines (42 loc) · 1.85 KB
/
CMakeLists.txt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# author: [email protected]
cmake_minimum_required (VERSION 3.0)
project (SimpleCudaNeuralNet LANGUAGES CXX CUDA)
set( CMAKE_BUILD_TYPE DEBUG )
#set( CMAKE_BUILD_TYPE RELEASE )
find_package(CUDA REQUIRED)
# -g: for breakpoint debugging in vscode
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-result -Wall --std=c++11" )
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG" )
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O3" )
set( CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -G -pg" )
set( CMAKE_CUDA_FLAGS_RELEASE "${CMAKE_CUDA_FLAGS_RELEASE} -dlto" )
message (STATUS "#############################################")
message (STATUS "SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})
message (STATUS "SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME})
message (STATUS "CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID})
message (STATUS "CXX_COMPILER: " ${CMAKE_CXX_COMPILER})
message (STATUS "CUDA_COMPILER: " ${CMAKE_CUDA_COMPILER})
message (STATUS "C_FLAGS: " ${CMAKE_C_FLAGS})
message (STATUS "CXX_FLAGS: " ${CMAKE_CXX_FLAGS})
message (STATUS "CXX_FLAGS_DEBUG: " ${CMAKE_CXX_FLAGS_DEBUG})
message (STATUS "CXX_FLAGS_RELEASE: " ${CMAKE_CXX_FLAGS_RELEASE})
message (STATUS "CUDA_FLAGS: " ${CMAKE_CUDA_FLAGS})
message (STATUS "CUDA_FLAGS_DEBUG: " ${CMAKE_CUDA_FLAGS_DEBUG})
message (STATUS "CUDA_FLAGS_RELEASE: " ${CMAKE_CUDA_FLAGS_RELEASE})
message (STATUS "BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
message (STATUS "#############################################")
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
file (GLOB HEADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"*.h"
)
file (GLOB CPP_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"*.cpp"
)
list (APPEND CUDA_NN_SRC ${HEADER_FILES} ${CPP_FILES} ${CU_FILES})
set_source_files_properties( ffCudaNn.cpp PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ )
cuda_add_executable(
ffCudaNn
${CUDA_NN_SRC}
)