HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CE_BufferHost< T > Class Template Reference

#include <CE_BufferHost.h>

Public Member Functions

 CE_BufferHost ()=default
 
 CE_BufferHost (const exint size)
 
 CE_BufferHost (const CE_BufferHost &other)
 
 CE_BufferHost (CE_BufferHost &&other) noexcept
 
CE_BufferHostoperator= (const CE_BufferHost &other)
 
void adoptFromAlignedMalloc (void *data, const exint size)
 
void adoptFromMalloc (void *data, const exint size)
 
void adoptFromNew (void *data, const exint size)
 
 ~CE_BufferHost ()
 
Tdata () const
 The buffer data. More...
 
exint size () const
 The size of the buffer data in elements. More...
 
int64 getMemoryUsage () const
 

Static Public Attributes

static constexpr int ALIGNMENT = 64
 

Detailed Description

template<typename T>
class CE_BufferHost< T >

The traditional allocator will align to the size of the type, which in this case is char - however, in order to maximize the chances of vectorized instructions being generated, we'll align to the size of the cache line.

Note: We don't have a cross-platform method to determine the size of the cache line, so we'll just assume 64 bytes.

T should be a POD as this is not initialized.

Definition at line 26 of file CE_BufferHost.h.

Constructor & Destructor Documentation

template<typename T >
CE_BufferHost< T >::CE_BufferHost ( )
explicitdefault
template<typename T >
CE_BufferHost< T >::CE_BufferHost ( const exint  size)
inlineexplicit

Definition at line 32 of file CE_BufferHost.h.

template<typename T >
CE_BufferHost< T >::CE_BufferHost ( const CE_BufferHost< T > &  other)
inline

Definition at line 39 of file CE_BufferHost.h.

template<typename T >
CE_BufferHost< T >::CE_BufferHost ( CE_BufferHost< T > &&  other)
inlinenoexcept

Definition at line 46 of file CE_BufferHost.h.

template<typename T >
CE_BufferHost< T >::~CE_BufferHost ( )
inline

Definition at line 91 of file CE_BufferHost.h.

Member Function Documentation

template<typename T >
void CE_BufferHost< T >::adoptFromAlignedMalloc ( void data,
const exint  size 
)
inline

Definition at line 64 of file CE_BufferHost.h.

template<typename T >
void CE_BufferHost< T >::adoptFromMalloc ( void data,
const exint  size 
)
inline

Definition at line 73 of file CE_BufferHost.h.

template<typename T >
void CE_BufferHost< T >::adoptFromNew ( void data,
const exint  size 
)
inline

Definition at line 82 of file CE_BufferHost.h.

template<typename T >
T* CE_BufferHost< T >::data ( ) const
inline

The buffer data.

Definition at line 97 of file CE_BufferHost.h.

template<typename T >
int64 CE_BufferHost< T >::getMemoryUsage ( ) const
inline

Definition at line 102 of file CE_BufferHost.h.

template<typename T >
CE_BufferHost& CE_BufferHost< T >::operator= ( const CE_BufferHost< T > &  other)
inline

Definition at line 56 of file CE_BufferHost.h.

template<typename T >
exint CE_BufferHost< T >::size ( ) const
inline

The size of the buffer data in elements.

Definition at line 100 of file CE_BufferHost.h.

Member Data Documentation

template<typename T >
constexpr int CE_BufferHost< T >::ALIGNMENT = 64
static

Definition at line 109 of file CE_BufferHost.h.


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