Hi,
I have built a custom error object that I populate device side with an error message, filename, line number etc when an error is detected in a kernel routine. The idea being that this can be inspected later from host to provide clear error reporting to the user.
However, I find that if I try to abort the kernel via something like:
__threadfence();
asm(“trap;”);
or something less graceful like:
__threadfence();
int hats = (int)0xffffffff;
*hats = 12;
then any memory I allocated on the device is destroyed / invalid pointers when I am back to host. Is there a way to abort the kernel without this happening, or should I not try to abort and instead have some global flag telling other threads to finish up and return asap?
Many thanks