Thrust
|
device_ptr
is a pointer-like object which points to an object that resides in memory associated with the device system.
More...
#include <thrust/device_ptr.h>
Public Member Functions | |
__host__ __device__ | device_ptr () |
Construct a null device_ptr . More... | |
__host__ __device__ | device_ptr (std::nullptr_t) |
Construct a null device_ptr . More... | |
template<typename U > | |
__host__ __device__ | device_ptr (U *ptr) |
Construct a device_ptr from a raw pointer which is convertible to T* . More... | |
template<typename U > | |
__host__ __device__ | device_ptr (device_ptr< U > const &other) |
Copy construct a device_ptr from another device_ptr whose pointer type is convertible to T* . More... | |
template<typename U > | |
__host__ __device__ device_ptr & | operator= (device_ptr< U > const &other) |
Set this device_ptr to point to the same object as another device_ptr whose pointer type is convertible to T* . More... | |
__host__ __device__ device_ptr & | operator= (std::nullptr_t) |
Set this device_ptr to null. More... | |
__host__ __device__ T * | get () const |
Return the raw pointer that this device_ptr points to. | |
device_ptr
is a pointer-like object which points to an object that resides in memory associated with the device system.
device_ptr
has pointer semantics: it may be dereferenced safely from anywhere, including the host, and may be manipulated with pointer arithmetic.
device_ptr
can be created with device_new, device_malloc, device_malloc_allocator, device_allocator, or device_pointer_cast, or by explicitly calling its constructor with a raw pointer.
The raw pointer contained in a device_ptr
may be obtained via get
member function or the raw_pointer_cast free function.
Algorithms operating on device_ptr
types will automatically be dispatched to the device system.
device_ptr
is not a smart pointer; it is the programmer's responsibility to deallocate memory pointed to by device_ptr
.