I have a struct which contains a double-pointer like this:
struct image
{
int width, height;
uchar** imageData;
}
and then
Image* h_imageList = (Image*)malloc(20 * sizeof(Image));
//fill h_imageList...
Image* d_imageList;
cudaMalloc(&d_imageList, 20 * sizeof(Image));
cudaMemcpy(d_imageList, h_imageList, 20 * sizeof(Image), cudaMemcpyHostToDevice);
when i pass d_imageList
to a kernel as a parameter, it seems that imageData
was not successfully copied. It is not accessible. But width
and height
is accessible. So what's wrong with my code? How to copy this double-pointer?