new function

Is there an equivalent to the new function in CUDA? I am importing a piece of code to CUDA and some of the code is used inside the device. Here is a line of the code that I would like to run in the device.

template<class T>

class vec {

    T*  data;

    int sz;

    int cap;




__device__ void     push  (const T& elem)     { if (sz == cap) grow(sz+1); new (&data[sz]) T(elem); sz++; }

Thanks in advance…

No, you have to allocate all memory before starting your kernel.