|
__HOST__ __DEVICE__ __CONSTEXPR__ | unique_ptr () __NOEXCEPT__ |
|
__HOST__ __DEVICE__ | unique_ptr (T *ptr) __NOEXCEPT__ |
|
__HOST__ __DEVICE__ | unique_ptr (T *ptr, Deleter deleter) __NOEXCEPT__ |
|
__HOST__ __DEVICE__ | ~unique_ptr () |
|
__HOST__ __DEVICE__ pointer | release () __NOEXCEPT__ |
|
__HOST__ __DEVICE__ void | reset (pointer ptr=pointer()) __NOEXCEPT__ |
|
__HOST__ __DEVICE__ void | swap (unique_ptr &other) __NOEXCEPT__ |
|
__HOST__ __DEVICE__ pointer | get () const |
|
__HOST__ __DEVICE__ deleter_type & | get_deleter () |
|
__HOST__ __DEVICE__ const
deleter_type & | get_deleter () const |
|
__HOST__ __DEVICE__ | operator bool () const |
|
__DEVICE__
ecuda::add_lvalue_reference< T >
::type | operator* () const __NOEXCEPT__ |
|
__HOST__ __DEVICE__ pointer | operator-> () const __NOEXCEPT__ |
|
__DEVICE__
ecuda::add_lvalue_reference< T >
::type | operator[] (std::size_t i) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator== (const unique_ptr< T2, D2 > &other) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator!= (const unique_ptr< T2, D2 > &other) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator< (const unique_ptr< T2, D2 > &other) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator> (const unique_ptr< T2, D2 > &other) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator<= (const unique_ptr< T2, D2 > &other) const |
|
template<typename T2 , class D2 > |
__HOST__ __DEVICE__ bool | operator>= (const unique_ptr< T2, D2 > &other) const |
|
template<typename T, class Deleter = default_device_delete<T>>
class ecuda::unique_ptr< T, Deleter >
A smart pointer that retains sole ownership of an object.
ecuda::unique_ptr is a smart pointer that retains sole ownership of a device object through a pointer and destroys that object when the unique_ptr goes out of scope. No two unique_ptr instances can manage the same object.
The object is destroyed and its memory deallocated when either of the following happens:
The object is destroyed using a potentially user-supplied deleter by calling Deleter(ptr). The deleter calls the destructor of the object and dispenses the memory.
A unique_ptr may alternatively own no object, in which case it is called empty.
There is no separate specialization of unique_ptr for dynamically-allocated arrays of objects (i.e. T[]) since the underlying CUDA API makes no distinction between individual objects versus arrays in terms of memory allocation/deallocation.
The class satisfies the requirements of MoveConstructible and MoveAssignable, but not the requirements of either CopyConstructible or CopyAssignable.
Deleter must be Functionobject or lvalue_reference to a FunctionObject or lvalue reference to function, callable with an argument of type unique_ptr<T,Deleter>::pointer.
Definition at line 84 of file unique_ptr.hpp.