LAMA
|
This singleton class provides the one and only-one manager that provides access to a Host Context. More...
#include <CUDAHostContextManager.hpp>
Public Member Functions | |
virtual ContextPtr | getContext (int contextNr) |
This routine must be implemented by each context manager individually. | |
~CUDAHostContextManager () | |
Static Public Member Functions | |
static void | setAsCurrent (ContextPtr cudaContext) |
Configure the CUDAHostManager to be the current one. | |
Protected Member Functions | |
LAMA_LOG_DECL_STATIC_LOGGER (logger) | |
void | registerFactory () |
This method sets the context manager as responsible for its context type in the factory. | |
Private Member Functions | |
CUDAHostContextManager () | |
Static Private Attributes | |
static boost::weak_ptr< const class CUDAHostContext > | contextInstance |
static int | cudaDeviceNr = LAMA_DEFAULT_DEVICE_NUMBER |
static CUDAHostContextManager | theInstance |
This singleton class provides the one and only-one manager that provides access to a Host Context.
The HostManager will add itself to the ContextFactory so that CUDAHostContext pointers can be obtained by the Context factory.
lama::CUDAHostContextManager::CUDAHostContextManager | ( | ) | [private] |
ContextPtr lama::CUDAHostContextManager::getContext | ( | int | deviceNr | ) | [virtual] |
This routine must be implemented by each context manager individually.
Implements lama::ContextManager.
References contextInstance, lama::Context::CUDA, cudaDeviceNr, and LAMA_DEFAULT_DEVICE_NUMBER.
lama::ContextManager::LAMA_LOG_DECL_STATIC_LOGGER | ( | logger | ) | [protected, inherited] |
void lama::ContextManager::registerFactory | ( | ) | [protected, inherited] |
This method sets the context manager as responsible for its context type in the factory.
References lama::ContextFactory::addContextManager(), lama::ContextFactory::getFactory(), and lama::ContextManager::mContextType.
Referenced by lama::CUDAContextManager::CUDAContextManager(), lama::DefaultHostContextManager::DefaultHostContextManager(), lama::PGASContextManager::PGASContextManager(), lama::PGASContextManager::setAsCurrent(), and setAsCurrent().
void lama::CUDAHostContextManager::setAsCurrent | ( | ContextPtr | cudaContext | ) | [static] |
Configure the CUDAHostManager to be the current one.
Host context will now allocate data to allow faster transfer
References lama::Context::CUDA, cudaDeviceNr, lama::CUDAContext::getDeviceNr(), LAMA_THROWEXCEPTION, lama::ContextManager::registerFactory(), and theInstance.
Referenced by lama::LUSolver::computeLUFactorization().
boost::weak_ptr< const CUDAHostContext > lama::CUDAHostContextManager::contextInstance [static, private] |
Referenced by getContext().
int lama::CUDAHostContextManager::cudaDeviceNr = LAMA_DEFAULT_DEVICE_NUMBER [static, private] |
Referenced by getContext(), and setAsCurrent().
CUDAHostContextManager lama::CUDAHostContextManager::theInstance [static, private] |
Referenced by setAsCurrent().