Skip to content

Accelerator

#include <qbruntime/acc.h>

class mobilint::Accelerator

Represents an accelerator, i.e., an NPU, used for executing models.

Static functions

Member Description
create ×3 Creates an Accelerator object for executing models, using device number 0.

create

static std::unique_ptr<Accelerator> create(StatusCode &sc)

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

  • sc [out] — Reference to a StatusCode that will be updated with the result of the creation.

Returns

A unique pointer to the created Accelerator object.

static std::unique_ptr<Accelerator> create(int dev_no, StatusCode &sc)

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.
  • sc [out] — Reference to a StatusCode that will be updated with the result of the creation.

Returns

A unique pointer to the created Accelerator object.

static std::unique_ptr<Accelerator> create(int dev_no, bool verbose, StatusCode &sc)

Member functions

Member Description
Accelerator ×2
operator= ×2

Accelerator

Accelerator(const Accelerator &other)=delete
Accelerator(Accelerator &&other) noexcept

operator=

Accelerator & operator=(const Accelerator &rhs)=delete
Accelerator & operator=(Accelerator &&rhs) noexcept