Accelerator Class Reference#
|
Runtime Library v0.30
Mobilint SDK qb
|
mobilint::Accelerator Class Reference
Represents an accelerator, i.e., an NPU, used for executing models. More...
#include <acc.h>
Public Member Functions | |
| Accelerator (const Accelerator &other)=delete | |
| Accelerator (Accelerator &&other) noexcept | |
| Accelerator & | operator= (const Accelerator &rhs)=delete |
| Accelerator & | operator= (Accelerator &&rhs) noexcept |
| ~Accelerator () | |
| Destroys the Accelerator object and releases resources. | |
| std::vector< CoreId > | getAvailableCores () const |
| Retrieves a list of available NPU cores. | |
Static Public Member Functions | |
| static std::unique_ptr< Accelerator > | create (StatusCode &sc) |
| Creates an Accelerator object for executing models, using device number 0. | |
| static std::unique_ptr< Accelerator > | create (int dev_no, StatusCode &sc) |
| Creates an Accelerator object for a specific device. | |
| static std::unique_ptr< Accelerator > | create (int dev_no, bool verbose, StatusCode &sc) |
Friends | |
| class | Model |
| class | AsyncModel |
Detailed Description
Represents an accelerator, i.e., an NPU, used for executing models.
Member Function Documentation
◆ create() [1/3]
|
static |
Creates an Accelerator object for executing models, using device number 0.
This function is useful when only one device is attached, in which case the default device (device 0) will be used.
- Parameters
-
[out] sc Reference to a StatusCode that will be updated with the result of the creation.
- Returns
- A unique pointer to the created Accelerator object.
◆ create() [2/3]
|
static |
Creates an Accelerator object for a specific device.
The dev_no parameter represents the device number. For example, on Linux, if an ARIES NPU is attached as /dev/aries0, the device number is 0.
- Parameters
-
dev_no The device number to associate with the Accelerator. [out] sc Reference to a StatusCode that will be updated with the result of the creation.
- Returns
- A unique pointer to the created Accelerator object.
◆ create() [3/3]
|
static |
- Deprecated
- Use std::unique_ptr<Accelerator> create(int dev_no, StatusCode& sc) instead.
◆ getAvailableCores()
| std::vector< CoreId > mobilint::Accelerator::getAvailableCores | ( | ) | const |
Retrieves a list of available NPU cores.
An available core is one that can be allocated for newly created Model objects.
- Note
- Availability checks are only supported on Linux. On Windows, this function returns all NPU cores without checking availability.
- Returns
- A vector containing the IDs of available cores.
Friends And Related Symbol Documentation
◆ Model
◆ AsyncModel
The documentation for this class was generated from the following file:
Generated by