Generalize `adapt` to allow specifying the storage mode but not the element type and/or number of dimensions
Open
arrays
good first issue
- Dominant language
- Julia
- Stars
- 463
- Forks
- 68
- Avg merge
- 1d 19m
- Merged PRs (30d)
- 32
Description
For example:
```julia
julia> using Metal
julia> using Adapt
julia> adapt(MtlArray{Float32,<:Any,Managed}, randn(2, 2))
2×2 MtlMatrix{Float32, Private}:
0.527836 0.597629
-0.225364 0.211664
julia> adapt(MtlArray{<:Any,<:Any,Managed}, randn(Float32, 2, 2))
2×2 Matrix{Float32}:
-0.933958 0.784281
-1.37475 0.566195
julia> using Pkg
julia> Pkg.status(["Metal", "Adapt"])
Status `.../Project.toml`
[79e6a3ab] Adapt v4.0.4
[dde4c033] Metal v1.1.0
```
I think there is the same issue in other GPU backends.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.