I’m having a problem with the accuracy provided by cuCdiv.
My kernel is very simple:
__global__ void scaling_zero_padding(cufftDoubleComplex *data_d, cufftDoubleComplex *phi, cufftDoubleComplex *uk, int N)
{
int i = threadIdx.x + blockDim.x * blockIdx.x;
if(i<c*N)
{
if( (i<((c+1)*N/2)) && (i>=((c-1)*N/2)) ) uk[i] = make_cuDoubleComplex(0.,0.);
else uk[i] = cuCdiv(data_d[(i+N+N/2)%N],phi[(i+N+N/2)%N]);
}
}
The inputs have the same precision as a Matlab equivalent program. I have checked it by simply changing
uk[i] = cuCdiv(data_d[(i+N+N/2)%N],phi[(i+N+N/2)%N]);
to either
uk[i] = data_d[(i+N+N/2)%N];
or
uk[i] = phi[(i+N+N/2)%N];
However, the result of cuCdiv has always a precision of 5 digits only.
Am I doing anything wrong? Is this the normal accuracy of cuCdiv?