-
Notifications
You must be signed in to change notification settings - Fork 79
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
Vectorized getindex ignores @inbounds
#542
Comments
Top-level julia> struct Foo end
julia> Base.getindex(::Foo, Is...) = (@boundscheck(error("checking bounds")); 42)
julia> x = Foo()
Foo()
julia> x[1]
ERROR: checking bounds
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] getindex(::Foo, Is::Int64)
@ Main ./REPL[29]:1
[3] top-level scope
@ REPL[31]:1
julia> @inbounds x[1]
ERROR: checking bounds
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] getindex(::Foo, Is::Int64)
@ Main ./REPL[29]:1
[3] top-level scope
@ REPL[32]:1
julia> bar(x) = @inbounds x[1]
bar (generic function with 1 method)
julia> bar(x)
42 There does still seems to be something wrong with the vectorized getindex though. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thus performing device-to-host copy during boundscheck.
The text was updated successfully, but these errors were encountered: