KernelAbstractions.jl icon indicating copy to clipboard operation
KernelAbstractions.jl copied to clipboard

Document/Decide on `adapt(Backend, ...)` API

Open vchuravy opened this issue 1 year ago • 0 comments

In https://github.com/JuliaGPU/KernelAbstractions.jl/pull/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 https://github.com/JuliaGPU/KernelAbstractions.jl/pull/353 and #297

As noted by @maleadt I didn't document it and it is a rather unofficial API that has lead users astray https://github.com/JuliaGPU/CUDA.jl/issues/2459#issuecomment-2270809520

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

vchuravy avatar Aug 07 '24 08:08 vchuravy