forked from bqm1111/GraphCutCuda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph_Maxflow.pro
More file actions
66 lines (47 loc) · 1.95 KB
/
Graph_Maxflow.pro
File metadata and controls
66 lines (47 loc) · 1.95 KB
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
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
TEMPLATE = app
CONFIG += console c++11
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp \
graph.cpp \
cudacut.cpp
HEADERS += \
graph.h \
cudacut.h
CUDA_SOURCES += \
CudaCut.cu \
CudaCut_kernel.cu
CUDA_HEADERS += \
TimingGPU.cuh
# Path to cuda toolkit install
CUDA_DIR = /usr/local/cuda
# Path to header and libs files
INCLUDEPATH += $$CUDA_DIR/include
QMAKE_LIBDIR += $$CUDA_DIR/lib64 # Note I'm using a 64 bits Operating system
# libs used in your code
LIBS += -lcudart -lcuda -lcufft
# GPU architecture
CUDA_ARCH = sm_75 # Yeah! I've a new device. Adjust with your compute capability
# Here are some NVCC flags I've always used by default. "-fno-strict-aliasing"
NVCCFLAGS = -std=c++11 --compiler-options -fno-stack-protector -use_fast_math --ptxas-options=-v -line-info
# Prepare the extra compiler configuration (taken from the nvidia forum - i'm not an expert in this part)
CUDA_INC = $$join(INCLUDEPATH,' -I','-I',' ')
cuda.commands = $$CUDA_DIR/bin/nvcc -m64 -O3 -arch=$$CUDA_ARCH -c $$NVCCFLAGS \
$$CUDA_INC $$LIBS ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT} \
2>&1 | sed -r \"s/\\(([0-9]+)\\)/:\\1/g\" 1>&2
# nvcc error printout format ever so slightly different from gcc
# http://forums.nvidia.com/index.php?showtopic=171651
cuda.dependency_type = TYPE_C # there was a typo here. Thanks workmate!
cuda.depend_command = $$CUDA_DIR/bin/nvcc -O3 -M $$CUDA_INC $$NVCCFLAGS ${QMAKE_FILE_NAME}
cuda.input = CUDA_SOURCES
cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.o
# Tell Qt that we want add more stuff to the Makefile
QMAKE_EXTRA_COMPILERS += cuda
# Opencv Path
INCLUDEPATH += /usr/local/share/opencv3-4/include
INCLUDEPATH += /usr/local/share/opencv3-4/include/opencv
LIBS += -L/usr/local/share/opencv3-4/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_videoio -lopencv_imgcodecs