Skip to content

Commit

Permalink
update cmake to compile also for compute capability 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvano Galliani committed Jan 5, 2016
1 parent a47372d commit 28e197a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ cmake_minimum_required (VERSION 2.8)
project (fusibile)

find_package(OpenCV REQUIRED )
#find_package(Armadillo REQUIRED)
find_package(CUDA 6.0 REQUIRED ) # For Cuda Managed Memory and c++11

include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(.)

#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_52,code=sm_52)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_52,code=sm_52)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_52,code=sm_52)
#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_52,code=sm_52)

if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=c++11)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -ffast-math -march=native") # extend release-profile with fast-math
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall") # extend debug-profile with -Wall
#add_definitions(-march=native)
endif()

Expand Down

0 comments on commit 28e197a

Please sign in to comment.