Device Class Reference

HiCR: HiCR::backend::ascend::Device Class Reference
HiCR
HiCR::backend::ascend::Device Class Referencefinal

#include <device.hpp>

Inheritance diagram for HiCR::backend::ascend::Device:
HiCR::Device

Public Types

typedef uint64_t deviceIdentifier_t
 
- Public Types inherited from HiCR::Device
using computeResourceList_t = std::vector< std::shared_ptr< ComputeResource > >
 
using memorySpaceList_t = std::vector< std::shared_ptr< MemorySpace > >
 

Public Member Functions

 Device (const deviceIdentifier_t id, const computeResourceList_t &computeResources, const memorySpaceList_t &memorySpaces)
 
 Device ()
 
 Device (const nlohmann::json &input)
 
__INLINE__ void select () const
 
 ~Device ()
 
__INLINE__ std::string getType () const override
 
__INLINE__ deviceIdentifier_t getId () const
 
__INLINE__ aclrtContext * getContext () const
 
- Public Member Functions inherited from HiCR::Device
__INLINE__ const computeResourceList_tgetComputeResourceList ()
 
__INLINE__ const memorySpaceList_tgetMemorySpaceList ()
 
__INLINE__ void addComputeResource (const std::shared_ptr< HiCR::ComputeResource > &computeResource)
 
__INLINE__ void addMemorySpace (const std::shared_ptr< HiCR::MemorySpace > &memorySpace)
 
 Device (computeResourceList_t computeResources, memorySpaceList_t memorySpaces)
 
__INLINE__ nlohmann::json serialize () const
 
__INLINE__ void deserialize (const nlohmann::json &input)
 

Additional Inherited Members

- Protected Member Functions inherited from HiCR::Device
 Device ()=default
 

Detailed Description

This class represents a device, as visible by the Ascend backend.

Member Typedef Documentation

◆ deviceIdentifier_t

Type definition for the Ascend Device identifier

Constructor & Destructor Documentation

◆ Device() [1/3]

HiCR::backend::ascend::Device::Device ( const deviceIdentifier_t  id,
const computeResourceList_t computeResources,
const memorySpaceList_t memorySpaces 
)
inline

Constructor for an Ascend device

Parameters
idInternal unique identifier for the device
computeResourcesThe compute resources associated to this device (typically just one, the main Ascend processor)
memorySpacesThe memory spaces associated to this device (DRAM + other use-specific or high-bandwidth memories)

◆ Device() [2/3]

HiCR::backend::ascend::Device::Device ( )
inline

Default constructor for resource requesting

◆ Device() [3/3]

HiCR::backend::ascend::Device::Device ( const nlohmann::json &  input)
inline

Deserializing constructor

The instance created will contain all information, if successful in deserializing it, corresponding to the passed Ascend device This instance should NOT be used for anything else than reporting/printing the contained resources

Parameters
[in]inputA JSON-encoded serialized Ascend device information

◆ ~Device()

HiCR::backend::ascend::Device::~Device ( )
inlinevirtual

Device destructor

Reimplemented from HiCR::Device.

Member Function Documentation

◆ getContext()

__INLINE__ aclrtContext * HiCR::backend::ascend::Device::getContext ( ) const
inline

Returns the ACL context corresponding to this compute resource

Returns
The ACL context

◆ getId()

__INLINE__ deviceIdentifier_t HiCR::backend::ascend::Device::getId ( ) const
inline

Returns the internal id of the current Ascend device

Returns
The id of the Ascend device

◆ getType()

__INLINE__ std::string HiCR::backend::ascend::Device::getType ( ) const
inlineoverridevirtual

Returns a string representing the Ascend device type

Returns
The string representing the Ascend device type

Implements HiCR::Device.

◆ select()

__INLINE__ void HiCR::backend::ascend::Device::select ( ) const
inline

Set this device as the one on which the operations needs to be executed


The documentation for this class was generated from the following file:
  • /home/runner/work/HiCR/HiCR/include/hicr/backends/ascend/device.hpp