MemoryManager Class Reference
HiCR
|
#include <memoryManager.hpp>

Public Member Functions | |
virtual | ~MemoryManager ()=default |
__INLINE__ std::shared_ptr< LocalMemorySlot > | allocateLocalMemorySlot (const std::shared_ptr< MemorySpace > &memorySpace, const size_t size) |
virtual std::shared_ptr< LocalMemorySlot > | registerLocalMemorySlot (const std::shared_ptr< HiCR::MemorySpace > &memorySpace, void *const ptr, const size_t size) |
__INLINE__ void | deregisterLocalMemorySlot (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot) |
__INLINE__ void | memset (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot, int value, size_t size) |
__INLINE__ void | freeLocalMemorySlot (const std::shared_ptr< HiCR::LocalMemorySlot > &memorySlot) |
Protected Member Functions | |
virtual std::shared_ptr< HiCR::LocalMemorySlot > | allocateLocalMemorySlotImpl (std::shared_ptr< HiCR::MemorySpace > memorySpace, const size_t size)=0 |
virtual std::shared_ptr< LocalMemorySlot > | registerLocalMemorySlotImpl (std::shared_ptr< HiCR::MemorySpace > memorySpace, void *const ptr, const size_t size)=0 |
virtual void | memsetImpl (const std::shared_ptr< HiCR::LocalMemorySlot > memorySlot, int value, size_t size) |
virtual void | freeLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot)=0 |
virtual void | deregisterLocalMemorySlotImpl (std::shared_ptr< HiCR::LocalMemorySlot > memorySlot)=0 |
Detailed Description
Encapsulates a HiCR Backend Memory Manager.
Backends represent plugins to HiCR that provide support for a communication or device library. By adding new plugins developers extend HiCR's support for new hardware and software technologies.
Backends need to fulfill the abstract virtual functions described here, so that HiCR can perform memory allocation/free/register operations on the supported device/network library.
Constructor & Destructor Documentation
◆ ~MemoryManager()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::hwloc::MemoryManager, HiCR::backend::mpi::MemoryManager, HiCR::backend::ascend::MemoryManager, and HiCR::backend::opencl::MemoryManager.
Member Function Documentation
◆ allocateLocalMemorySlot()
|
inline |
Allocates a local memory slot in the specified memory space
- Parameters
-
[in] memorySpace Memory space in which to perform the allocation. [in] size Size of the memory slot to create
- Returns
- The pointer of the newly allocated memory slot
◆ allocateLocalMemorySlotImpl()
|
protectedpure virtual |
Backend-internal implementation of the allocateLocalMemorySlot function
- Parameters
-
[in] memorySpace Memory space to allocate memory from [in] size Size of the memory slot to create
- Returns
- The internal pointer associated to the local memory slot
Implemented in HiCR::backend::lpf::MemoryManager, and HiCR::backend::mpi::MemoryManager.
◆ deregisterLocalMemorySlot()
|
inline |
De-registers a previously registered local memory slot
- Parameters
-
[in] memorySlot Memory slot to deregister.
◆ deregisterLocalMemorySlotImpl()
|
protectedpure virtual |
Backend-internal implementation of the deregisterMemorySlot function
- Parameters
-
[in] memorySlot Memory slot to deregister.
◆ freeLocalMemorySlot()
|
inline |
Frees up a memory slot reserved from this memory space
- Parameters
-
[in] memorySlot Memory slot to free up. It becomes unusable after freeing.
◆ freeLocalMemorySlotImpl()
|
protectedpure virtual |
Backend-internal implementation of the freeLocalMemorySlot function
- Parameters
-
[in] memorySlot Local memory slot to free up. It becomes unusable after freeing.
◆ memset()
|
inline |
Fills a memory slot with a given value. This is a blocking operation.
Like standard memset, this function fills the memory slot with the given value, starting from the beginning of the memory slot. No bounds checking is performed, so the caller must ensure that the memory slot is large enough to hold the requested number of bytes, should the size parameter be provided.
- Parameters
-
[in] memorySlot Memory slot to fill [in] value Value to fill the memory slot with [in] size Number of bytes to fill, from the start of the memory slot. If not provided, the whole memory slot is filled.
- Note
- : The size parameter is not checked against the memory slot's size, so the caller must ensure that the size is valid.
◆ memsetImpl()
|
inlineprotectedvirtual |
Backend-internal implementation of the memset function
- Parameters
-
[in] memorySlot Memory slot to fill [in] value Value to fill the memory slot with [in] size Number of bytes to fill, from the start of the memory slot
◆ registerLocalMemorySlot()
|
inlinevirtual |
Registers a local memory slot from a given address
- Parameters
-
[in] memorySpace Memory space in which to perform the allocation. [in] ptr Pointer to the start of the memory slot [in] size Size of the memory slot to create
- Returns
- The pointer of the newly registered memory slot
◆ registerLocalMemorySlotImpl()
|
protectedpure virtual |
Backend-internal implementation of the registerLocalMemorySlot function
- Parameters
-
[in] memorySpace Memory space to register memory in [in] ptr Pointer to the start of the memory slot [in] size Size of the memory slot to create
- Returns
- A newly created memory slot
Implemented in HiCR::backend::lpf::MemoryManager, and HiCR::backend::mpi::MemoryManager.
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/memoryManager.hpp
Generated by