thrust

◆ device_new() [1/3]

template<typename T >
device_ptr<T> thrust::device_new ( device_ptr< void >  p,
const size_t  n = 1 
)

device_new implements the placement new operator for types resident in device memory. device_new calls T's null constructor on a array of objects in device memory. No memory is allocated by this function.

Parameters
pA device_ptr to a region of device memory into which to construct one or many Ts.
nThe number of objects to construct at p.
Returns
p, casted to T's type.
See also
device_ptr