forked from xuqiantong/CUDA-Winograd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (35 loc) · 872 Bytes
/
Makefile
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
CC=gcc
CPP=g++
AR=ar
NVCC=nvcc
CSRCS := $(shell find . -name '*.c' -not -name '._*')
COBJS := $(subst .c,.o,$(CSRCS))
CUSRCS := $(shell find . -name '*.cu' -not -name '._*')
CUOBJS := $(subst .cu,.o,$(CUSRCS))
#ALLOBJS := $(COBJS)
#ALLOBJS += $(CUOBJS)
LIBDIR := -L/usr/local/cuda/lib64 -L/home/ys646/lib/cudnn/lib64/
#-L/usr/local/cudnn5/lib64
CFLAGS= \
-I. \
-fPIC \
-I/usr/local/cuda/inlclude
CUFLAGS= \
-I. \
-Xcompiler \
-fPIC \
-I/usr/local/cuda/inlclude \
-g
LDFLAGS=-L. -lm -lpthread -lrt
#CFLAGS+=-Ofast
CFLAGS+= -O3 -ffast-math -mavx -mfma
all: Test
%.o: %.c
$(NVCC) $(CUFLAGS) -c $< -o $(basename $@).o
%.o: %.cu
$(NVCC) $(CUFLAGS) -c $< -o $(basename $@).o
Test: $(CUOBJS) $(COBJS)
$(NVCC) -o Test $(CUOBJS) $(COBJS) $(LIBDIR) $(LDFLAGS) -lcudart -lcuda -lstdc++ -lcudnn -lcublas
clean:
find . -name "*.o" -exec rm -f '{}' ';'
rm -f Test