-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (26 loc) · 917 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
SRCS = ./gpu/neutron.cu ./seq/neutron-seq.c ./hybrid/neutron-hyb.cu ./cpu_parallel/neutron-par-cpu.cpp
EXE_NAME = neutron neutron-seq neutron-hyb neutron-par-cpu
OBJECTS = neutron.o neutron-seq.o neutron-hyb.o neutron-par-cpu.o
CC = gcc
CFLAGS = -O3 -arch=sm_20 -lineinfo
LIB=-lm -L/usr/local/cuda/lib64/ -lcuda -lcudart
NVCC= /usr/local/cuda/bin/nvcc -Xcompiler -fopenmp
all: ${EXE_NAME}
neutron.o : ./gpu/neutron.cu
$(NVCC) -c $(CFLAGS) $<
neutron : neutron.o
${NVCC} ${CFLAGS} -o $@ $+ ${LIB}
neutron-hyb.o : ./hybrid/neutron-hyb.cu
$(NVCC) -c $(CFLAGS) $<
neutron-hyb : neutron-hyb.o
${NVCC} ${CFLAGS} -o $@ $+ ${LIB}
neutron-seq.o : ./seq/neutron-seq.c
$(CC) -c $<
neutron-seq: neutron-seq.o
$(CC) -o $@ $+ -lm
neutron-par-cpu.o : ./cpu_parallel/neutron-par-cpu.cpp
g++ -c -O3 $<
neutron-par-cpu: neutron-par-cpu.o
g++ -o $@ $+ -lm -fopenmp
clean:
rm -f ${EXE_NAME} *.o *~