Sign up ×  I'm currently working on porting a particle system to
update on the GPU via the use of CUDA. With CUDA, I've already
passed over the required data I need to the GPU and allocated
and copied the date via the host. When I build the project, it
all runs fine, but when I run it, the project says I need to
allocate my h_position pointer. This pointer is my host pointer
and is meant to hold the data.  I know I need to pass in the
current particle position to the required cudaMemcpy call and
they are currently stored in a list with a for loop being
created and interated for each particle calling the following
line of code:  m_particleList[i].positionY =
m_particleList[i].positionY - (m_particleList[i].velocity *
frameTime * 0.001f);  My current host side cuda code looks like
this:  float* h_position; // Your host pointer. This holds the
data (I assume it's already filled with the data.)     float*
d_position; // Your device pointer, we will allocate and fill
this     float* d_velocity;     float* d_time;