Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Implement decent kernel exceptions #67

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

jpsamaroo
Copy link
Member

@jpsamaroo jpsamaroo commented Jun 1, 2020

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:

  • Pass some exception info through ring buffer
  • Remove need for @rocprint calls to fix kernels with exceptions
  • Test execution control intrinsics
  • Test memcpy/memset intrinsics
  • Implement and test free for 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)
  • De-duplicate exceptions per-kernel
  • 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

Added simple hostcall for malloc, and test
Added execution control intrinsics
Expanded ROCModule to contain exception ring buffer
Added HSAStatusSignal for exception handling
Implement working malloc and free
Added memcpy! and memset! intrinsics
Added more efficient memcpy! implementation for output
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant