Class MemoryOperationRegistry¶
Defined in File MemoryOperationRegistry.hpp
Class Documentation¶
-
class
umpire::op
::
MemoryOperationRegistry
¶ 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:
”COPY”
”MEMSET”
”REALLOCATE”
- See
- See
AllocationStrategy
Public 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.
Finds the MemoryOperation object that matches the given name and AllocationStrategy objects. If the requested MemoryOperation is not found, this method will throw an Exception.
- Parameters
name
: Name of operation.src_allocator
: AllocationStrategy of the source allocation.dst_allocator
: AllocationStrategy of the destination allocation.
- Exceptions
umpire::util::Exception
: if the requested MemoryOperation is not found.
-
std::shared_ptr<umpire::op::MemoryOperation>
find
(const std::string &name, std::pair<Platform, Platform> platforms)¶
Add a new MemoryOperation to the registry.
This object will register the provided MemoryOperation, making it available for later retrieval using MemoryOperation::find
- Parameters
name
: Name of the operation.platforms
: pair of Platforms for the source and destination.operation
: pointer to the MemoryOperation.
-
MemoryOperationRegistry
(const MemoryOperationRegistry&) = delete¶
-
MemoryOperationRegistry &
operator=
(const MemoryOperationRegistry&) = delete¶
-
~MemoryOperationRegistry
() = default¶
Public Static Functions
-
MemoryOperationRegistry &
getInstance
() noexcept¶ Get the MemoryOperationRegistry singleton instance.
Protected Functions
-
MemoryOperationRegistry
() noexcept¶