-
Notifications
You must be signed in to change notification settings - Fork 70
/
CMakeLists.txt
47 lines (42 loc) · 1.41 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
cmake_minimum_required(VERSION 3.2)
project(nativeoperations)
set( CMAKE_VERBOSE_MAKEFILE on )
option(TESTS "Compile and make tests for the code?" ON)
option(PTX "Compile ptx" OFF)
option(CUBIN "Compile cubin" OFF)
option(ECLIPSE "Generate eclipse files" OFF)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_path(STDIO_INCLUDE_PATH stdio.h)
# packages
find_package(CUDA)
set(CMAKE_CXX_FLAGS "-Wall -O0 -fopenmp -std=c++11 -ftree-vectorize -msse2 -ftree-vectorizer-verbose=0 -fassociative-math -funsafe-math-optimizations -march=native")
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include_directories("/usr/include")
include_directories("/usr/local/include")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (CUDA_FOUND)
message("CUDA found!")
set( CUDA_ARCHITECTURE_MINIMUM "5.0" CACHE STRING "Minimum required CUDA compute capability" )
SET(CUDA_VERBOSE_BUILD ON)
SET(CUDA_SEPARABLE_COMPILATION OFF)
set(CUDA_COMPUTE_CAPABILITY "50")
list(APPEND CUDA_NVCC_FLAGS "-DVERBOSE;-lCppUTest;-G;-g;-gencode arch=compute_50,code=sm_50")
endif()
include_directories(include)
add_subdirectory(src)
if(ECLIPSE)
message("ADDING ECLIPSE")
add_subdirectory(eclipse)
endif()
if(PTX)
message("ADDING PTX")
add_subdirectory(ptx)
endif()
if(CUBIN)
message("ADDING CUBIN")
add_subdirectory(cubin)
endif()
if(RUN_TEST)
message("ADDING TEST")
add_subdirectory(test)
endif()