这是我的代码:
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
答案 0 :(得分:3)
我改变了
unsigned char *d_eCB[9];
到
unsigned char *d_eCB;
谢谢。