ROOT 6.18/05 Reference Guide |
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 | |
struct | TDestructor |
Public Member Functions | |
TCpuBuffer (const TCpuBuffer &)=default | |
TCpuBuffer (size_t size) | |
Construct buffer to hold size numbers of type AFloat . More... | |
TCpuBuffer (TCpuBuffer &&)=default | |
void | CopyFrom (TCpuBuffer &) |
Copy data from another buffer. More... | |
void | CopyTo (TCpuBuffer &) |
Copy data to another buffer. More... | |
size_t | GetSize () const |
TCpuBuffer | GetSubBuffer (size_t offset, size_t start) |
Return subbuffer of siez start starting at element offset . More... | |
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 |
void TMVA::DNN::TCpuBuffer< AReal >::CopyFrom | ( | 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 | ) |
Copy data to another buffer.
No real copying is performed, only the data pointers are swapped.
Definition at line 64 of file CpuBuffer.cxx.
|
inline |
Definition at line 81 of file CpuBuffer.h.
TCpuBuffer< AReal > TMVA::DNN::TCpuBuffer< AReal >::GetSubBuffer | ( | size_t | offset, |
size_t | start | ||
) |
Return subbuffer of siez start
starting at element offset
.
Definition at line 47 of file CpuBuffer.cxx.
|
inline |
Definition at line 66 of file CpuBuffer.h.
|
default |
|
default |
|
inline |
Definition at line 71 of file CpuBuffer.h.
|
inline |
Definition at line 72 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.