Logo ROOT  
Reference Guide
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

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
 
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/4]

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/4]

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

◆ TCpuBuffer() [3/4]

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

◆ TCpuBuffer() [4/4]

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

Member Function Documentation

◆ begin()

template<typename AFloat >
FakeIteratorBegin TMVA::DNN::TCpuBuffer< AFloat >::begin ( )
inline

Definition at line 79 of file CpuBuffer.h.

◆ CopyFrom()

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

◆ CopyTo()

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

◆ GetSize()

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

copy pointer from an external

Definition at line 102 of file CpuBuffer.h.

◆ GetSubBuffer()

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

◆ GetUseCount()

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

Definition at line 104 of file CpuBuffer.h.

◆ operator AFloat *()

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

Definition at line 67 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 88 of file CpuBuffer.h.

◆ operator[]() [2/2]

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

Definition at line 89 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: