Skip to content

Pass the exception type separately to @gputhrow - #1098

Merged
maleadt merged 1 commit into
tb/dead-quirksfrom
tb/gputhrow
Sep 23, 2026
Merged

maleadt merged 1 commit into
tb/dead-quirksfrom
tb/gputhrow

Conversation

@maleadt

@maleadt maleadt commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

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, @gpu_throw "Type: reason" becomes @gputhrow "Type" "reason", with the error code now derived from the type name instead of a prefix of the message. The reason is still dropped, as AMDGPU.jl's exception info only holds an 8-bit error code; I checked that every call site maps to the same code as before.

Based on #1097: after merging that one, delete its branch (this repository doesn't do so automatically) so that GitHub retargets this PR to main.

Take the name of the exception type and the reason as separate
arguments, like CUDA.jl, Metal.jl and OpenCL.jl do, instead of deriving
the error code from a prefix of the message. This makes the quirks the
same across back-ends, apart from how the exception is reported, which
prepares for sharing them.
@maleadt
maleadt merged commit bb633bb into tb/dead-quirks Sep 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants