This file contains the driver APIs for Intel's Gaussian Mixture Model and Neural Network Accelerator (GNA)
◆ gna_result
#include <include/zephyr/drivers/gna.h>
Result of an inference operation
| Enumerator |
|---|
| GNA_RESULT_INFERENCE_COMPLETE | |
| GNA_RESULT_SATURATION_OCCURRED | |
| GNA_RESULT_OUTPUT_BUFFER_FULL_ERROR | |
| GNA_RESULT_PARAM_OUT_OF_RANGE_ERROR | |
| GNA_RESULT_GENERIC_ERROR | |
◆ gna_configure()
#include <include/zephyr/drivers/gna.h>
Configure the GNA device.
Configure the GNA device. The GNA device must be configured before registering a model or performing inference
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| cfg | Device configuration information |
- Return values
-
| 0 | If the configuration is successful |
| A | negative error code in case of a failure. |
◆ gna_deregister_model()
| static int gna_deregister_model |
( |
const struct device * |
dev, |
|
|
void * |
model |
|
) |
| |
|
inlinestatic |
#include <include/zephyr/drivers/gna.h>
De-register a previously registered neural network model.
De-register a previously registered neural network model from the GNA device De-registration may be done to free up memory for registering another model Once de-registered, the model can no longer be used to perform inference
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| model | Model handle output by gna_register_model API |
- Return values
-
| 0 | If de-registration of the model is successful. |
| A | negative error code in case of a failure. |
◆ gna_infer()
#include <include/zephyr/drivers/gna.h>
Perform inference on a model with input vectors.
Make an inference request on a previously registered model with an of input data vector A callback is provided for notification of inference completion
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| req | Information required to perform inference on a neural network |
| callback | A callback function to notify inference completion |
- Return values
-
| 0 | If the request is accepted |
| A | negative error code in case of a failure. |
◆ gna_register_model()
| static int gna_register_model |
( |
const struct device * |
dev, |
|
|
struct gna_model_info * |
model, |
|
|
void ** |
model_handle |
|
) |
| |
|
inlinestatic |
#include <include/zephyr/drivers/gna.h>
Register a neural network model.
Register a neural network model with the GNA device A model needs to be registered before it can be used to perform inference
- Parameters
-
| dev | Pointer to the device structure for the driver instance. |
| model | Information about the neural network model |
| model_handle | Handle to the registered model if registration succeeds |
- Return values
-
| 0 | If registration of the model is successful. |
| A | negative error code in case of a failure. |