neural_net: remove unused experimental API

Experimental API is not being used anymore, remove it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-09-29 11:53:38 +00:00
commit 34e16225eb
10 changed files with 0 additions and 288 deletions

View file

@ -1147,15 +1147,6 @@ Release Notes:
labels:
- "area: Modem"
"Drivers: Neural Networks":
status: odd fixes
collaborators:
- nashif
files:
- drivers/neural_net/
labels:
- "area: Neural Networks"
"Drivers: Regulators":
status: maintained
maintainers:

View file

@ -137,10 +137,6 @@ between major releases are available in the :ref:`zephyr_release_notes`.
- Stable
- 1.11
* - :ref:`gna_api`
- Experimental
- 1.14
* - :ref:`gpio_api`
- Stable
- 1.0

View file

@ -1,15 +0,0 @@
.. _gna_api:
Gaussian & Neural Accelerator (GNA)
###################################
Overview
********
The GNA API provides access to Intel's Gaussian Mixture Model and Neural Network
Accelerator (GNA).
API Reference
*************
.. doxygengroup:: gna_interface

View file

@ -29,7 +29,6 @@ Peripherals
edac/index.rst
flash.rst
fuel_gauge.rst
gna.rst
gpio.rst
hwinfo.rst
i2c_eeprom_target.rst

View file

@ -59,7 +59,6 @@ add_subdirectory_ifdef(CONFIG_MM_DRV mm)
add_subdirectory_ifdef(CONFIG_MODEM modem)
add_subdirectory_ifdef(CONFIG_NET_DRIVERS net)
add_subdirectory_ifdef(CONFIG_NET_L2_ETHERNET ethernet)
add_subdirectory_ifdef(CONFIG_NEURAL_NET_ACCEL neural_net)
add_subdirectory_ifdef(CONFIG_PECI peci)
add_subdirectory_ifdef(CONFIG_PINCTRL pinctrl)
add_subdirectory_ifdef(CONFIG_PM_CPU_OPS pm_cpu_ops)

View file

@ -55,7 +55,6 @@ source "drivers/misc/Kconfig"
source "drivers/mm/Kconfig"
source "drivers/modem/Kconfig"
source "drivers/net/Kconfig"
source "drivers/neural_net/Kconfig"
source "drivers/pcie/Kconfig"
source "drivers/peci/Kconfig"
source "drivers/pinctrl/Kconfig"

View file

@ -1,3 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
zephyr_library()

View file

@ -1,17 +0,0 @@
# Neural network accelerator driver configuration options
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
menuconfig NEURAL_NET_ACCEL
bool "Neural Network Accelerator drivers"
help
Enable support for Neural Network Accelerators
if NEURAL_NET_ACCEL
module = NEURAL_NET
module-str = neural_net
source "subsys/logging/Kconfig.template.log_config"
endif # NEURAL_NET

View file

@ -1,236 +0,0 @@
/*
* Copyright (c) 2018 Intel Corporation.
*
* Author: Sathish Kuttan <sathish.k.kuttan@intel.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief Public API header file for Intel GNA driver
*/
#ifndef __INCLUDE_GNA__
#define __INCLUDE_GNA__
/**
* @defgroup gna_interface GNA Interface
* @ingroup io_interfaces
* @{
*
* This file contains the driver APIs for Intel's
* Gaussian Mixture Model and Neural Network Accelerator (GNA)
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* GNA driver configuration structure.
* Currently empty.
*/
struct gna_config {
#ifdef __cplusplus
char no_empty_structs; /* technically a gcc C extension */
#endif
};
/**
* GNA Neural Network model header
* Describes the key parameters of the neural network model
*/
struct gna_model_header {
uint32_t labase_offset;
uint32_t model_size;
uint32_t gna_mode;
uint32_t layer_count;
uint32_t bytes_per_input;
uint32_t bytes_per_output;
uint32_t num_input_nodes;
uint32_t num_output_nodes;
uint32_t input_ptr_offset;
uint32_t output_ptr_offset;
uint32_t rw_region_size;
uint32_t input_scaling_factor;
uint32_t output_scaling_factor;
};
/**
* GNA Neural Network model information to be provided by application
* during model registration
*/
struct gna_model_info {
struct gna_model_header *header;
void *rw_region;
void *ro_region;
};
/**
* Request to perform inference on the given neural network model
*/
struct gna_inference_req {
void *model_handle;
void *input;
void *output;
void *intermediate;
};
/**
* Statistics of the inference operation returned after completion
*/
struct gna_inference_stats {
uint32_t total_cycles;
uint32_t stall_cycles;
uint32_t cycles_per_sec;
};
/**
* Result of an inference operation
*/
enum gna_result {
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,
};
/**
* Structure containing a response to the inference request
*/
struct gna_inference_resp {
enum gna_result result;
void *output;
size_t output_len;
struct gna_inference_stats stats;
};
/**
* @cond INTERNAL_HIDDEN
*
* Internal documentation. Skip in public documentation
*/
typedef int (*gna_callback)(struct gna_inference_resp *result);
typedef int (*gna_api_config)(const struct device *dev,
struct gna_config *cfg);
typedef int (*gna_api_register)(const struct device *dev,
struct gna_model_info *model,
void **model_handle);
typedef int (*gna_api_deregister)(const struct device *dev,
void *model_handle);
typedef int (*gna_api_infer)(const struct device *dev,
struct gna_inference_req *req,
gna_callback callback);
struct gna_driver_api {
gna_api_config configure;
gna_api_register register_model;
gna_api_deregister deregister_model;
gna_api_infer infer;
};
/**
* @endcond
*/
/**
* @brief Configure the GNA device.
*
* Configure the GNA device. The GNA device must be configured before
* registering a model or performing inference
*
* @param dev Pointer to the device structure for the driver instance.
* @param cfg Device configuration information
*
* @retval 0 If the configuration is successful
* @retval A negative error code in case of a failure.
*/
static inline int gna_configure(const struct device *dev,
struct gna_config *cfg)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->configure(dev, cfg);
}
/**
* @brief 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
*
* @param dev Pointer to the device structure for the driver instance.
* @param model Information about the neural network model
* @param model_handle Handle to the registered model if registration succeeds
*
* @retval 0 If registration of the model is successful.
* @retval A negative error code in case of a failure.
*/
static inline int gna_register_model(const struct device *dev,
struct gna_model_info *model,
void **model_handle)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->register_model(dev, model, model_handle);
}
/**
* @brief 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
*
* @param dev Pointer to the device structure for the driver instance.
* @param model Model handle output by gna_register_model API
*
* @retval 0 If de-registration of the model is successful.
* @retval A negative error code in case of a failure.
*/
static inline int gna_deregister_model(const struct device *dev, void *model)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->deregister_model(dev, model);
}
/**
* @brief 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
*
* @param dev Pointer to the device structure for the driver instance.
* @param req Information required to perform inference on a neural network
* @param callback A callback function to notify inference completion
*
* @retval 0 If the request is accepted
* @retval A negative error code in case of a failure.
*/
static inline int gna_infer(const struct device *dev,
struct gna_inference_req *req,
gna_callback callback)
{
const struct gna_driver_api *api =
(const struct gna_driver_api *)dev->api;
return api->infer(dev, req, callback);
}
#ifdef __cplusplus
}
#endif
/**
* @}
*/
#endif /* __INCLUDE_GNA__ */

View file

@ -43,7 +43,6 @@
/* drivers/espi_saf.h requires SoC specific header */
#include <zephyr/drivers/flash.h>
#include <zephyr/drivers/fpga.h>
#include <zephyr/drivers/gna.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/hwinfo.h>
#include <zephyr/drivers/i2c_emul.h>