MemorySpace Class Reference

HiCR: HiCR::backend::acl::MemorySpace Class Reference
HiCR
HiCR::backend::acl::MemorySpace Class Referencefinal

#include <memorySpace.hpp>

Inheritance diagram for HiCR::backend::acl::MemorySpace:
HiCR::MemorySpace

Public Member Functions

 MemorySpace (const std::weak_ptr< acl::Device > device, const size_t size)
 
 MemorySpace ()
 
 ~MemorySpace ()=default
 
 MemorySpace (const nlohmann::json &input)
 
__INLINE__ const std::weak_ptr< const acl::DevicegetDevice () const
 
- Public Member Functions inherited from HiCR::MemorySpace
 MemorySpace (const nlohmann::json &input)
 
__INLINE__ std::string getType () const
 
virtual __INLINE__ const size_t getSize () const
 
virtual __INLINE__ size_t getUsage () const
 
__INLINE__ void increaseUsage (const size_t delta)
 
__INLINE__ void decreaseUsage (const size_t delta)
 
__INLINE__ nlohmann::json serialize () const
 
__INLINE__ void deserialize (const nlohmann::json &input)
 

Additional Inherited Members

- Protected Member Functions inherited from HiCR::MemorySpace
 MemorySpace (const size_t size)
 
 MemorySpace ()=default
 
- Protected Attributes inherited from HiCR::MemorySpace
std::string _type
 

Detailed Description

This class represents a memory space, as visible by the acl backend. That is, the entire RAM that the running CPU has access to.

Constructor & Destructor Documentation

◆ MemorySpace() [1/3]

HiCR::backend::acl::MemorySpace::MemorySpace ( const std::weak_ptr< acl::Device device,
const size_t  size 
)
inline

Constructor for the compute resource class of the acl backend

Parameters
deviceThe Huawei device in which this memory space was detected
sizeThe size of this memory space

◆ MemorySpace() [2/3]

HiCR::backend::acl::MemorySpace::MemorySpace ( )
inline

Default constructor for resource requesting

◆ ~MemorySpace()

HiCR::backend::acl::MemorySpace::~MemorySpace ( )
virtualdefault

Default destructor

Reimplemented from HiCR::MemorySpace.

◆ MemorySpace() [3/3]

HiCR::backend::acl::MemorySpace::MemorySpace ( const nlohmann::json &  input)
inline

Deserializing constructor

Parameters
[in]inputSerialized resource information
Note
Backwards reference to device is null when deserializing. Do not try to use this class for any operations.

Member Function Documentation

◆ getDevice()

__INLINE__ const std::weak_ptr< const acl::Device > HiCR::backend::acl::MemorySpace::getDevice ( ) const
inline

Function to get the Huawei device associated to this memory space

Returns
The Huawei device corresponding to this memory space

The documentation for this class was generated from the following file: