#define cuset(symbol, T, val)
{
void *cuset_addr;
cucheck(cudaGetSymbolAddress(&cuset_addr, symbol));
T cuset_val=(val);
cucheck(cudaMemcpy(cuset_addr, &cuset_val, sizeof(cuset_val),cudaMemcpyHostToDevice))
}
当我编译并运行该项目,它提出一个错误:https://github.com/canonizer/halloc无效的设备符号
中的自述:
invalid device symbol in cudaGetSymbolAddress(&cuset_addr, random_states_g).
我从下载项目项目目前这样:
Note: libraries and tests are currently not compiled for compute_50/sm_50, i.e. Maxwell.
我的环境是:Ubuntu14.04,cuda7.5, capability5.0
的编译,因为这:
nvcc -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -lineinfo -O3 -lib -rdc=true -Xptxas -dlcm=cg -Xptxas -dscm=wb \
-Xptxas -maxrregcount=64 -o bin/libhalloc.a src/*.cu
,我不知道是否是因为我CUDA的版本,当我搜索的错误,我发现它似乎有一些符号,它是从5.0中删除。
谢谢,这真的很有帮助,并解决了我的问题。 – shrimp