DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::DeviceStorageBase Class Referenceabstract

Abstract interface to a byte buffer owned by a specific backend. More...

#include <DeviceStorage.hpp>

Inheritance diagram for DNDS::DeviceStorageBase:
[legend]

Public Member Functions

virtual uint8_t * raw_ptr ()=0
 Raw byte pointer to the underlying storage.
 
virtual void copy_host_to_device (uint8_t *host_ptr, size_t n_bytes)=0
 Copy n_bytes from host_ptr into this device buffer.
 
virtual void copy_device_to_host (uint8_t *host_ptr, size_t n_bytes)=0
 Copy n_bytes from this device buffer into host_ptr.
 
virtual void copy_to_device (uint8_t *device_ptr_dst, size_t n_bytes)=0
 Device-to-device copy of n_bytes into device_ptr_dst.
 
virtual size_t bytes () const =0
 Buffer size in bytes.
 
virtual DeviceBackend backend () const =0
 Which backend the buffer lives on.
 
virtual ~DeviceStorageBase ()
 

Detailed Description

Abstract interface to a byte buffer owned by a specific backend.

All DNDS device memory ultimately goes through this interface so that the higher-level host_device_vector<T> can be backend-agnostic. Concrete backends provide specialised DeviceStorage implementations; creation funnels through #device_storage_factory.

Definition at line 105 of file DeviceStorage.hpp.

Constructor & Destructor Documentation

◆ ~DeviceStorageBase()

DNDS::DeviceStorageBase::~DeviceStorageBase ( )
virtualdefault

Member Function Documentation

◆ backend()

virtual DeviceBackend DNDS::DeviceStorageBase::backend ( ) const
pure virtual

Which backend the buffer lives on.

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.

◆ bytes()

virtual size_t DNDS::DeviceStorageBase::bytes ( ) const
pure virtual

Buffer size in bytes.

=0 is a definition and all virtual functions must be defined to have vtable never omit =0 or use {}

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.

◆ copy_device_to_host()

virtual void DNDS::DeviceStorageBase::copy_device_to_host ( uint8_t *  host_ptr,
size_t  n_bytes 
)
pure virtual

Copy n_bytes from this device buffer into host_ptr.

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.

◆ copy_host_to_device()

virtual void DNDS::DeviceStorageBase::copy_host_to_device ( uint8_t *  host_ptr,
size_t  n_bytes 
)
pure virtual

Copy n_bytes from host_ptr into this device buffer.

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.

◆ copy_to_device()

virtual void DNDS::DeviceStorageBase::copy_to_device ( uint8_t *  device_ptr_dst,
size_t  n_bytes 
)
pure virtual

Device-to-device copy of n_bytes into device_ptr_dst.

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.

◆ raw_ptr()

virtual uint8_t * DNDS::DeviceStorageBase::raw_ptr ( )
pure virtual

Raw byte pointer to the underlying storage.

Implemented in DNDS::DeviceStorage< DeviceBackend::Host >.


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