-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
executable file
·68 lines (54 loc) · 2 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# _________ _____________________ ____ ______
# / ____/ | / ___/_ __/ ____/ __ \/ __ \/ ____/
# / /_ / /| | \__ \ / / / / / / / / / / / __/
# / __/ / ___ |___/ // / / /___/ /_/ / /_/ / /___
# /_/ /_/ |_/____//_/ \____/\____/_____/_____/
cmake_minimum_required (VERSION 3.0.2)
set(CMAKE_VERBOSE_MAKEFILE ON)
project (FNC_XNORNET)
include(CMakeLibs.cmake)
# ================================================================================
# Reset the C flags
# ================================================================================
set(CMAKE_C_FLAGS "")
set(CMAKE_C_FLAGS_RELEASE "")
set(CMAKE_C_FLAGS_DEBUG "")
# ================================================================================
# Build the executable
# ================================================================================
# Add the include directories
include_directories(include)
# ================================================================================
# C Global Flags
# ================================================================================
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
# clang - CC flags
set(CMAKE_C_FLAGS "-O3 -mavx2 -mfma -ffp-contract=fast -ffast-math -funroll-loops -ftree-vectorize")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
# GNU GCC - CC flags
set(CMAKE_C_FLAGS "-O3 -mavx2 -mfma -ffp-contract=fast -ffast-math -funroll-loops -ftree-vectorize")
endif()
set(SOURCE_FILES
src/main.c
src/main.h
src/xnornet.c
src/xnornet.h
src/conv_layer.c
src/conv_layer.h
src/fully_con_layer.c
src/fully_con_layer.h
src/mnist_wrapper.c
src/mnist_wrapper.h
src/pool_layer.c
src/pool_layer.h
src/tensor.c
src/tensor.h
src/back_prop.c
src/back_prop.h
)
add_executable(FNC_XNORNET ${SOURCE_FILES})
target_link_libraries(FNC_XNORNET m)
target_link_libraries(FNC_XNORNET pcm)
if (DEFINED PCM_DEPENDENCIES)
add_dependencies(FNC_XNORNET ${PCM_DEPENDENCIES})
endif(DEFINED PCM_DEPENDENCIES)