cudaMemcpy - 收到错误:cudaErrorInvalidValue 11

时间:2015-07-24 12:20:02

标签: cuda nvcc

这是我的代码:

unsigned char *d_eCB[9];
unsigned char eCB[9] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
err = cudaMalloc((void **)&d_eCB,9*sizeof(unsigned char));
err = cudaMemcpy(d_eCB, eCB, 9*sizeof(unsigned char), cudaMemcpyHostToDevice);

错误发生在以下行:

err = cudaMemcpy(d_eCB, eCB, 9*sizeof(unsigned char), cudaMemcpyHostToDevice);

错误如下:cudaErrorInvalidValue 11

1 个答案:

答案 0 :(得分:3)

我改变了

unsigned char *d_eCB[9];

unsigned char *d_eCB;

谢谢。