#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