-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
55 lines (43 loc) · 1.19 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
54
cmake_minimum_required (VERSION 3.0)
project (CUDA-SNN)
# The version number.
set (CUDA-SNN_VERSION_MAJOR 2)
set (CUDA-SNN_VERSION_MINOR 0)
find_package (CUDA REQUIRED)
include_directories (${CUDA_INCLUDE_DIRS})
MESSAGE("${CUDA_INCLUDE_DIRS}/../samples/common/inc")
include_directories ("${CUDA_INCLUDE_DIRS}/../samples/common/inc")
set(CUDA_SEPARABLE_COMPILATION ON)
# opencv
find_package( OpenCV REQUIRED )
INCLUDE_DIRECTORIES( ${OPENCV_INCLUDE_DIR} )
set(OpenCV_LIBRARIES ${OpenCV_LIBS})
include_directories(${PROJECT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O3 -rdynamic")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
-gencode arch=compute_60,code=sm_60
-O3
--use_fast_math
# -G
# -g
-rdc=true
)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
)
MESSAGE(${CUDA_NVCC_FLAGS})
file(GLOB CUDA_SNN_CU_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"readData/*"
"layers/*"
"dataAugmentation/*"
"common/*"
"main.cpp"
"net.*"
"net_spiking.*")
cuda_add_executable(CUDA-SNN ${CUDA_SNN_CU_SOURCES})
target_link_libraries(CUDA-SNN
${OpenCV_LIBRARIES}
${CUDA_CUBLAS_LIBRARIES}
${CUDA_curand_LIBRARY}
${CUDA_LIBRARIES}
)
CUDA_ADD_CUBLAS_TO_TARGET(CUDA-SNN)