-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (30 loc) · 638 Bytes
/
Copy pathmakefile
File metadata and controls
40 lines (30 loc) · 638 Bytes
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
override CUDAPATH = /usr/local/cuda
CXX := g++
NVCC := nvcc -ccbin /usr/bin
LINK := g++ -fPIC
INCLUDES = \
-I. \
-I$(CUDAPATH)/include
override CXXFLAGS += \
$(INCLUDES) \
-O3 \
-std=c++17
NVCCFLAGS += \
$(INCLUDES) \
-std=c++14
override LDFLAGS += \
-L$(DEPPATH)/lib \
-lz \
-lm
LIB_CUDA := \
-L$(CUDAPATH)/lib64 \
-lcudart
DEPS = $(shell find . -name '*.hpp' -or -name '*.h' -or -name '*.hh')
test: wrapper_test.o cuda_example.cu.o
$(LINK) -o $@ $^ $(LIB_CUDA) $(LDFLAGS)
%.cu.o: %.cu
$(NVCC) $(NVCCFLAGS) -c $< -o $@
.PHONY: clean
clean:
@find . -name '*.o' -exec rm {} \;
@rm -f test