1 CUDA_PATH ?=/usr/local/cuda-7.0
2 NVCC :=$(CUDA_PATH)/bin/nvcc -ccbin g++
3 INCLUDE :=-I/usr/local/cuda-7.0/include/\
4 -I/usr/local/cuda/samples/common/inc\
5 -I/usr/include/c++\
6 -I./
7
8 LIBRARIES :=-L/usr/local/cuda/lib64 -lcudart -lcufft
9 TARGETS :=kernel
10 OBJECTS :=kernel.o IML_PrecisionTimer.o stimer.o
11
12 .SUFFIXES:.o .cu .cpp
13 .cu.o:
14 $(NVCC) -arch=sm_20 $(INCLUDE) -c -g -o $@ $< $(LIBRARIES)
15 .cpp.o:
16 $(CXX) $(INCLUDE) -c -g -o $@ $< $(LIBRARIES)
17
18 all: $(TARGETS)
19
20 $(TARGETS): $(OBJECTS)
21 #sudo cp /usr/local/cuda/lib64/libcufft.so.7.0 /usr/lib
22 ln -s libcudart.so.7.0 libcudart.so
23 ln -s libcudart.so.7.0 libcudart.so.7
24 ln -s libcufft.so.7.0 libcufft.so
25 ln -s libcufft.so.7.0 libcufft.so.7
26 g++ $(INCLUDE) -g -o $@ $^ $(LIBRARIES)
27 run:
28 ./$(TARGETS)
29
30 clean:
31 rm -rf *.o kernel libcudart.so libcudart.so.7\
32 libcufft.so libcufft.so.7 h_hatCH1.txt