1、首先我用的显卡是Tesla C2050,是属于Fermi结构,共享存储和L1公用64K
2、我利用cudaDeviceSetCacheConfig(cudaFuncCachePreferShared)方法,编译还是提示错误,用cudaThreadSetCacheConfig(cudaFuncCachePreferShared)方法,编译还是提示错误。
3、后来我谷歌了下,说我用的是sdk例子用的makefile的问题,后来我学习了下写makefile,写了一个简单的makefile,如下:
NVCCFLAGS := -O3 --ptxas-options=-v -arch sm_20
NVCC := /usr/local/cuda/bin/nvcc
#定义变量
objects = MICompute.o MICompute_kernel.o
#依赖关系
MICompute: $(objects)
g++ $(objects) -o MICompute -lcudart -L/usr/local/cuda/lib64
MICompute.o: MICompute.cpp MICompute.h
g++ -c MICompute.cpp -I/usr/local/cuda/include
MICompute_kernel.o: MICompute_kernel.cu
nvcc -c MICompute_kernel.cu
.PHONY: clean
clean:
rm MICompute $(objects)
结果还是编译错误,说我用的共享存储大于16K,请问各位大神该如何解决这个问题?