forked from mugamma/gmm-lda-gibbs-acc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (46 loc) · 1.35 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
CC=nvcc
OPT=-O0
CFLAGS=--gpu-architecture=sm_75 $(OPT) -lm -lcurand -rdc=true -dlto
DFLAGS=-DNSAMPLES=$(NSAMPLES) -DKCLASSES=$(KCLASSES)
OBJ=obj
BIN=bin
TEST=test
CSV=$(TEST)/results.csv
INIT := init
MODULES := distrs utils gmm gmm_gibbs
TESTS := cont_pdf_test cont_gof_test int_test
EXEC_FILES := $(shell find $(BIN)/int*)
NSAMPLES=1024
KCLASSES=4
.PHONY : clean test
all: $(INIT) modules $(TESTS)
profile: init modules
filenum=0
for n in 16384 32768 65536 131072 262144 ; do \
for k in 2 4 8 16 32 64 128 ; do \
make int_test NSAMPLES=$$n KCLASSES=$$k OPT=-O1; \
done \
done
exec:
echo "N,K,Time(usec)" > $(CSV)
for file in $(EXEC_FILES) ; do \
./$$file >> $(CSV); \
done
debug: CFLAGS += -G
debug: all
init:
mkdir -p $(OBJ) $(BIN)
modules: src/distrs.cu src/utils.cu src/gmm.cu src/gmm_gibbs.cu
$(CC) --device-c $(CFLAGS) $(DFLAGS) $^ -odir ./$(OBJ)/
cont_pdf_test: test/cont_pdf_test.cu
$(CC) --link $(CFLAGS) $(DFLAGS) $^ obj/* -o $(BIN)/$@
cont_gof_test: test/cont_gof_test.cu
$(CC) --link $(CFLAGS) $(DFLAGS) $^ obj/* -o $(BIN)/$@
int_test: test/int_test.cu
$(CC) --device-c $(CFLAGS) $(DFLAGS) src/distrs.cu src/utils.cu src/gmm.cu src/gmm_gibbs.cu -odir ./obj/
$(CC) --link $(CFLAGS) $(DFLAGS) $^ obj/* -o $(BIN)/$@-$(NSAMPLES)-$(KCLASSES)
clean:
rm -rf bin
rm -rf obj
test:
cd bin && ./cont_gof_test && ./int_test && ./cont_pdf_test