GPUArrays.jl
GPUArrays.jl copied to clipboard
move `backend` to `GPUArraysCore.jl`
Second take of https://github.com/JuliaGPU/Adapt.jl/pull/50.
This PR wants to move backend to GPUArraysCore.jl, which would help us to implement broadcast for StructArray on gpu. (see https://github.com/JuliaArrays/StructArrays.jl/pull/215)
I hope it's also useful for other arraywrappers.
(I only bump GPUArraysCore's version as we haven't registered a new GPUArrays.)
I'm not sure about this, backend wasn't really intended as a public API. Would something like https://github.com/JuliaGPU/Adapt.jl/pull/52 work as well, using functionality from Adapt.jl (which I assume is lightweight enough)? On the other hand, if you don't need the recursive behavior (to figure out the back-end of a nested GPUArray) maybe GPUArrays.backend is sufficient.
@maleadt I'm assuming we don't want to export backend from GPUArrays.jl?
We have @reexport using GPUArraysCore, so exporting GPUArraysCore.backend would also export backend from GPUArrays.
I think we'd better revert [0137d18] as otherwise there seems no advantage to use Reexport. (@reexport dont support something like @reexport using A except backend,)
@maleadt I'm assuming we don't want to export
backendfromGPUArrays.jl? We have@reexport using GPUArraysCore, so exportingGPUArraysCore.backendwould also exportbackendfromGPUArrays.
Oh, no, we don't want that indeed, good catch.
Why did you change the JLArrays compat here? Adding a ~ doesn't relax but tighten the requirements, right?
Oh yes. I must misread the Pkg document.