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

Concrete DeviceHostSingleAllocationBase using std::vector<uint8_t> for host memory and DeviceStorage for device memory. More...

#include <Vector.hpp>

Inheritance diagram for DNDS::DeviceHostSingleAllocationDirect:
[legend]
Collaboration diagram for DNDS::DeviceHostSingleAllocationDirect:
[legend]

Public Member Functions

 DeviceHostSingleAllocationDirect ()=default
 
 ~DeviceHostSingleAllocationDirect () override
 
void allocate (size_t bytes, DeviceBackend B=DeviceBackend::Unknown) override
 Allocate bytes on backend B (or on the host when Unknown).
 
void free () override
 Release the allocation.
 
size_t bytes () const override
 Allocation size in bytes.
 
uint8_t * get () override
 Typed byte pointer to the current allocation.
 
DeviceBackend device () override
 Which backend currently owns the allocation.
 
void copy_to_host (uint8_t *host_dst, size_t n) override
 Copy n bytes from this allocation into host_dst.
 
void copy_from_host (uint8_t *host_src, size_t n) override
 Copy n bytes from host_src into this allocation.
 
std::unique_ptr< DeviceHostSingleAllocationBaseclone () override
 Deep copy; returns a new allocation containing the same bytes.
 
- Public Member Functions inherited from DNDS::DeviceHostSingleAllocationBase
 DeviceHostSingleAllocationBase ()=default
 
virtual ~DeviceHostSingleAllocationBase ()
 

Detailed Description

Concrete DeviceHostSingleAllocationBase using std::vector<uint8_t> for host memory and DeviceStorage for device memory.

Definition at line 52 of file Vector.hpp.

Constructor & Destructor Documentation

◆ DeviceHostSingleAllocationDirect()

DNDS::DeviceHostSingleAllocationDirect::DeviceHostSingleAllocationDirect ( )
default

◆ ~DeviceHostSingleAllocationDirect()

DNDS::DeviceHostSingleAllocationDirect::~DeviceHostSingleAllocationDirect ( )
inlineoverride

Definition at line 64 of file Vector.hpp.

Member Function Documentation

◆ allocate()

void DNDS::DeviceHostSingleAllocationDirect::allocate ( size_t  bytes,
DeviceBackend  B = DeviceBackend::Unknown 
)
inlineoverridevirtual

Allocate bytes on backend B (or on the host when Unknown).

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 66 of file Vector.hpp.

Here is the call graph for this function:

◆ bytes()

size_t DNDS::DeviceHostSingleAllocationDirect::bytes ( ) const
inlineoverridevirtual

Allocation size in bytes.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 84 of file Vector.hpp.

Here is the caller graph for this function:

◆ clone()

std::unique_ptr< DeviceHostSingleAllocationBase > DNDS::DeviceHostSingleAllocationDirect::clone ( )
inlineoverridevirtual

Deep copy; returns a new allocation containing the same bytes.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 121 of file Vector.hpp.

◆ copy_from_host()

void DNDS::DeviceHostSingleAllocationDirect::copy_from_host ( uint8_t *  host_src,
size_t  n 
)
inlineoverridevirtual

Copy n bytes from host_src into this allocation.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 109 of file Vector.hpp.

Here is the call graph for this function:

◆ copy_to_host()

void DNDS::DeviceHostSingleAllocationDirect::copy_to_host ( uint8_t *  host_dst,
size_t  n 
)
inlineoverridevirtual

Copy n bytes from this allocation into host_dst.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 97 of file Vector.hpp.

Here is the call graph for this function:

◆ device()

DeviceBackend DNDS::DeviceHostSingleAllocationDirect::device ( )
inlineoverridevirtual

Which backend currently owns the allocation.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 95 of file Vector.hpp.

◆ free()

void DNDS::DeviceHostSingleAllocationDirect::free ( )
inlineoverridevirtual

Release the allocation.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 77 of file Vector.hpp.

◆ get()

uint8_t * DNDS::DeviceHostSingleAllocationDirect::get ( )
inlineoverridevirtual

Typed byte pointer to the current allocation.

Implements DNDS::DeviceHostSingleAllocationBase.

Definition at line 85 of file Vector.hpp.


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