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

Better support in StructArrays #518

Open
aplavin opened this issue Feb 23, 2024 · 0 comments
Open

Better support in StructArrays #518

aplavin opened this issue Feb 23, 2024 · 0 comments

Comments

@aplavin
Copy link

aplavin commented Feb 23, 2024

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

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 JuliaArrays/StructArrays.jl#300

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

1 participant