-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (42 loc) · 1.74 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
host=$(shell hostname)
ifeq ($(host),JurosComposto)
LDFLAGS= -I$(RSFROOT)/include -L$(RSFROOT)/lib -lrsf++ -lrsf -lm -ltirpc -lfftw3f -lfftw3 -O3
endif
ifeq ($(host),marreca)
LDFLAGS= -I$(RSFROOT)/include -L$(RSFROOT)/lib -lrsf++ -lrsf -lm -lfftw3f -lfftw3 -O3
endif
CULIBS= -L /opt/cuda/lib -I /opt/cuda/include -lcudart -lcuda -lstdc++ -lcufft
ODIR = ../../library
IDIR = ../../include
#SOURCE = $(wildcard $(ODIR)/*.cu)
#OBJ = $(SOURCE:.cu=.o)
_OBJ = born.o snap.o io.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
DEPS = $(wildcard $(IDIR)/*.cuh)
CFLAGS = -I$(IDIR) -arch=sm_30
PROG = mod
dFold=testData
data=seismicData.rsf
OD=directwave.rsf
comOD=seismicDataWithDirectWave.rsf
vel=vel.rsf
ref=ref.rsf
$(PROG): main.o $(OBJ)
nvcc main.o $(OBJ) $(CFLAGS) $(LDFLAGS) -o $@
main.o: main.cu $(DEPS)
nvcc -x cu $(CFLAGS) $(LDFLAGS) -o $@ -dc $<
$(ODIR)/%.o: $(ODIR)/%.cu $(DEPS)
nvcc -x cu $(CFLAGS) $(LDFLAGS) -o $@ -dc $<
run: mod
#./mod nr=400 nshots=2 incShots=100 isrc=0 jsrc=200 gxbeg=0 ref=$(dFold)/$(ref) vel=$(dFold)/$(vel) data=$(dFold)/$(data) OD=$(dFold)/$(OD) comOD=$(dFold)/$(comOD)
/usr/bin/time ./mod nr=368 nshots=3 incShots=100 incRec=0 isrc=0 jsrc=100 gxbeg=0 ref=$(dFold)/$(ref) vel=$(dFold)/$(vel) data=$(dFold)/$(data) OD=$(dFold)/$(OD) comOD=$(dFold)/$(comOD)
sfgrey <$(dFold)/$(data) >seismicData.vpl
#ximage n1=920 <snap/snap_u3_s0_1290_920_1120
#ximage n1=780 <test_kernel_add_sourceArray &
#ximage n1=780 <snap/snap_u3_s0_0_780_980 &
#ximage n1=780 <snap/snap_u3_s1_0_780_980 &
profile: mod
nvprof ./mod nr=368 nshots=3 incShots=100 incRec=0 isrc=0 jsrc=100 gxbeg=0 ref=$(dFold)/$(ref) vel=$(dFold)/$(vel) data=$(dFold)/$(data) OD=$(dFold)/$(OD) comOD=$(dFold)/$(comOD)
PHONY: clean
clean:
rm -f $(ODIR)/*.o $(PROG) *.o