NNAPI Concurrent Query Management -- HAL and VTS update
The NNAPI requires requests on a model to be asynchronously
processed. This CL implements a basic Event that can later
be used to block the runtime thread until the asynchronous
request has completed.
Bug: 63905942
Test: VtsHalNeuralnetworksV1_0TargetTest (32-bit, 64-bit) with sample driver enabled by cherry-pick
frameworks/ml/nn/runtime/test with and without sample driver enabled
Change-Id: Ie27a574aaaac312e7cbb731750f9c06278357a1c
diff --git a/neuralnetworks/1.0/IPreparedModel.hal b/neuralnetworks/1.0/IPreparedModel.hal
index 566d6ac..428ddc7 100644
--- a/neuralnetworks/1.0/IPreparedModel.hal
+++ b/neuralnetworks/1.0/IPreparedModel.hal
@@ -18,8 +18,9 @@
package android.hardware.neuralnetworks@1.0;
+import IEvent;
+
interface IPreparedModel {
- // TODO: The execution is synchronous. Change that to have a callback on completion.
// Multiple threads can call this execute function concurrently.
- execute(Request request) generates(bool success);
+ execute(Request request, IEvent event) generates(bool success);
};