diff options
Diffstat (limited to 'src/kernel.cu')
-rw-r--r-- | src/kernel.cu | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kernel.cu b/src/kernel.cu index cc567b8..307412e 100644 --- a/src/kernel.cu +++ b/src/kernel.cu @@ -345,6 +345,13 @@ __global__ void propagate(int first_photon, int nthreads, int command; + // check for NaN and fail + if (isnan(p.direction.x*p.direction.y*p.direction.z*p.position.x*p.position.y*p.position.z)) + { + p.history |= NO_HIT | NAN_ABORT; + break; + } + fill_state(s, p); if (p.last_hit_triangle == -1) |