Another day, another problem!
Im calling a device function from within a global function. Most of the parameters in the device functions are correct, but two of them are garbage.
Does anyone know what might cause this?
Code snippet:
Global function:
for( int i=0;i<NUM_PARTICULES;i++)
{
if(i!=index)
{
pos42=g_data[i];
vel42=g_vel[i];
pos2=make_float3(pos42);
vel2=make_float3(vel42);
force+=collideSphere(pos,vel,pos2,vel2,1.1f,1.1f,DT);
}
}
__device__ float3 collideSphere(float3 pos, float3 vel, float3 pos2, float3 vel2,float rA,float rB,float dt)
{
...
}
Parameters rA and rB contain garbage. I even tried passing constant values (as shown above) to them but get 5.891e-039#DEN when looking at it through the debugger.
Thanks!
Sami