summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Butler2017-09-22 15:26:12 -0500
committerSteven Moreland2017-10-03 13:01:29 -0500
commitcf22a57c1a05272d055b0deaa10094852dece797 (patch)
tree8a127c8dec7d61eb54c1c6b820467bc7832b4492 /neuralnetworks/1.0/Android.bp
parent7e0286404ac45f12802a485f4ce7f378df75b75c (diff)
downloadplatform-hardware-interfaces-cf22a57c1a05272d055b0deaa10094852dece797.tar.gz
platform-hardware-interfaces-cf22a57c1a05272d055b0deaa10094852dece797.tar.xz
platform-hardware-interfaces-cf22a57c1a05272d055b0deaa10094852dece797.zip
NNAPI HAL: Change IEvent to explicit callbacks
IEvent was a synchronization primitive which caused some confusion in the interface. Originally the event object was paired with an asynchronous task, and the asynchronous task would signal this event when the corresponding output was ready to be used. In the case of IDevice::prepareModel, the function call would return an IPreparedModel object that was not guaranteed to be prepared until the runtime had returned from waiting on the corresponding event object. The event object has been changed to two explicit callbacks-- IPreparedModelCallback and IExecutionCallback. Now, IDevice::prepareModel no longer returns an unfinished IPreparedModel; instead, it will pass the IPreparedModel object to the runtime through IPreparedModelCallback::notify. When the runtime retreives the IPreparedModel object, the asynchronous task has already finished preparing the model. The two callbacks are used for different purposes. Each has its own version of notify to pass the data back to the runtime: * IPreparedModelCallback::notify(ErrorStatus, IPreparedModel) * IExecutionCallback::notify(ErrorStatus) Bug: 63905942 Test: mm, vts, ml/nn/runtime/tests Change-Id: I0c88cd262ba762e0af15e9da31ebe813a5d150b2
Diffstat (limited to 'neuralnetworks/1.0/Android.bp')
-rw-r--r--neuralnetworks/1.0/Android.bp21
1 files changed, 14 insertions, 7 deletions
diff --git a/neuralnetworks/1.0/Android.bp b/neuralnetworks/1.0/Android.bp
index d7c3bbbf..ba32d0c3 100644
--- a/neuralnetworks/1.0/Android.bp
+++ b/neuralnetworks/1.0/Android.bp
@@ -5,8 +5,9 @@ filegroup {
5 srcs: [ 5 srcs: [
6 "types.hal", 6 "types.hal",
7 "IDevice.hal", 7 "IDevice.hal",
8 "IEvent.hal", 8 "IExecutionCallback.hal",
9 "IPreparedModel.hal", 9 "IPreparedModel.hal",
10 "IPreparedModelCallback.hal",
10 ], 11 ],
11} 12}
12 13
@@ -20,8 +21,9 @@ genrule {
20 out: [ 21 out: [
21 "android/hardware/neuralnetworks/1.0/types.cpp", 22 "android/hardware/neuralnetworks/1.0/types.cpp",
22 "android/hardware/neuralnetworks/1.0/DeviceAll.cpp", 23 "android/hardware/neuralnetworks/1.0/DeviceAll.cpp",
23 "android/hardware/neuralnetworks/1.0/EventAll.cpp", 24 "android/hardware/neuralnetworks/1.0/ExecutionCallbackAll.cpp",
24 "android/hardware/neuralnetworks/1.0/PreparedModelAll.cpp", 25 "android/hardware/neuralnetworks/1.0/PreparedModelAll.cpp",
26 "android/hardware/neuralnetworks/1.0/PreparedModelCallbackAll.cpp",
25 ], 27 ],
26} 28}
27 29
@@ -40,16 +42,21 @@ genrule {
40 "android/hardware/neuralnetworks/1.0/BnHwDevice.h", 42 "android/hardware/neuralnetworks/1.0/BnHwDevice.h",
41 "android/hardware/neuralnetworks/1.0/BpHwDevice.h", 43 "android/hardware/neuralnetworks/1.0/BpHwDevice.h",
42 "android/hardware/neuralnetworks/1.0/BsDevice.h", 44 "android/hardware/neuralnetworks/1.0/BsDevice.h",
43 "android/hardware/neuralnetworks/1.0/IEvent.h", 45 "android/hardware/neuralnetworks/1.0/IExecutionCallback.h",
44 "android/hardware/neuralnetworks/1.0/IHwEvent.h", 46 "android/hardware/neuralnetworks/1.0/IHwExecutionCallback.h",
45 "android/hardware/neuralnetworks/1.0/BnHwEvent.h", 47 "android/hardware/neuralnetworks/1.0/BnHwExecutionCallback.h",
46 "android/hardware/neuralnetworks/1.0/BpHwEvent.h", 48 "android/hardware/neuralnetworks/1.0/BpHwExecutionCallback.h",
47 "android/hardware/neuralnetworks/1.0/BsEvent.h", 49 "android/hardware/neuralnetworks/1.0/BsExecutionCallback.h",
48 "android/hardware/neuralnetworks/1.0/IPreparedModel.h", 50 "android/hardware/neuralnetworks/1.0/IPreparedModel.h",
49 "android/hardware/neuralnetworks/1.0/IHwPreparedModel.h", 51 "android/hardware/neuralnetworks/1.0/IHwPreparedModel.h",
50 "android/hardware/neuralnetworks/1.0/BnHwPreparedModel.h", 52 "android/hardware/neuralnetworks/1.0/BnHwPreparedModel.h",
51 "android/hardware/neuralnetworks/1.0/BpHwPreparedModel.h", 53 "android/hardware/neuralnetworks/1.0/BpHwPreparedModel.h",
52 "android/hardware/neuralnetworks/1.0/BsPreparedModel.h", 54 "android/hardware/neuralnetworks/1.0/BsPreparedModel.h",
55 "android/hardware/neuralnetworks/1.0/IPreparedModelCallback.h",
56 "android/hardware/neuralnetworks/1.0/IHwPreparedModelCallback.h",
57 "android/hardware/neuralnetworks/1.0/BnHwPreparedModelCallback.h",
58 "android/hardware/neuralnetworks/1.0/BpHwPreparedModelCallback.h",
59 "android/hardware/neuralnetworks/1.0/BsPreparedModelCallback.h",
53 ], 60 ],
54} 61}
55 62