MemorySpace Class Reference
|
HiCR
|
#include <memorySpace.hpp>
Public Member Functions | |
| MemorySpace (const nlohmann::json &input) | |
| virtual | ~MemorySpace ()=default |
| __INLINE__ std::string | getType () const |
| virtual __INLINE__ const size_t | getSize () const |
| __INLINE__ nlohmann::json | serialize () const |
| __INLINE__ void | deserialize (const nlohmann::json &input) |
Protected Member Functions | |
| MemorySpace (const size_t size) | |
| MemorySpace ()=default | |
| virtual void | serializeImpl (nlohmann::json &output) const |
| virtual void | deserializeImpl (const nlohmann::json &input) |
Protected Attributes | |
| std::string | _type |
Detailed Description
This class represents an generic definition for a Memory Space that:
- Represents a autonomous unit of byte-addressable memory (e.g., host memory, NUMA domain, device global RAM)
- The space is assumed to be contiguous and have a fixed sized determined at construction time
- This is a copy-able class that only contains metadata
A Device object may comprise one or more such Memory Spaces on which data can be allocated, copied and communicated among different Memory Spaces, provided there is connectivity
Constructor & Destructor Documentation
◆ MemorySpace() [1/3]
|
inline |
Deserializing constructor
The instance created will contain all information, if successful in deserializing it, corresponding to the passed host RAM This instance should NOT be used for anything else than reporting/printing the contained resources
- Parameters
-
[in] input A JSON-encoded serialized host RAM information
◆ ~MemorySpace()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::hwloc::MemorySpace, HiCR::backend::acl::MemorySpace, and HiCR::backend::opencl::MemorySpace.
◆ MemorySpace() [2/3]
|
inlineprotected |
Constructor for the MemorySpace class
- Parameters
-
[in] size The size of the memory space to create
◆ MemorySpace() [3/3]
|
protecteddefault |
Default constructor for deserialization purposes
Member Function Documentation
◆ deserialize()
|
inline |
Serialization function to enable sharing memory space information
- Parameters
-
[in] input JSON-formatted serialized memory space information
◆ deserializeImpl()
|
inlineprotectedvirtual |
Backend-specific implementation of the deserialize function
- Parameters
-
[in] input Serialized compute resource information corresponding to the specific backend's topology manager
◆ getSize()
|
inlinevirtual |
Returns the memory space's size
- Returns
- The memory space's size
◆ getType()
|
inline |
Indicates what type of memory space this represents
- Returns
- A string containing a human-readable description of the memory space type
◆ serialize()
|
inline |
Serialization function to enable sharing memory space information
- Returns
- JSON-formatted serialized memory space information
◆ serializeImpl()
|
inlineprotectedvirtual |
Backend-specific implemtation of the serialize function that allows adding more information than the one provided by default by HiCR
- Parameters
-
[out] output JSON-formatted serialized compute resource information
Member Data Documentation
◆ _type
|
protected |
Type, used to identify exactly this memory space's model/technology
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/memorySpace.hpp
Generated by