|
UMPIRE
Umpire: resource management and provision
|
The MemoryOperationRegistry serves as a registry for MemoryOperation objects. It is a singleton class, typically accessed through the ResourceManager. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/op/MemoryOperationRegistry.hpp>
Public Member Functions | |
| std::shared_ptr< umpire::op::MemoryOperation > | find (const std::string &name, strategy::AllocationStrategy *source_allocator, strategy::AllocationStrategy *dst_allocator) |
| Function to find a MemoryOperation object. More... | |
| std::shared_ptr< umpire::op::MemoryOperation > | find (const std::string &name, std::pair< Platform, Platform > platforms) |
| void | registerOperation (const std::string &name, std::pair< Platform, Platform > platforms, std::shared_ptr< MemoryOperation > &&operation) noexcept |
| Add a new MemoryOperation to the registry. More... | |
| MemoryOperationRegistry (const MemoryOperationRegistry &)=delete | |
| MemoryOperationRegistry & | operator= (const MemoryOperationRegistry &)=delete |
| ~MemoryOperationRegistry ()=default | |
Static Public Member Functions | |
| static MemoryOperationRegistry & | getInstance () noexcept |
| Get the MemoryOperationRegistry singleton instance. More... | |
Protected Member Functions | |
| MemoryOperationRegistry () noexcept | |
The MemoryOperationRegistry serves as a registry for MemoryOperation objects. It is a singleton class, typically accessed through the ResourceManager.
The MemoryOperationRegistry class provides lookup mechanisms allowing searching for the appropriate MemoryOperation to be applied to allocations made with particular AllocationStrategy objects.
MemoryOperations provided by Umpire are registered with the MemoryOperationRegistry when it is constructed. Additional MemoryOperations can be registered later using the registerOperation method.
The following operations are pre-registered for all AllocationStrategy pairs:
|
delete |
|
default |
|
protectednoexcept |
References registerOperation().
|
staticnoexcept |
Get the MemoryOperationRegistry singleton instance.
Referenced by umpire::strategy::AllocationAdvisor::AllocationAdvisor(), umpire::strategy::AllocationPrefetcher::AllocationPrefetcher(), umpire::ResourceManager::copy(), umpire::ResourceManager::getOperation(), umpire::ResourceManager::memset(), umpire::ResourceManager::move(), and umpire::ResourceManager::prefetch().
| std::shared_ptr< umpire::op::MemoryOperation > umpire::op::MemoryOperationRegistry::find | ( | const std::string & | name, |
| strategy::AllocationStrategy * | source_allocator, | ||
| strategy::AllocationStrategy * | dst_allocator | ||
| ) |
Function to find a MemoryOperation object.
Finds the MemoryOperation object that matches the given name and AllocationStrategy objects. If the requested MemoryOperation is not found, this method will throw an runtime_error.
| name | Name of operation. |
| src_allocator | AllocationStrategy of the source allocation. |
| dst_allocator | AllocationStrategy of the destination allocation. |
| umpire::util::runtime_error | if the requested MemoryOperation is not found. |
References umpire::strategy::AllocationStrategy::getPlatform().
| std::shared_ptr< umpire::op::MemoryOperation > umpire::op::MemoryOperationRegistry::find | ( | const std::string & | name, |
| std::pair< Platform, Platform > | platforms | ||
| ) |
References UMPIRE_ERROR.
|
noexcept |
Add a new MemoryOperation to the registry.
This object will register the provided MemoryOperation, making it available for later retrieval using MemoryOperation::find
| name | Name of the operation. |
| platforms | pair of Platforms for the source and destination. |
| operation | pointer to the MemoryOperation. |
Referenced by MemoryOperationRegistry().
|
delete |