Skip to content

Commit

Permalink
really fix win32 and linux + upgrade cuda archs
Browse files Browse the repository at this point in the history
  • Loading branch information
kysucix committed Nov 27, 2019
1 parent c2d308b commit fe09352
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
22 changes: 3 additions & 19 deletions CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.9)
project (gipuma LANGUAGES CUDA CXX)
project (gipuma)
# Enable C++11 globally
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -19,27 +19,11 @@ endif()
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(.)

set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_61,code=sm_61)
# from https://en.wikipedia.org/wiki/CUDA#GPUs_supported
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_32,code=sm_32 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_53,code=sm_53 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_72,code=sm_72 -gencode arch=compute_75,code=sm_75)
#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_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION})
list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR)
list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR)

#message(STATUS ${GCC_MAJOR})
#message(STATUS ${GCC_MINOR})
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
if (GCC_VERSION VERSION_GREATER 5.1)
add_definitions(-std=c++14)
#message(STATUS "DETECTED 5")
#else()
add_definitions(-std=c++11)
#message(STATUS "DETECTED 4")
endif()
add_definitions(-Wall)
add_definitions(-Wextra)
add_definitions(-pedantic)
Expand Down
7 changes: 6 additions & 1 deletion main.cpp
Expand Up @@ -24,7 +24,12 @@

#include <sys/stat.h> // mkdir
#include <sys/types.h> // mkdir
#include "dirent.h" // opendir()

#ifdef WIN32
#include <win32_dirent.h> // opendir()
#else
#include <dirent.h> // opendir()
#endif

#include "algorithmparameters.h"
#include "globalstate.h"
Expand Down
File renamed without changes.

0 comments on commit fe09352

Please sign in to comment.