-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmakefile
More file actions
56 lines (47 loc) · 1.59 KB
/
Copy pathmakefile
File metadata and controls
56 lines (47 loc) · 1.59 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
45
46
47
48
49
50
51
52
53
54
55
56
PREFIX=~/usr
NAME=libhalloc.a
HEADER=src/halloc.h
SRC_C=src/*.cu
SRC_H=src/*.h src/*.cuh
SRC=$(SRC_C) $(SRC_H)
TGT=bin/$(NAME)
ARCH= -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35
#TEST_TGT=tst/corr/bin/test
TMP=*~ \\\#* src/*~ src/\\\#* tst/corr/*~ tst/corr/*.o $(TGT) $(TEST_TGT)
# be careful: using cs modifier can lead to errors maxrregcount should be 44-64,
# this allows both enough threads and enough storage (values of 44 and 54 give
# good results in phase test, while 60 and 64 provide somewhat better spree
# throughput); 39-42 (39 tested) are good when operating in L1-preferred mode
build: $(TGT)
$(TGT): $(SRC) makefile
nvcc $(ARCH) -lineinfo -O3 -lib -rdc=true -Xptxas -dlcm=cg -Xptxas -dscm=wb \
-Xptxas -maxrregcount=64 -o $(TGT) $(SRC_C)
# -Xptxas -maxrregcount=42 -o $(TGT) $(SRC_C)
# nvcc $(ARCH) -O3 -lib -rdc=true -Xptxas -dlcm=cs -Xptxas -dscm=cs -o $(TGT) $(SRC_C)
# nvcc $(ARCH) -O3 -lib -rdc=true -o $(TGT) $(SRC_C)
#test: $(TGT) makefile
# make -C tst/corr/test run
test: $(TGT) makefile build-corr
make -C tst/corr run-only
clean:
rm -f $(TMP)
make -C tst/common clean
make -C tst/corr clean
make -C tst/perf clean
build-perf: $(TGT)
make -C tst/common build
make -C tst/perf build
build-corr: $(TGT)
make -C tst/common build
make -C tst/corr build
build-test: $(TGT)
make -C tst/common build
make -C tst/corr build
make -C tst/perf build
install: $(HEADER) $(TGT)
cp $(HEADER) $(PREFIX)/include/halloc.h
cp $(TGT) $(PREFIX)/lib/libhalloc.a
uninstall:
rm -f $(PREFIX)/include/halloc.h $(PREFIX)/lib/libhalloc.a