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

Indexing oneArrays with a oneArray{Bool} fails for Julia 1.11 #473

Open
pvillacorta opened this issue Oct 9, 2024 · 2 comments
Open

Indexing oneArrays with a oneArray{Bool} fails for Julia 1.11 #473

pvillacorta opened this issue Oct 9, 2024 · 2 comments

Comments

@pvillacorta
Copy link

pvillacorta commented Oct 9, 2024

In 1.10:

julia> a = oneArray([1., 2., 3.])
3-element oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer}:
 1.0
 2.0
 3.0

julia> a .> 1
3-element oneArray{Bool, 1, oneAPI.oneL0.DeviceBuffer}:
 0
 1
 1

julia> a[a .> 1]
2-element oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer}:
 2.0
 3.0

In 1.11:

julia> a = oneArray([1., 2., 3.])
3-element oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer}:
 1.0
 2.0
 3.0

julia> a .> 1
3-element oneArray{Bool, 1, oneAPI.oneL0.DeviceBuffer}:
 0
 1
 1

julia> a[a .> 1]
ERROR: BoundsError: attempt to access 3-element oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer} at index [3-element oneArray{Bool, 1, oneAPI.oneL0.DeviceBuffer}]
Stacktrace:
 [1] throw_boundserror(A::oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer}, I::Tuple{Base.LogicalIndex{Int64, oneArray{…}}})
   @ Base ./essentials.jl:14
 [2] checkbounds
   @ ./abstractarray.jl:699 [inlined]
 [3] vectorized_getindex!
   @ ~/.julia/packages/GPUArrays/qt4ax/src/host/indexing.jl:73 [inlined]
 [4] vectorized_getindex
   @ ~/.julia/packages/GPUArrays/qt4ax/src/host/indexing.jl:82 [inlined]
 [5] _getindex
   @ ~/.julia/packages/GPUArrays/qt4ax/src/host/indexing.jl:21 [inlined]
 [6] getindex(A::oneArray{Float64, 1, oneAPI.oneL0.DeviceBuffer}, Is::oneArray{Bool, 1, oneAPI.oneL0.DeviceBuffer})
   @ GPUArrays ~/.julia/packages/GPUArrays/qt4ax/src/host/indexing.jl:17
 [7] top-level scope
   @ REPL[5]:1

For both julia versions, I am using oneAPI v1.6.1
Thank you!

@cncastillo
Copy link

I think this might be the same problem as in this issue:

@pvillacorta
Copy link
Author

@cncastillo I think that it is not exactly the same problem, as #461 happened before v1.11.

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

No branches or pull requests

2 participants