Template Numerical Library version\ main:4e58ea6
|
Cross-device unique smart pointer. More...
#include <TNL/Pointers/UniquePointer.h>
Cross-device unique smart pointer.
This smart pointer is inspired by std::unique_ptr from STL library. It means that the object owned by the smart pointer is accessible only through this smart pointer. One cannot make any copy of this smart pointer. In addition, the smart pointer is able to work across different devices which means that the object owned by the smart pointer is mirrored on both host and device.
**NOTE: When using smart pointers to pass objects on GPU, one must call Pointers::synchronizeSmartPointersOnDevice< Devices::Cuda >() before calling a CUDA kernel working with smart pointers.**
Object | is a type of object to be owned by the pointer. |
Device | is device where the object is to be allocated. The object is always allocated on the host system as well for easier object manipulation. |
See also SharedPointer and DevicePointer.
See also UniquePointer< Object, Devices::Host > and UniquePointer< Object, Devices::Cuda >.