JuliaGPU / JuliaGPU/GPUArrays.jl

Better support in StructArrays

Open
#518 0 comments 1 reaction 0 assignees View on GitHub
good first issue
Dominant language
Julia
Stars
450
Forks
104
Avg merge
1d 4h
Merged PRs (30d)
10

Description

Functions like `map` work on GPU arrays directly, but not on StructArrays-of-GPUArrays:
```julia
using Metal

A = StructArray(a=MtlArray(rand(Float32, 10^3)), b=MtlArray(rand(Int8, 10^3)))

map(exp, A.a) # works

map(x -> exp(x.a), A) # throws "Scalar indexing is disallowed" because `map` falls back to iteration
```
Would be great to make it work! How do you think could be implemented?
I'm not very experienced with GPU arrays and their inner workings.

Ref https://github.com/JuliaArrays/StructArrays.jl/issues/300

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining the GPUArrays behavior for map and the StructArrays.jl issue referenced in the report. Reproduce the Julia example with StructArrays containing MtlArrays, then determine what support is needed so mapping over the struct array avoids scalar indexing and matches mapping over its GPU array fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
hpc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.