Makefile for CUDA
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Makefile for CUDA相关的知识,希望对你有一定的参考价值。
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 [email protected] $< $(LIBRARIES) 15 .cpp.o: 16 $(CXX) $(INCLUDE) -c -g -o [email protected] $< $(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 [email protected] $^ $(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的主要内容,如果未能解决你的问题,请参考以下文章
在ubuntu中用cuda编译opencv的makefile停止工作
RuntimeError: ‘lengths’ argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor(代码片段