Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid capturing AbstractArrays in BoundsError #2314

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

lcw
Copy link
Contributor

@lcw lcw commented Apr 3, 2024

This quirk allows bounds checking of MArrays on device in more cases. This is a workaround to address #2313.

lcw added a commit to HorribleSanity/Raven.jl that referenced this pull request Apr 3, 2024
This quirk allows bounds checking of `MArray`s on device in more cases.
This is a workaround to address
<JuliaGPU/CUDA.jl#2313>.

This change was proposed upstream here
   <JuliaGPU/CUDA.jl#2314>
and is no longer needed if accepted upstream.
Copy link
Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

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

Could you instead change

@device_override @noinline Base.throw_boundserror(A, I) =

to be @inline and move the error report to a second function?

@lcw
Copy link
Contributor Author

lcw commented Apr 5, 2024

Could you instead change

@device_override @noinline Base.throw_boundserror(A, I) =

to be @inline and move the error report to a second function?

Is this what you are thinking? Feel free to tweek it.

@vchuravy
Copy link
Member

vchuravy commented Apr 5, 2024

@maleadt are you okay with that extra call frame?

And should we add the Static array test case?

@maleadt
Copy link
Member

maleadt commented Apr 5, 2024

@maleadt are you okay with that extra call frame?

Sure. I would just call it throw_boundserror though, the printing is a bit of an implementation detail.

And should we add the Static array test case?

I don't think so, because I hope we can get it working under --check-bounds=auto (and the tests shouldn't require --check-bounds=yes to pass, as I occasionally execute them outside of Pkg).

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>.
@vchuravy vchuravy changed the title Avoid capturing MArrays in BoundsError Avoid capturing AbstractArrays in BoundsError Apr 10, 2024
@vchuravy vchuravy merged commit 5da4d1d into JuliaGPU:master Apr 10, 2024
1 check passed
lcw added a commit to HorribleSanity/Raven.jl that referenced this pull request Apr 19, 2024
This quirk allows bounds checking of `MArray`s on device in more cases.
This is a workaround to address
<JuliaGPU/CUDA.jl#2313>.

This change was proposed upstream here
   <JuliaGPU/CUDA.jl#2314>
and is no longer needed if accepted upstream.
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.

3 participants