Skip to content

Commit

Permalink
Inline Base.throw_boundserror quirk
Browse files Browse the repository at this point in the history
This avoid capturing `MArray`s in `BoundsError` to allow bounds checking
of `MArray`s on device in more cases. This is a workaround to address
<JuliaGPU#2313>.
  • Loading branch information
lcw committed Apr 5, 2024
1 parent 7f725c0 commit ea9331c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/device/quirks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ end
@print_and_throw "Inexact conversion"

# abstractarray.jl
@device_override @noinline Base.throw_boundserror(A, I) =
@noinline throw_boundserror() =
@print_and_throw "Out-of-bounds array access"
@device_override @inline Base.throw_boundserror(A, I) = throw_boundserror()

# trig.jl
@device_override @noinline Base.Math.sincos_domain_error(x) =
Expand Down

0 comments on commit ea9331c

Please sign in to comment.