-
Notifications
You must be signed in to change notification settings - Fork 24
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
Move GPUArrays.backend
here
#50
Conversation
This function is the last piece we need to enable gpu broadcast for `StructArray`.
Adapt is a generic package, moving GPUArrays-specific functionality here isn't its purpose. There's no reason |
Sorry for the noise. I thought |
Is GPUArrays.jl that heavy of a dependency? It doesn't depend on much, and doesn't load much code. |
I didn't test it. function GPUArrays.backend(x::StructArray)
cs = components(x)
back = GPUArrays.backend(cs[1])
for i in 2:length(cs)
back === Adapt.backend(cs[i]) || error("backend mismatch!")
end
back
end So it seems good to not add more dependency. @piever |
So, I think GPUArrays is not particularly heavy, but it's also true that StructArrays is one of those low-level, low-dependency packages that should ideally depend on very little (in an ideal scenario, it should have no dependencies at all IMO). The main goal, IIUC, is to have
I suggested to move EDIT: an alternative option would be to use the broadcast style rather than the array type to infer the backend in |
This function is the last piece we need to enable gpu broadcast for
StructArray
.Move it here as
Adapt
is more lightweight.