AMDGPUnative.jl
AMDGPUnative.jl copied to clipboard
Implement decent kernel exceptions
Currently, Julia exceptions trigger an s_trap 2, which causes the wait handler to hang, and doesn't communicate any useful information about what caused the exception. This PR replaces that mechanism with a similar mechanism to the one CUDAnative uses, but with the goal to provide proper per-kernel exceptions (as opposed to throwing the exception at the next API call).
Todo:
- [x] Pass some exception info through ring buffer
- [x] Remove need for
@rocprintcalls to fix kernels with exceptions - [x] Test execution control intrinsics
- [x] Test memcpy/memset intrinsics
- [x] Implement and test
freefor malloc'd data - [ ] ~Actually make the ring buffer a ring buffer (currently it's a list)~
- [ ] Protect against data races (atomic load/store the kernel ID in
ExceptionEntry) - [x] De-duplicate exceptions per-kernel
- [x] Don't overallocate the copy buffer for passing exceptions
- [ ] Clean-up
malloc'd data when the kernel exits by default - [ ] Document it all!
- [ ] Test that multi-wavefront kernels error properly