NNAPI narrow evaluation for P -- HAL

We have determined that for Android P it is sufficient to have a
mechanism for a developer to specify on a per-model basis that it is
acceptable for FLOAT32 operations to be carried out as if they were
FLOAT16 operations. This CL extends the model to include information on
these precision requirements.

Bug: 63911257
Test: mm
Test: NeuralNetworksTest
Test: VtsHalNeuralnetworksV1_0TargetTest

Merged-In: I5331e69c05c20c588035897322a6c7dceca374a0
Change-Id: I5331e69c05c20c588035897322a6c7dceca374a0
(cherry picked from commit 7ffe78ba76)
This commit is contained in:
Michael Butler
2018-02-13 18:56:49 -08:00
committed by Miao Wang
parent 4862d612ad
commit e0d9b167a6

View File

@@ -330,4 +330,12 @@ struct Model {
* equals OperandLifeTime::CONSTANT_REFERENCE.
*/
vec<memory> pools;
/**
* 'true' indicates TENSOR_FLOAT32 may be calculated with range and/or
* precision as low as that of the IEEE 754 16-bit floating-point format.
* 'false' indicates TENSOR_FLOAT32 must be calculated using at least the
* range and precision of the IEEE 754 32-bit floating-point format.
*/
bool relaxComputationFloat32toFloat16;
};