LAMA
|
Base class for manager of context objects. More...
#include <ContextManager.hpp>
Public Member Functions | |
virtual | ~ContextManager () |
Destructor. | |
virtual ContextPtr | getContext (int deviceNr)=0 |
This routine must be implemented by each context manager individually. | |
Protected Member Functions | |
ContextManager (ContextType type) | |
Constructor for a context manager. | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
void | registerFactory () |
This method sets the context manager as responsible for its context type in the factory. | |
Private Attributes | |
ContextType | mContextType |
context type for which manager is responsible |
Base class for manager of context objects.
Each derived class of Context should have a derived class counterpart of derived class of ContextManager.
A context manager registers via the context type to the factory so that the factory can provide a context for the corresponding type.
The concept of manager and factory provides a mechanism for extendability with new context classes and types.
lama::ContextManager::~ContextManager | ( | ) | [virtual] |
Destructor.
References mContextType.
lama::ContextManager::ContextManager | ( | ContextType | type | ) | [protected] |
Constructor for a context manager.
param[in] type context type for which the context manager will be responsible
The constructor adds itself to the context factory.
virtual ContextPtr lama::ContextManager::getContext | ( | int | deviceNr | ) | [pure virtual] |
This routine must be implemented by each context manager individually.
Implemented in lama::CUDAContextManager, lama::CUDAHostContextManager, lama::PGASContextManager, and lama::DefaultHostContextManager.
Referenced by lama::ContextFactory::getContext(), and lama::MatrixConfigGrammar::MatrixConfigGrammar().
lama::ContextManager::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [protected] |
void lama::ContextManager::registerFactory | ( | ) | [protected] |
This method sets the context manager as responsible for its context type in the factory.
References lama::ContextFactory::addContextManager(), lama::ContextFactory::getFactory(), and mContextType.
Referenced by lama::CUDAContextManager::CUDAContextManager(), lama::DefaultHostContextManager::DefaultHostContextManager(), lama::PGASContextManager::PGASContextManager(), lama::PGASContextManager::setAsCurrent(), and lama::CUDAHostContextManager::setAsCurrent().
context type for which manager is responsible
Referenced by registerFactory(), and ~ContextManager().