summaryrefslogtreecommitdiffstats
path: root/neuralnetworks/1.0/Android.bp
diff options
context:
space:
mode:
authorMichael Butler <butlermichael@google.com>2017-09-22 13:26:12 -0700
committerSteven Moreland <smoreland@google.com>2017-10-03 18:01:29 +0000
commitcf22a57c1a05272d055b0deaa10094852dece797 (patch)
tree8a127c8dec7d61eb54c1c6b820467bc7832b4492 /neuralnetworks/1.0/Android.bp
parent7e0286404ac45f12802a485f4ce7f378df75b75c (diff)
downloadplatform_hardware_interfaces-cf22a57c1a05272d055b0deaa10094852dece797.tar.gz
platform_hardware_interfaces-cf22a57c1a05272d055b0deaa10094852dece797.tar.bz2
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 d7c3bbbf72..ba32d0c396 100644
--- a/neuralnetworks/1.0/Android.bp
+++ b/neuralnetworks/1.0/Android.bp
@@ -5,8 +5,9 @@ filegroup {
srcs: [
"types.hal",
"IDevice.hal",
- "IEvent.hal",
+ "IExecutionCallback.hal",
"IPreparedModel.hal",
+ "IPreparedModelCallback.hal",
],
}
@@ -20,8 +21,9 @@ genrule {
out: [
"android/hardware/neuralnetworks/1.0/types.cpp",
"android/hardware/neuralnetworks/1.0/DeviceAll.cpp",
- "android/hardware/neuralnetworks/1.0/EventAll.cpp",
+ "android/hardware/neuralnetworks/1.0/ExecutionCallbackAll.cpp",
"android/hardware/neuralnetworks/1.0/PreparedModelAll.cpp",
+ "android/hardware/neuralnetworks/1.0/PreparedModelCallbackAll.cpp",
],
}
@@ -40,16 +42,21 @@ genrule {
"android/hardware/neuralnetworks/1.0/BnHwDevice.h",
"android/hardware/neuralnetworks/1.0/BpHwDevice.h",
"android/hardware/neuralnetworks/1.0/BsDevice.h",
- "android/hardware/neuralnetworks/1.0/IEvent.h",
- "android/hardware/neuralnetworks/1.0/IHwEvent.h",
- "android/hardware/neuralnetworks/1.0/BnHwEvent.h",
- "android/hardware/neuralnetworks/1.0/BpHwEvent.h",
- "android/hardware/neuralnetworks/1.0/BsEvent.h",
+ "android/hardware/neuralnetworks/1.0/IExecutionCallback.h",
+ "android/hardware/neuralnetworks/1.0/IHwExecutionCallback.h",
+ "android/hardware/neuralnetworks/1.0/BnHwExecutionCallback.h",
+ "android/hardware/neuralnetworks/1.0/BpHwExecutionCallback.h",
+ "android/hardware/neuralnetworks/1.0/BsExecutionCallback.h",
"android/hardware/neuralnetworks/1.0/IPreparedModel.h",
"android/hardware/neuralnetworks/1.0/IHwPreparedModel.h",
"android/hardware/neuralnetworks/1.0/BnHwPreparedModel.h",
"android/hardware/neuralnetworks/1.0/BpHwPreparedModel.h",
"android/hardware/neuralnetworks/1.0/BsPreparedModel.h",
+ "android/hardware/neuralnetworks/1.0/IPreparedModelCallback.h",
+ "android/hardware/neuralnetworks/1.0/IHwPreparedModelCallback.h",
+ "android/hardware/neuralnetworks/1.0/BnHwPreparedModelCallback.h",
+ "android/hardware/neuralnetworks/1.0/BpHwPreparedModelCallback.h",
+ "android/hardware/neuralnetworks/1.0/BsPreparedModelCallback.h",
],
}