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

Supporting map on GPU #300

Open
aplavin opened this issue Feb 9, 2024 · 0 comments · May be fixed by #305
Open

Supporting map on GPU #300

aplavin opened this issue Feb 9, 2024 · 0 comments · May be fixed by #305

Comments

@aplavin
Copy link
Member

aplavin commented Feb 9, 2024

StructArrays components can be GPU arrays, but many operations on them are not supported yet. For example, a simple map:

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.

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

Successfully merging a pull request may close this issue.

1 participant