-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
44 lines (32 loc) · 1.24 KB
/
Copy pathmakefile
File metadata and controls
44 lines (32 loc) · 1.24 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
DEBUG=0
CC=gcc
CPP=g++ -m64
MPICC=mpicc
NVCC=nvcc
CFLAGS=-g -O3 -Wall -DDEBUG=$(DEBUG)
#CFLAGS=-g -O3 -Wall -DDEBUG=$(DEBUG) -DDYNAMIC
LDFLAGS= -lm -L/usr/local/depot/cuda-10.2/lib64/ -lcudart
OMP=-fopenmp -DOMP
MPI=-DMPI
NVCCFLAGS=-O3 -m64 --gpu-architecture compute_61
SEQCFILES=light-seq.c graph.c sim-seq.c instrument.c cycletimer.c
OPENMPCFILES=light-openmp.c graph.c sim-openmp.c instrument.c cycletimer.c
MPICFILES=light-mpi.c graph.c sim-mpi.c instrument.c cycletimer.c mpiutil.c
CUDACFILES=light-cuda.c graph.c instrument.c cycletimer.c
CUDAFILES=sim-cuda.cu
HFILES=graph.h sim.h instrument.h cycletimer.h
MPIHFILES=graph.h sim-mpi.h instrument.h cycletimer.h mpiutil.h
TARGET=light-seq light-openmp light-mpi light-cuda
all: $(TARGET)
light-seq: $(SEQCFILES) $(HFILES)
$(CC) $(CFLAGS) -o $@ $(SEQCFILES) $(LDFLAGS)
light-openmp: $(OPENMPCFILES) $(HFILES)
$(CC) $(CFLAGS) $(OMP) -o $@ $(OPENMPCFILES) $(LDFLAGS)
light-mpi: $(MPICFILES) $(MPIHFILES)
$(MPICC) $(CFLAGS) $(MPI) -o $@ $(MPICFILES) $(LDFLAGS)
light-cuda: $(CUDACFILES) $(HFILES) sim-cuda.o
$(CPP) $(CFLAGS) -o $@ $(CUDACFILES) sim-cuda.o $(LDFLAGS)
sim-cuda.o: $(CUDAFILES)
$(NVCC) $(NVCCFLAGS) $(CUDAFILES) -c -o $@
clean:
rm $(TARGET) *.o