thrust::device_new#
Overloads#
device_new(p, n=1)#
-
template<typename T>
device_ptr<T> thrust::device_new( - device_ptr<void> p,
- const size_t n = 1,
device_newimplements the placementnewoperator for types resident in device memory.device_newcallsT’s null constructor on a array of objects in device memory. No memory is allocated by this function.See also
- Parameters:
p – A
device_ptrto a region of device memory into which to construct one or manyTs.n – The number of objects to construct at
p.
- Returns:
p, casted to
T’s type.
device_new(p, exemplar, n=1)#
-
template<typename T>
device_ptr<T> thrust::device_new( - device_ptr<void> p,
- const T &exemplar,
- const size_t n = 1,
device_newimplements the placement new operator for types resident in device memory.device_newcallsT’s copy constructor on a array of objects in device memory. No memory is allocated by this function.See also
See also
- Parameters:
p – A
device_ptrto a region of device memory into which to construct one or manyTs.exemplar – The value from which to copy.
n – The number of objects to construct at
p.
- Returns:
p, casted to
T’s type.
device_new(n=1)#
-
template<typename T>
device_ptr<T> thrust::device_new( - const size_t n = 1,
device_newimplements the new operator for types resident in device memory. It allocates device memory large enough to holdnnew objects of typeT.- Parameters:
n – The number of objects to allocate. Defaults to
1.- Returns:
A
device_ptrto the newly allocated region of device memory.