我在设备变量上使用cudaMemset
时遇到问题。是否有可能使用参考设备变量cudaMemset
,或者是它只是一个缺少编译器标志,或库..我使用CUDA 4.1的事情,cudaMemset在__device__变量上失败
NVRM版本:NVIDIA UNIX x86_64的内核模块285.05.33周四年01月19 14时07分02秒PST 2012
这是我的示例代码:
#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
// device variable and kernel
__device__ float d_test;
int main() {
if (cudaMemset(&d_test,0,sizeof(float)) !=cudaSuccess)
printf("Error!\n");
}
,其输出:
Error!
cudaGetSymbolAddress不会为我工作。 我需要添加一些编译器标志吗? 我复制上面的代码,但它说GPUassert:无效的设备符号XXXX.cu 24 – worldterminator 2012-08-29 16:48:18