TopologyManager Class Reference
HiCR
|
#include <topologyManager.hpp>

Public Member Functions | |
virtual | ~TopologyManager ()=default |
virtual HiCR::Topology | queryTopology ()=0 |
virtual HiCR::Topology | _deserializeTopology (const nlohmann::json &topology) const =0 |
Protected Member Functions | |
TopologyManager ()=default | |
Detailed Description
Encapsulates a HiCR Backend Device Manager.
The purpose of this class is to discover the computing topology for a given device type. E.g., if this is a backend for an NPU device and the system contains 8 such devices, it will discover an array of Device type of size 8.
Backends need to fulfill the abstract virtual functions described here, so that HiCR can detect hardware devices
Constructor & Destructor Documentation
◆ ~TopologyManager()
|
virtualdefault |
Default destructor
Reimplemented in HiCR::backend::hwloc::TopologyManager, HiCR::backend::ascend::TopologyManager, and HiCR::backend::opencl::TopologyManager.
◆ TopologyManager()
|
protecteddefault |
Protected default constructor used to build a new instance of this topology manager based on serialized information
- Note
- The instance created by this constructor should only be used to print/query the topology. It cannot be used to operate (memcpy, compute, etc).
Member Function Documentation
◆ _deserializeTopology()
|
pure virtual |
This function deserializes a JSON-encoded topology into a topology class with its constituent devices, as recognized by the called backend, and returns it
If the backend does not recognize a device in the encoded topology, it will not add it to the topology
- Parameters
-
[in] topology The JSON-encoded topology to deserialize
- Returns
- The deserialized topology containing only devices recognized by the backend
Implemented in HiCR::backend::ascend::TopologyManager, HiCR::backend::hwloc::TopologyManager, and HiCR::backend::opencl::TopologyManager.
◆ queryTopology()
|
pure virtual |
This function prompts the backend to perform the necessary steps to discover the system topology
In case of change in resource availability during runtime, users need to re-run this function to be able to see the changes.
- Returns
- The detected topology, as detected by the specific b ackend
Implemented in HiCR::backend::ascend::TopologyManager, HiCR::backend::hwloc::TopologyManager, and HiCR::backend::opencl::TopologyManager.
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/core/topologyManager.hpp
Generated by