Hello,
I am pretty new to using CUDA and I am having trouble passing an array from host to the device. I have a variable on the host called spikeStreams_1D_h that I populate with data. I am trying to get this to be passed into a device variable that is a 2D array called img_spks.
double spikeStreams_1D_h[p*q*M];
__device__ double img_spks[p*q][M];
..
..
int main(){
DVS2Spks <<< 1, 1 >> > (spikeStreams_1D_h);
..
}
Below is the method for DVS2Spks:
__global__ void DVS2Spks(double *spikeStream_1D_h)
{
for (int i = 0; i < M; i++)
{
for (int j = 0; j < p*q; j++)
{
img_spks[j][i] = spikeStream_1D_h[j + ((p*q) * i)];
}
}
}
I thought that calling this method would make it so that img_spks has the data from spikeStream_1D_h. Instead, all of its values are zero. I am not sure if I am missing a step or not. Any advice is greatly appreciated!