Skip to content

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

@pvillacorta

Description

@pvillacorta

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions