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
endSo 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
Adaptis more lightweight.