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

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.