Skip to content

Commit 5da4d1d

Browse files
authored
Inline Base.throw_boundserror quirk (#2314)
This avoid capturing `Array`s in `BoundsError`. This avoids requiring a device allocation for MArray due to bounds-checking.
1 parent 1e5f0d6 commit 5da4d1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/device/quirks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ end
3737
@print_and_throw "Inexact conversion"
3838

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

4344
# trig.jl
4445
@device_override @noinline Base.Math.sincos_domain_error(x) =

0 commit comments

Comments
 (0)