|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Abstract single-allocation owning byte buffer. More...
#include <Vector.hpp>
Public Member Functions | |
| DeviceHostSingleAllocationBase ()=default | |
| virtual | ~DeviceHostSingleAllocationBase () |
| virtual void | allocate (size_t bytes, DeviceBackend B=DeviceBackend::Unknown)=0 |
Allocate bytes on backend B (or on the host when Unknown). | |
| virtual void | free ()=0 |
| Release the allocation. | |
| virtual uint8_t * | get ()=0 |
| Typed byte pointer to the current allocation. | |
| virtual size_t | bytes () const =0 |
| Allocation size in bytes. | |
| virtual DeviceBackend | device ()=0 |
| Which backend currently owns the allocation. | |
| virtual void | copy_from_host (uint8_t *host_src, size_t n)=0 |
Copy n bytes from host_src into this allocation. | |
| virtual void | copy_to_host (uint8_t *host_dst, size_t n)=0 |
Copy n bytes from this allocation into host_dst. | |
| virtual std::unique_ptr< DeviceHostSingleAllocationBase > | clone ()=0 |
| Deep copy; returns a new allocation containing the same bytes. | |
Abstract single-allocation owning byte buffer.
A cross-backend "uniquely owned chunk of memory" interface: either a plain std::vector<uint8_t> on the host, or a backend-specific DeviceStorage on a device. Used as the storage primitive for #host_device_vector_r1.
Definition at line 24 of file Vector.hpp.
|
default |
|
virtual |
Definition at line 5 of file Vector.cpp.
|
pure virtual |
Allocate bytes on backend B (or on the host when Unknown).
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Allocation size in bytes.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Deep copy; returns a new allocation containing the same bytes.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Copy n bytes from host_src into this allocation.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Copy n bytes from this allocation into host_dst.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Which backend currently owns the allocation.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Release the allocation.
Implemented in DNDS::DeviceHostSingleAllocationDirect.
|
pure virtual |
Typed byte pointer to the current allocation.
Implemented in DNDS::DeviceHostSingleAllocationDirect.