As an alternative to exceptions, which aren’t really supported in CUDA AFAIK, I’ve taken to putting in printf’s. Is there any real performance penalty to having printfs that aren’t executed (because they’re guarded by if tests that are intended to never return true) dabbled throughout my CUDA code?
I’m guessing the printfs could muck with the icache, but I’d be a bit surprised if there was a larger impact than that.
PS – I could implement passing around a set of flags, and checking those flags after the kernel finishes. But, I’m trying to avoid maintaining a rather large set of error codes at this point (in fact, I’ve had such a set in the past, but it’s more work than just putting in a printf).