It is not possible either std::vector
or thrust::vector
in CUDA kernel code. Thrust is a host side abstraction for GPU arrays and algorithms which cannot be used inside CUDA kernels.
You should rethink approach. push_back
style appending of data is an fundamentally serial operation which requires some sort of locking or atomic operation in data parallel execution models. This almost always has negative performance impact on GPU code.