Skip to content

Pass the exception type to @gputhrow - #639

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, @print_and_throw reason becomes @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 the sincos reason, 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 main once that one is merged.

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

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.64%. Comparing base (4c34a0a) to head (2f7bdf5).
⚠️ Report is 1 commits behind head on tb/dead-quirks.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt merged commit 9faa426 into tb/dead-quirks Sep 23, 2026
5 checks passed
@maleadt
maleadt deleted the tb/gputhrow branch September 23, 2026 14:12
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.

1 participant