LAMA
|
#include <Context.hpp>
Public Types | |
enum | AccessKind { Read, Write, MaxAccessKind } |
Public Member Functions | |
ContextData (ContextPtr context) | |
Constructor, context must always be given. | |
~ContextData () | |
void | allocate (const size_t size) |
allocate data for the Context array on the context | |
void | setRef (void *reference, const size_t size) |
set reference instead of own data allocation. | |
void | realloc (const size_t newSize, const size_t saveSize) |
Reallocate new memory on the context. | |
void | free () |
free data for the Context array on the context | |
bool | isPinned () const |
void | setPinned () const |
void | setCleanFunction (boost::function< void(void *)> cleanFunktion) const |
Data Fields | |
ContextPtr | context |
shared pointer to the context | |
void * | pointer |
pointer to the data on the context | |
size_t | size |
size of a single element | |
bool | allocated |
is true if data has been allocated by context | |
bool | valid |
is true if there is a valid copy on the context | |
unsigned char | lock [MaxAccessKind] |
read, write lock | |
Private Member Functions | |
ContextData () | |
Private Attributes | |
bool | pinned |
boost::function< void(void *) | mCleanFunktion ) |
References lama::Context::free().
lama::Context::ContextData::ContextData | ( | ) | [private] |
void lama::Context::ContextData::allocate | ( | const size_t | size | ) |
allocate data for the Context array on the context
References LAMA_ASSERT_DEBUG, and LAMA_THROWEXCEPTION.
Referenced by lama::LAMAArray< T >::LAMAArray().
void lama::Context::ContextData::free | ( | ) |
free data for the Context array on the context
References LAMA_ASSERT_DEBUG.
Referenced by lama::DefaultHostContext::free(), and lama::LAMAArray< T >::purge().
bool lama::Context::ContextData::isPinned | ( | ) | const |
Referenced by lama::CUDAContext::memcpy(), and lama::CUDAContext::memcpyAsync().
void lama::Context::ContextData::realloc | ( | const size_t | newSize, |
const size_t | saveSize | ||
) |
Reallocate new memory on the context.
newCapacity | number of entries for new allocated memory |
saveCapacity | number of entries to copy back from old memory |
References LAMA_ASSERT_DEBUG, and LAMA_ASSERT_ERROR.
void lama::Context::ContextData::setCleanFunction | ( | boost::function< void(void *)> | cleanFunktion | ) | const |
Referenced by lama::CUDAContext::memcpy(), and lama::CUDAContext::memcpyAsync().
void lama::Context::ContextData::setPinned | ( | ) | const |
void lama::Context::ContextData::setRef | ( | void * | reference, |
const size_t | size | ||
) |
set reference instead of own data allocation.
References LAMA_ASSERT_DEBUG, and LAMA_THROWEXCEPTION.
Referenced by lama::LAMAArrayRef< T >::LAMAArrayRef().
is true if data has been allocated by context
shared pointer to the context
Referenced by lama::LAMAArray< T >::acquireReadAccess(), lama::LAMAArray< T >::acquireWriteAccess(), lama::LAMAArray< T >::assign(), lama::PGASContext::cancpy(), lama::CUDAHostContext::cancpy(), lama::DefaultHostContext::cancpy(), lama::CUDAContext::cancpy(), lama::LAMAArray< T >::fetch(), lama::LAMAArray< T >::fetchAsync(), lama::PGASContext::free(), lama::CUDAHostContext::free(), lama::DefaultHostContext::free(), lama::CUDAContext::free(), lama::LAMAArray< T >::getAccess(), lama::LAMAArray< T >::getValidContext(), lama::PGASContext::memcpy(), lama::CUDAHostContext::memcpy(), lama::DefaultHostContext::memcpy(), lama::CUDAContext::memcpy(), lama::PGASContext::memcpyAsync(), lama::CUDAHostContext::memcpyAsync(), lama::DefaultHostContext::memcpyAsync(), lama::CUDAContext::memcpyAsync(), lama::LAMAArray< T >::operator=(), and lama::LAMAArray< T >::writeAt().
unsigned char lama::Context::ContextData::lock[MaxAccessKind] |
read, write lock
Referenced by lama::LAMAArray< T >::acquireReadAccess(), lama::LAMAArray< T >::acquireWriteAccess(), lama::LAMAArray< T >::assign(), ContextData(), lama::LAMAArray< T >::getAccess(), lama::LAMAArray< T >::getValidContext(), lama::LAMAArray< T >::operator=(), lama::LAMAArray< T >::purge(), and lama::LAMAArray< T >::writeAt().
boost::function<void( void* ) lama::Context::ContextData::mCleanFunktion) [mutable, private] |
bool lama::Context::ContextData::pinned [mutable, private] |
pointer to the data on the context
Referenced by lama::PGASContext::allocate(), lama::CUDAHostContext::allocate(), lama::DefaultHostContext::allocate(), lama::CUDAContext::allocate(), lama::LAMAArray< T >::fetch(), lama::LAMAArray< T >::fetchAsync(), lama::PGASContext::free(), lama::CUDAHostContext::free(), lama::CUDAContext::free(), lama::LAMAArray< T >::LAMAArray(), lama::PGASContext::memcpy(), lama::CUDAHostContext::memcpy(), lama::DefaultHostContext::memcpy(), lama::CUDAContext::memcpy(), lama::PGASContext::memcpyAsync(), lama::CUDAHostContext::memcpyAsync(), lama::DefaultHostContext::memcpyAsync(), and lama::CUDAContext::memcpyAsync().
size of a single element
Referenced by lama::LAMAArray< T >::fetch(), lama::LAMAArray< T >::fetchAsync(), lama::PGASContext::free(), lama::CUDAHostContext::free(), lama::CUDAContext::free(), lama::CUDAContext::memcpy(), lama::CUDAContext::memcpyAsync(), and lama::LAMAArray< T >::writeAt().
is true if there is a valid copy on the context
Referenced by lama::LAMAArray< T >::acquireReadAccess(), lama::LAMAArray< T >::acquireWriteAccess(), lama::LAMAArray< T >::assign(), lama::LAMAArray< T >::fetch(), lama::LAMAArray< T >::fetchAsync(), lama::LAMAArray< T >::getAccess(), lama::LAMAArray< T >::getValidContext(), lama::LAMAArray< T >::LAMAArray(), lama::LAMAArray< T >::operator=(), lama::LAMAArray< T >::prefetch(), lama::LAMAArray< T >::setHostContext(), and lama::LAMAArray< T >::writeAt().