It’s not caused by conversion since I change all the variables together with the constants and there’s no conversion from integer to float/double. And I am sure it’s not because of the small difference made from functions like sin() or pow(). The wired thing is if I compile with the debug option (-G) or emulation mode, it gives correct result. It’s beyond my knowledge. Anyone can point me what kind of thing may cause this problem? Thx.
I am using CUDA 2.3 with driver 190.18 under Ubuntu 9.04 64bit. The card is a 295GTX.
I am wondering if it might be related to the bug found in the driver. It happened to me once that even cudaMalloc can’t run and reboot bring it back to normal.
F_dd[i]=F_dd[i]+Fn+Fs; gives 291.0 when using nvcc -G or float variables compare to 500.4 when using nvcc and double.
Although I can identify which part of the code goes wrong ( the above line), it’s very unlikely the line itself cause the problem since I’ve using it for a long time on CPU version.
F_dd is defined as:
VecR *F_dd
cudaMalloc((void *) &F_d,3(N+1)*sizeof(double));
and Fn Fs is also defined as VecR inside global function