-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
47 lines (38 loc) · 1.59 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
#!/usr/bin/make -f
# Linux Makefile for CUDALucas
COMMON_INCLUDES =
COMMON_DEFINES =
COMMON_LIBS =
CXX = g++
#CXX = g++-4.6 -floop-parallelize-all -ftree-parallelize-loops=4 -ftree-loop-distribution -Wall -Wextra -pedantic -march=native
CFLAGS = -O3 $(COMMON_INCLUDES) $(COMMON_DEFINES)
NVCC = nvcc
# uncomment the relevant line for your hardware,
# or leave all uncommented for a generic binary
# sm_21 is actually slower than sm_20 on sm_21 hardware...
#NVCC_ARCHES = -gencode arch=compute_13,code=sm_13
NVCC_ARCHES += -gencode arch=compute_20,code=sm_20
NVCC_ARCHES += -gencode arch=compute_20,code=sm_21
NVCC_CFLAGS = -O3 $(COMMON_INCLUDES) $(COMMON_DEFINES) $(NVCC_ARCHES) --compiler-options="$(CFLAGS) -fno-strict-aliasing" -use_fast_math --ptxas-options="-v -dlcm=cg" -Xopencc -OPT:unroll_size=200000
CUDALucas: CUDALucas.o setup.o rw.o balance.o zero.o main.o
$(CXX) -fPIC -O3 -o CUDALucas CUDALucas.o setup.o rw.o balance.o zero.o main.o $(COMMON_LIBS) -Wl,-O1 -Wl,--as-needed -lcudart -lcufft -lm
CUDALucas.o: CUDALucas.cu cuda_safecalls.h setup.h
$(NVCC) $(NVCC_CFLAGS) -c CUDALucas.cu
setup.o: setup.c setup.h
$(CXX) $(CFLAGS) -c setup.c
rw.o: rw.c rw.h setup.h
$(CXX) $(CFLAGS) -c rw.c
balance.o: balance.c balance.h setup.h
$(CXX) $(CFLAGS) -c balance.c
zero.o: zero.c zero.h setup.h
$(CXX) $(CFLAGS) -c zero.c
main.o: main.c setup.h balance.h rw.h
$(CXX) $(CFLAGS) -c main.c
test: CUDALucas
-rm c9949999 t9949999
@echo "Iteration 1000, 0xb0a3bd66f8169283 <== expected first residue at 1000 iterations"
./CUDALucas -o- -c 1000 -t 9949999
clean:
-rm *.o *~
-rm CUDALucas
-rm c9949999 t9949999