-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define append!
#533
Define append!
#533
Conversation
oneAPI.jl does not seem to have |
This seems like a good idea, but will need some work, e.g., making sure all back-ends actually do implement
Why not convert the Tuple to an Array in the |
I've addressed most comments in the latest commit:
In I can work on |
I started implementing |
This defines a generic version of
append!
forAbstractGPUVector
.It is similar to the definition for
Vector
inBase
:https://github.com/JuliaLang/julia/blob/6f6bb950b3e7b0a6e77bb11ffd7cc001cb87439d/base/array.jl#L1314-L1320
It relies on
resize!
andcopyto!
being defined for theAbstractGPUVector
being appended to, whileBase
relies onBase._growend!
andcopyto!
. Relying onresize!
seems reasonable, most of the GPU backends, for exampleCUDA.jl
,Metal.jl
, andAMDGPU.jl
, haveresize!
implemented. (EDIT: Support forresize!
inoneAPI.jl
was added in JuliaGPU/oneAPI.jl#436 but it still needs to be registered).For now it doesn't support appending with a
Tuple
of items (likeBase
allows forVector
) because it appears thatcopyto!
doesn't generally support that forAbstractGPUVector
s:EDIT: The current PR now supports for appending with a Tuple by collecting it into a Vector, though perhaps it should be collected onto the GPU where the vector that is being appended lives.