Logo ROOT   6.10/09
Reference Guide
List of all members | Classes | Public Member Functions | Private Attributes | List of all members
TMVA::DNN::TCpuBuffer< AFloat > Class Template Reference

template<typename AFloat>
class TMVA::DNN::TCpuBuffer< AFloat >

TCpuBuffer.

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.

Template Parameters
AFloatThe floating point type used for the computations.

Definition at line 43 of file CpuBuffer.h.

Classes

struct  TDestructor
 

Public Member Functions

 TCpuBuffer (size_t size)
 Construct buffer to hold size numbers of type AFloat. More...
 
 TCpuBuffer (const TCpuBuffer &)=default
 
 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
 
TCpuBufferoperator= (const TCpuBuffer &)=default
 
TCpuBufferoperator= (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>

Constructor & Destructor Documentation

◆ TCpuBuffer() [1/3]

template<typename AReal >
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.

◆ TCpuBuffer() [2/3]

template<typename AFloat>
TMVA::DNN::TCpuBuffer< AFloat >::TCpuBuffer ( const TCpuBuffer< AFloat > &  )
default

◆ TCpuBuffer() [3/3]

template<typename AFloat>
TMVA::DNN::TCpuBuffer< AFloat >::TCpuBuffer ( TCpuBuffer< AFloat > &&  )
default

Member Function Documentation

◆ CopyFrom()

template<typename AReal >
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 58 of file CpuBuffer.cxx.

◆ CopyTo()

template<typename AReal >
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 65 of file CpuBuffer.cxx.

◆ GetSize()

template<typename AFloat>
size_t TMVA::DNN::TCpuBuffer< AFloat >::GetSize ( ) const
inline

Definition at line 81 of file CpuBuffer.h.

◆ GetSubBuffer()

template<typename AReal >
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 48 of file CpuBuffer.cxx.

◆ operator AFloat *()

template<typename AFloat>
TMVA::DNN::TCpuBuffer< AFloat >::operator AFloat * ( ) const
inline

Definition at line 66 of file CpuBuffer.h.

◆ operator=() [1/2]

template<typename AFloat>
TCpuBuffer& TMVA::DNN::TCpuBuffer< AFloat >::operator= ( const TCpuBuffer< AFloat > &  )
default

◆ operator=() [2/2]

template<typename AFloat>
TCpuBuffer& TMVA::DNN::TCpuBuffer< AFloat >::operator= ( TCpuBuffer< AFloat > &&  )
default

◆ operator[]() [1/2]

template<typename AFloat>
AFloat& TMVA::DNN::TCpuBuffer< AFloat >::operator[] ( size_t  i)
inline

Definition at line 71 of file CpuBuffer.h.

◆ operator[]() [2/2]

template<typename AFloat>
AFloat TMVA::DNN::TCpuBuffer< AFloat >::operator[] ( size_t  i) const
inline

Definition at line 72 of file CpuBuffer.h.

Member Data Documentation

◆ fBuffer

template<typename AFloat>
std::shared_ptr<AFloat *> TMVA::DNN::TCpuBuffer< AFloat >::fBuffer
private

Definition at line 49 of file CpuBuffer.h.

◆ fDestructor

template<typename AFloat>
struct TMVA::DNN::TCpuBuffer::TDestructor TMVA::DNN::TCpuBuffer< AFloat >::fDestructor
private

◆ fOffset

template<typename AFloat>
size_t TMVA::DNN::TCpuBuffer< AFloat >::fOffset
private

Definition at line 48 of file CpuBuffer.h.

◆ fSize

template<typename AFloat>
size_t TMVA::DNN::TCpuBuffer< AFloat >::fSize
private

Definition at line 47 of file CpuBuffer.h.


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