-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathKuplungCuda.make
54 lines (38 loc) · 1.28 KB
/
KuplungCuda.make
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
#
# Makefile for Kuplung Cuda (experimental)
# supudo.net, 2017
#
# All .cu files should be located in $(CUDA_FOLDER).
#
# TODO: Optimize the versions in more correct manner!
#
PROGRAM_NAME := KuplungCuda
NVCC := /usr/local/cuda/bin/nvcc
RM := rm -rf
NVCCFLAGS := -D_DEBUG --use_fast_math -L/usr/local/cuda/lib -lcuda -lcudart -lcufft --machine 64 -arch=compute_30 -c
CUDA_FOLDER := Kuplung/kuplung/cuda/cu/
CUDA_INCLUDE = -I /usr/local/cuda/include
ifeq ($(USE_CUDA), 1)
CUDA_COMM_GEN = $(NVCC) $(CUDA_INCLUDE) -G -g -O0 -gencode arch=compute_30,code=sm_30 -odir "." -M -o $@ $<
CUDA_COMM_COMP = $(NVCC) $(CUDA_INCLUDE) -G -g -O0 --compile --relocatable-device-code=false -gencode arch=compute_30,code=compute_30 -gencode arch=compute_30,code=sm_30 -x cu -o $@ $<
CU_SOURCES += $(wildcard $(CUDA_FOLDER)*.cu)
CU_OBJS = ${CU_SOURCES:.cu=_cuda.o}
.PHONY: all clean distclean
all: $(PROGRAM_NAME)
%_cuda.o: %.cu
$(CUDA_COMM_GEN)
$(CUDA_COMM_COMP)
$(PROGRAM_NAME): $(CU_OBJS)
@ for cu_obj in $(subst $(CUDA_FOLDER), , $(CU_OBJS)); \
do \
mv $(CUDA_FOLDER)/$$cu_obj external/cuda_build/$$cu_obj 2>/dev/null; \
done
clean:
@- $(RM) $(PROGRAM_NAME) $(CU_OBJS) *~
distclean: clean
else
all: $(PROGRAM_NAME)
$(PROGRAM_NAME):
@echo false
#@export DEF_KuplungSetting_UseCuda="NoCuda"
endif