# How to append elements to a CuArray or delete some entries from it in GPU kernel function

**URL:** <https://discourse.julialang.org/t/how-to-append-elements-to-a-cuarray-or-delete-some-entries-from-it-in-gpu-kernel-function/77180>\
**Category:** General Usage\
**Tags:** question, gpu, cuda, atomic\
**Created:** [February 28, 2022, 11:43am UTC](https://discourse.julialang.org/t/how-to-append-elements-to-a-cuarray-or-delete-some-entries-from-it-in-gpu-kernel-function/77180 "2022-02-28T11:43:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mari](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mari](https://discourse.julialang.org/u/Mari)\
**Post date:** [February 28, 2022, 11:43am UTC](https://discourse.julialang.org/t/how-to-append-elements-to-a-cuarray-or-delete-some-entries-from-it-in-gpu-kernel-function/77180/1 "2022-02-28T11:43:57Z")

</div>

Hi everyone,

I am looking for a way to be able to efficiently append or delete some entries of a CuArray in the kernels being run on GPU . Also I guess that “append” and “delete” must be perfumed atomically. I am rather new to GPU programming and I wasn’t to figure this out from the documentation, so I would appreciate if anyone knows how to do this.

Thanks

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [March 2, 2022, 10:26am UTC](https://discourse.julialang.org/t/how-to-append-elements-to-a-cuarray-or-delete-some-entries-from-it-in-gpu-kernel-function/77180/2 "2022-03-02T10:26:49Z")

</div>

> [@Mari](#):
>
> I am looking for a way to be able to efficiently append or delete some entries of a CuArray in the kernels being run on GPU

That’s not supported, and would be hard to implement efficiently given how GPUs execute.  
If you need to do this, allocate an oversized buffer and a cursor which you increment atomically.
