Skip to content

Commit

Permalink
Inline Base.throw_boundserror quirk (#2314)
Browse files Browse the repository at this point in the history
This avoid capturing `Array`s in `BoundsError`. This avoids requiring a device allocation for MArray due to bounds-checking.
  • Loading branch information
lcw authored Apr 10, 2024
1 parent 1e5f0d6 commit 5da4d1d
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

6 comments on commit 5da4d1d

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/104789

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v5.3.0 -m "<description of version>" 5da4d1d0355432758b3a50c0fed1a365d8f5e403
git push origin v5.3.0

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir="lib/cutensor"

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/104797

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a cutensor-v2.1.0 -m "<description of version>" 5da4d1d0355432758b3a50c0fed1a365d8f5e403
git push origin cutensor-v2.1.0

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register subdir="lib/cudnn"

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/104798

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a cudnn-v1.3.1 -m "<description of version>" 5da4d1d0355432758b3a50c0fed1a365d8f5e403
git push origin cudnn-v1.3.1

Please sign in to comment.