Getting garbage in parameters of a __device__ func

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

I know this is an old topic but I’m seeing the same thing. Has anyone figured it out?

If I check a parameter in the device function while stepping through it (using either quickwatch or floating the cursor over it) it gives me an incorrect value. If I use printf it prints the correct value. Also the function uses the correct value, so it seems like there’s a problem between the debugger and the emulator.

Ben