platform_hardware_interfaces/neuralnetworks
David Gross 8c0a48bceb Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal
There are certain pieces of NeuralNetworks.h and of our various *.hal
files that ought to be kept in sync -- most notably the operand type
and operation type definitions and descriptions in our
NeuralNetworks.h and types.hal files.  To avoid having to do this
manually, a tool can be employed.

The old solution to this problem is sync_enums_to_hal.py, which parses
the existing NeuralNetworks.h and types.hal files, and then rewrites
the types.hal files: It identifies the operand type and operation type
portions of the files, and in the types.hal files replaces them with
transformed versions of the portions from NeuralNetworks.h.  This
approach is brittle -- it is very sensitive to the structure of the
files, as was recognized when this tool was created.  Changes to those
files since the script was last updated essentially broke the script,
as noted in http://b/140132458.

The new solution employs a new tool generate_api.py to combine a
single "specification file" with one "template file" per API file
(NeuralNetworks.h or types.hal) to produce that API file.  The script
generate_api.sh invokes generate_api.py once per API file, passing
appropriate arguments.  See frameworks/ml/nn/tools/api/README.md for
more details.

In the process of combining information from NeuralNetworks.h and
*/types.hal, some formatting, syntactic, and semantic changes have
been made to those files.  For example:
- types.hal files no longer refer to API levels or (similarly)
  to HAL versions other than earlier HAL versions

Bug: 130169064
Bug: 140132458

Test: cd neuralnetworks ; mma

Change-Id: Iceb38effc2c7e6c32344e49225b85256144c0945
Merged-In: Iceb38effc2c7e6c32344e49225b85256144c0945
(cherry picked from commit 2cae5c8b01)
2019-10-09 14:18:06 +01:00
..
1.0 Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal 2019-10-09 14:18:06 +01:00
1.1 Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal 2019-10-09 14:18:06 +01:00
1.2 Replace sync_enums_to_hal.py with generate_api.{py,sh} and regenerate */types.hal 2019-10-09 14:18:06 +01:00
README Add README to NeuralNetworks HAL 2018-03-05 12:59:35 -08:00
TEST_MAPPING Change NNAPI VTS to use TEST_P to iterate across all service instances 2019-09-20 11:20:48 -07:00

NeuralNetworks sample driver implementation is located at
frameworks/ml/nn/driver/sample.