Public Member Functions | List of all members
thrust::device_ptr< T > Class Template Reference

#include <thrust/device_ptr.h>

Inherits pointer< T, thrust::device_system_tag, thrust::device_reference< T >, thrust::device_ptr< T > >.

Public Member Functions

__host__ __device__ device_ptr ()
template<typename OtherT >
__host__ __device__ device_ptr (OtherT *ptr)
template<typename OtherT >
__host__ __device__ device_ptr (const device_ptr< OtherT > &other)
template<typename OtherT >
__host__ __device__ device_ptroperator= (const device_ptr< OtherT > &other)

Detailed Description

template<typename T>
class thrust::device_ptr< T >

device_ptr stores a pointer to an object allocated in device memory. This type provides type safety when dispatching standard algorithms on ranges resident in device memory.

device_ptr has pointer semantics: it may be dereferenced safely from the host and may be manipulated with pointer arithmetic.

device_ptr can be created with the functions device_malloc, device_new, or device_pointer_cast, or by explicitly calling its constructor with a raw pointer.

The raw pointer encapsulated by a device_ptr may be obtained by either its get method or the raw_pointer_cast free function.

device_ptr is not a smart pointer; it is the programmer's responsibility to deallocate memory pointed to by device_ptr.
See also

The documentation for this class was generated from the following files: