JuliaGPU / JuliaGPU/oneAPI.jl

Indexing `oneArray`s with a `oneArray{Bool}` fails for Julia 1.11

Open
#473 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
215
Forks
37
Avg merge
10h 47m
Merged PRs (30d)
14

Description

In 1.10:
```julia-repl
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-repl
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!

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the indexing example with Julia 1.10 and 1.11 using oneAPI v1.6.1, then inspect the GPUArrays host indexing path shown in the stack trace, especially indexing.jl. Done means boolean oneArray indexing works on Julia 1.11 without the reported BoundsError and the existing Julia 1.10 behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
hpc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.