Pass the exception type to @gputhrow - #639
Merged
Merged
Conversation
Replace `@print_and_throw reason` by `@gputhrow name reason`, which takes the name of the exception type separately, like CUDA.jl, Metal.jl and OpenCL.jl do, and includes it in the printed message. This makes the quirks the same across back-ends, apart from how the exception is reported, which prepares for sharing them.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## tb/dead-quirks #639 +/- ##
==================================================
- Coverage 81.66% 81.64% -0.03%
==================================================
Files 50 50
Lines 3606 3607 +1
==================================================
Hits 2945 2945
- Misses 661 662 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is preparation for sharing the exception quirks (Base methods that are overridden so that exceptions don't box their arguments) across back-ends. Those are nearly identical across CUDA.jl, AMDGPU.jl, Metal.jl, OpenCL.jl, oneAPI.jl and KernelAbstractions' POCL back-end, except for the macro that throws: CUDA.jl, Metal.jl and OpenCL.jl use
@gputhrow name reason, taking the name of the exception type and a reason.Here,
@print_and_throw reasonbecomes@gputhrow name reason, which also includes the exception type in the printed message, e.g.ERROR: BoundsError: Out-of-bounds array access.(I dropped the period from thesincosreason, which was printed twice.) Checked on macOS by compiling a kernel through GPUCompiler and inspecting the messages in the IR.Based on #638; GitHub will retarget this PR to
mainonce that one is merged.