A follow up to: [CUDA: Stop all other threads](https://stackoverflow.com/questions/3735786/cuda-stop-all-other-threads)

I'm looking for a way to exit a kernel if a "bad condition" occurs.
The prog manual say NVCC does not support exception handling. I'm wondering if there is a user defined cuda-error-code. In other words if "bad" happens, then terminate with this user error code. I doubt there is one, so my other idea would be to cause one.

Something like, if "bad" happens, divide by zero. But I'm unsure if one thread does a divide-by-zero, is that enough to crash the whole kernel, or just that thread?

Is there a better approach to terminating a kernel?