码迷,mamicode.com
首页 > 其他好文 > 详细

Makefile for CUDA

时间:2017-03-21 23:02:48      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:amp   gets   run   timer   pat   precision   nbsp   sudo   log   

 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.732         libcufft.so libcufft.so.7 h_hatCH1.txt

 

Makefile for CUDA

标签:amp   gets   run   timer   pat   precision   nbsp   sudo   log   

原文地址:http://www.cnblogs.com/ILoveOCT/p/6597037.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!