Device Class Reference
HiCR
|
#include <device.hpp>

Public Types | |
typedef uint64_t | deviceIdentifier_t |
![]() | |
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 |
![]() | |
__INLINE__ const computeResourceList_t & | getComputeResourceList () |
__INLINE__ const memorySpaceList_t & | getMemorySpaceList () |
__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 | |
![]() | |
Device ()=default | |
Detailed Description
This class represents a device, as visible by the Ascend backend.
Member Typedef Documentation
◆ deviceIdentifier_t
typedef uint64_t HiCR::backend::ascend::Device::deviceIdentifier_t |
Type definition for the Ascend Device identifier
Constructor & Destructor Documentation
◆ Device() [1/3]
|
inline |
Constructor for an Ascend device
- Parameters
-
id Internal unique identifier for the device computeResources The compute resources associated to this device (typically just one, the main Ascend processor) memorySpaces The memory spaces associated to this device (DRAM + other use-specific or high-bandwidth memories)
◆ Device() [2/3]
|
inline |
Default constructor for resource requesting
◆ Device() [3/3]
|
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] input A JSON-encoded serialized Ascend device information
◆ ~Device()
|
inlinevirtual |
Device destructor
Reimplemented from HiCR::Device.
Member Function Documentation
◆ getContext()
|
inline |
Returns the ACL context corresponding to this compute resource
- Returns
- The ACL context
◆ getId()
|
inline |
Returns the internal id of the current Ascend device
- Returns
- The id of the Ascend device
◆ getType()
|
inlineoverridevirtual |
Returns a string representing the Ascend device type
- Returns
- The string representing the Ascend device type
Implements HiCR::Device.
◆ select()
|
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
Generated by