Goes inside if loop in kernel even if condition is not satisfied

I m facing this problem in CUDA kernel function that even if the condition is not satisfied the flow is going inside the if loop.

Can anyone provide a solution for this?

–edited –

double post… .

Without the code, what kind of solution do you expect?

It is difficult to solve a problem that is like thin air… You need to give more details

Sorry for that.Here is a piece of code.

The value of c_delta = 0.000 and r_delta = -1.#QNAN00,still flow goes inside the if loop below(but the if condition is not satisfied)

20 if (c_delta == 0.0 && r_delta == 0.0)
21 {
23 RGBA32 * temp = &((RGBA32*)abc_image->booster[srow])[scol];
24 (*output).a = temp->a;
25 (*output).r = temp->r;
26 (*output).g = temp->g;
27 (*output).b = temp->b;

Why are you working with NANs?? I hope you know NAN stands for “Not a Number”.

Compile your code with nvcc and put the --keep flag on there. Then go into the PTX code and find the section that corresponds to that C code you posted, and post it up here. That will give us a little better picture of how the compiler is trying to handle the NAN value.