|
| | DualUnifiedBuffer () |
| | Default constructor of an empty buffer.
|
| | DualUnifiedBuffer (size_t size, size_t capacity) |
| | Constructor that specifies both the size and capacity.
|
| | DualUnifiedBuffer (size_t size) |
| | Similar to the constructor above except the size and capacity are equal, so no future growth is supported.
|
| | DualUnifiedBuffer (uint64_t size, uint64_t capacity, int device, cudaStream_t stream=0) |
| | Constructor that specifies the size, capacity, and device (for prefetching)
|
| | DualUnifiedBuffer (uint64_t size, int device, cudaStream_t stream=0) |
| | Constructor with a specified device.
|
| | DualUnifiedBuffer (const DualUnifiedBuffer &)=delete |
| | Disallow copy-construction.
|
| | DualUnifiedBuffer (DualUnifiedBuffer &&other) noexcept |
| | Move copy-constructor.
|
| | ~DualUnifiedBuffer () |
| | Destructor.
|
| void | clear () |
| | Free all memory and reset this instance to empty.
|
| DualUnifiedBuffer & | operator= (const DualUnifiedBuffer &)=delete |
| | Disallow copy assignment operation.
|
| DualUnifiedBuffer & | operator= (DualUnifiedBuffer &&other) |
| | Allow move assignment operation.
|
| void | init (size_t size, size_t capacity) |
| | initialize buffer as a new with the specified size and capacity
|
| void | resize (size_t size, int dev=cudaCpuDeviceId, std::initializer_list< cudaMemoryAdvise > list={cudaMemAdviseSetPreferredLocation}) |
| | Resize the memory block managed by this buffer. If the current capacity is larger than the new size this method simply redefines size. Otherwise a new page-table is defined, with the specified advice, and the old block is copied to the new block.
|
| void | advise (ptrdiff_t byteOffset, size_t size, int dev, cudaMemoryAdvise adv) const |
| | Apply a single advise to a memory block.
|
| void | advise (ptrdiff_t byteOffset, size_t size, int dev, std::initializer_list< cudaMemoryAdvise > list) const |
| | Apply a list of advices to a memory block.
|
| void | prefetch (ptrdiff_t byteOffset=0, size_t size=0, int dev=cudaCpuDeviceId, cudaStream_t stream=cudaStreamPerThread) const |
| | Prefetches data to the specified device, i.e. ensure the device has an up-to-date copy of the memory specified.
|
| void | deviceUpload (int device=0, cudaStream_t stream=cudaStreamPerThread, bool sync=false) const |
| | Prefetches all data to the specified device.
|
| void | deviceUpload (int device, void *stream, bool sync) const |
| void | deviceUpload (void *stream, bool sync) const |
| | Prefetches all data to the current device, as given by cudaGetDevice.
|
| void | deviceDownload (cudaStream_t stream=0, bool sync=false) const |
| | Prefetches all data to the host.
|
| void | deviceDownload (void *stream, bool sync) const |
| | Legacy.
|
| void | deviceDownload (int dummmy, void *stream, bool sync) const |
| void * | data () const |
| | Returns a raw pointer to the unified memory managed by this instance.
|
| template<typename T> |
| T * | data (ptrdiff_t count=0) const |
| | Returns an offset pointer of a specific type from the allocated unified memory.
|
| void * | data (ptrdiff_t byteOffset) const |
| | Returns a byte offset void pointer from the unified memory.
|
| void * | deviceData () const |
| | Legacy.
|
| void * | deviceData (int) const |
| size_t | size () const |
| | Size of the allocated pages in this instance.
|
| size_t | capacity () const |
| | Capacity of this instance, i.e. room in page table.
|
| bool | empty () const |
| | Returns true if this allocator is empty, i.e. has no allocated memory.
|
| bool | isEmpty () const |
|
| static DualUnifiedBuffer | create (size_t size, const DualUnifiedBuffer *reference, int device, cudaStream_t stream) |
| | Legacy factory method that mirrors DeviceBuffer. It creates a DualUnifiedBuffer from a size and a reference buffer. If a reference buffer is provided and its non-empty, it is used to defined the capacity of the new buffer.
|
| static DualUnifiedBuffer | create (size_t size, const DualUnifiedBuffer *reference) |
| | Factory method that created a buffer on the host of the specified size. If the reference buffer has a capacity it is used. Also the buffer is prefetched to the host.
|
| static DualUnifiedBuffer | create (size_t size, const DualUnifiedBuffer *reference, bool host, void *stream=nullptr) |
| | Factory method that created a buffer on the host or device of the specified size. If the reference buffer has a capacity it is used. Also the buffer is prefetched to the host or (current) device.
|
| static DualUnifiedBuffer | create (size_t size, size_t capacity) |
| | Factory methods that create an DualUnifiedBuffer instance and returns it with move semantics.
|
| static DualUnifiedBuffer | create (size_t size) |
| | Factory methods that create an DualUnifiedBuffer instance and returns it with move semantics.
|
| static PtrT | createPtr (size_t size, size_t capacity) |
| | Factory methods that create a shared pointer to an DualUnifiedBuffer instance.
|
| static PtrT | createPtr (size_t size) |
| | Factory methods that create a shared pointer to an DualUnifiedBuffer instance.
|
buffer, used for instance by the GridHandle, to allocate unified memory that can be resized and shared between multiple devices and the host.
- Note
- This is the implementation behind the deprecated UnifiedBuffer alias below, renamed so the [[deprecated]] attribute reaches only code that spells the public name: DistributedPointsToGrid's signature defaults reference this implementation, so default-using callers stay warning-free until the defaults change at removal. The Dual prefix marks the deprecated dual-accessor buffer family (this buffer satisfies that concept from a single managed allocation). Transitional – do not adopt this name; it is deleted together with the alias. The header keeps its long-standing name and include path for the same reason: renaming a header breaks existing includes outright, and the old path is where external code will find the alias and its migration message.