-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
56 lines (48 loc) · 2.15 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
cmake_minimum_required(VERSION 3.0.0)
project(acl-blas-on-flash)
set(N_IO_THR 4 CACHE STRING "")
set(N_COMPUTE_THR 4 CACHE STRING "")
set(PROGRAM_BUDGET 3145728 CACHE STRING "") # Bytes
set(MAX_SIMUL_REQS 4096 CACHE STRING "")
set(MAX_EVENTS 4096 CACHE STRING "")
set(SECTOR_LEN 512 CACHE STRING "")
set(IS_ALIGNED IS_512_ALIGNED CACHE STRING "")
set(GEMM_BLK_SIZE 256 CACHE STRING "") # the number of row and column of submatrices
set(MAX_NNZS 10000000 CACHE STRING "")
set(OVERLAP_CHECK TRUE CACHE STRING "")
add_definitions(-DN_IO_THR=${N_IO_THR}
-DN_COMPUTE_THR=${N_COMPUTE_THR}
-DPROGRAM_BUDGET=${PROGRAM_BUDGET}
-DMAX_SIMUL_REQS=${MAX_SIMUL_REQS}
-DMAX_EVENTS=${MAX_EVENTS}
-DSECTOR_LEN=${SECTOR_LEN}
-DIS_ALIGNED=${IS_ALIGNED}
-DGEMM_BLK_SIZE=${GEMM_BLK_SIZE}
-DMAX_NNZS=${MAX_NNZS}
-DOVERLAP_CHECK=${OVERLAP_CHECK}
-D_32BIT_MACHINE=1
)
# Compiler options
set(CXX g++)
# CXX Config
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -DDEBUG -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
add_compile_options(-std=c++14 -Wall ${CONFIG_FLAGS} -fopenmp -Wfatal-errors)
#ACL Config
set(ACL_ROOT [arm_compute_library_path])
include_directories(include ${ACL_ROOT} ${ACL_ROOT}/include)
link_libraries(arm_compute arm_compute_core pthread)
link_directories(${ACL_ROOT}/build)
# Generate library
file(GLOB FHANDLES "src/file_handles/*.cpp")
file(GLOB BLAS "src/blas/gemm.cpp")
file(GLOB SCHED "src/scheduler/*.cpp")
add_library(fblas STATIC ${FHANDLES} ${BLAS} ${SCHED} src/lib_funcs.cpp src/utils.cpp)
link_libraries(fblas gomp)
# Generate drivers
add_executable(in_mem_gemm_driver drivers/in_mem_gemm.cpp)
add_executable(gemm_driver drivers/gemm.cpp /usr/lib/arm-linux-gnueabihf/pthread_atfork.o)
add_executable(print print.cpp)
# Generate tests/misc related stuff
add_executable(dense_create misc/dense_create.cpp misc/gen_common.h)
add_custom_command(TARGET fblas PRE_BUILD COMMAND clang-format-4.0 -i ../include/*.h ../include/*/*.h ../src/*.cpp ../src/*/*.cpp ../misc/*.cpp ../drivers/*.cpp)