Since the memory on the CPU is homogeneous, only one buffer class is required. The host and device buffer classes are the same and copying between the host and device buffer is achieved by simply swapping the memory pointers.
Memory is handled as a shared pointer to a pointer of type AFloat, which is the floating point type used for the implementation.
Copying and assignment of TCpuBuffer objects performs only a shallow copy meaning the underlying data is shared between those objects.
AFloat | The floating point type used for the computations. |
Definition at line 43 of file CpuBuffer.h.
Classes | |
class | FakeIteratorBegin |
struct | TDestructor |
Public Member Functions | |
TCpuBuffer ()=default | |
TCpuBuffer (const TCpuBuffer &)=default | |
TCpuBuffer (size_t size) | |
Construct buffer to hold size numbers of type AFloat . More... | |
TCpuBuffer (TCpuBuffer &&)=default | |
FakeIteratorBegin | begin () |
void | CopyFrom (const TCpuBuffer &) |
Copy data from another buffer. More... | |
void | CopyTo (TCpuBuffer &) const |
Copy data to another buffer. More... | |
size_t | GetSize () const |
copy pointer from an external More... | |
TCpuBuffer | GetSubBuffer (size_t offset, size_t start) const |
Return sub-buffer of size start starting at element offset . More... | |
size_t | GetUseCount () const |
operator AFloat * () const | |
TCpuBuffer & | operator= (const TCpuBuffer &)=default |
TCpuBuffer & | operator= (TCpuBuffer &&)=default |
AFloat & | operator[] (size_t i) |
AFloat | operator[] (size_t i) const |
Private Attributes | |
std::shared_ptr< AFloat * > | fBuffer |
struct TMVA::DNN::TCpuBuffer::TDestructor | fDestructor |
size_t | fOffset |
size_t | fSize |
#include <TMVA/DNN/Architectures/Cpu/CpuBuffer.h>
TMVA::DNN::TCpuBuffer< AReal >::TCpuBuffer | ( | size_t | size | ) |
Construct buffer to hold size
numbers of type AFloat
.
Definition at line 38 of file CpuBuffer.cxx.
|
default |
|
default |
|
default |
|
inline |
Definition at line 79 of file CpuBuffer.h.
void TMVA::DNN::TCpuBuffer< AReal >::CopyFrom | ( | const TCpuBuffer< AFloat > & | other | ) |
Copy data from another buffer.
No real copying is performed, only the data pointers are swapped.
Definition at line 57 of file CpuBuffer.cxx.
void TMVA::DNN::TCpuBuffer< AReal >::CopyTo | ( | TCpuBuffer< AFloat > & | other | ) | const |
Copy data to another buffer.
No real copying is performed, only the data pointers are swapped.
Definition at line 65 of file CpuBuffer.cxx.
|
inline |
copy pointer from an external
Definition at line 102 of file CpuBuffer.h.
TCpuBuffer< AReal > TMVA::DNN::TCpuBuffer< AReal >::GetSubBuffer | ( | size_t | offset, |
size_t | start | ||
) | const |
Return sub-buffer of size start
starting at element offset
.
Definition at line 47 of file CpuBuffer.cxx.
|
inline |
Definition at line 104 of file CpuBuffer.h.
|
inline |
Definition at line 67 of file CpuBuffer.h.
|
default |
|
default |
|
inline |
Definition at line 88 of file CpuBuffer.h.
|
inline |
Definition at line 89 of file CpuBuffer.h.
|
private |
Definition at line 49 of file CpuBuffer.h.
|
private |
|
private |
Definition at line 48 of file CpuBuffer.h.
|
private |
Definition at line 47 of file CpuBuffer.h.