Skip to content

Document/Decide on adapt(Backend, ...) API #501

Open
@vchuravy

Description

@vchuravy

In #364 I added adapt(backend, x) as a natural extension for adapt, instead of having to use something like adapt(default_array_type(backend), x) which we don't currently have.

This was inspired by #353 and #297

As noted by @maleadt I didn't document it and it is a rather unofficial API that has lead users astray JuliaGPU/CUDA.jl#2459 (comment)

Ideally it would simply be adapt(::CUDABackend, x) = adapt(CuArray, x). I am not sure why I didn't use that definition before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions