Hi all,
I am trying to send an array of objects to the GPU and use them in my kernel. But I don’t get any data in the kernel. here is my code:
struct point{
float x;
float y;
}
in host code:
point *host_points = new point[length];
for(int i=0; i<length; i++)
{
point p;
p.x = 2;
p.y = 2.5;
host_points[i] = p;
}
point d_points;
cudaMalloc((void*) &d_imaging_points, lengthsizeof(point));
cudaMemcpy(d_points, host_points, lengthsizeof(point), cudaMemcpyHostToDevice));
Am I doing anything wrong here because in my kernel I cannot access d_points[bx].x. I get all zeros.
Thanks,
ngm