diff options
author | Miao Wang <miaowang@google.com> | 2019-12-20 16:07:39 -0800 |
---|---|---|
committer | Xusong Wang <xusongw@google.com> | 2020-01-27 13:05:58 -0800 |
commit | 7b647483ebc7aeeac3208aa2db0a8e0fda305e6b (patch) | |
tree | 45242be8319feffabdc0aca969f15178d9fb98fa /nn/driver | |
parent | 8c662cbb81c83f718aa66e48d1733269bdacdb3f (diff) | |
download | ml-7b647483ebc7aeeac3208aa2db0a8e0fda305e6b.tar.gz |
Sync fence support in NNAPI
The following APIs are added to NNAPI:
- ANeuralNetworksEvent_createFromSyncFenceFd
- ANeuralNetworksEvent_getSyncFenceFd
- ANeuralNetworksExecution_startComputeWithDependencies
Bug: 142778241
Test: mm
Change-Id: I7bba64982c0d06e1224f5a71ee788a5044aac36a
Merged-In: I7bba64982c0d06e1224f5a71ee788a5044aac36a
(cherry picked from commit 991050faa2101656eca61c3acf0c98f8aa8cf106)
Diffstat (limited to 'nn/driver')
-rw-r--r-- | nn/driver/sample/SampleDriver.cpp | 6 | ||||
-rw-r--r-- | nn/driver/sample/SampleDriver.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/nn/driver/sample/SampleDriver.cpp b/nn/driver/sample/SampleDriver.cpp index f2a94e7b4..3d6690353 100644 --- a/nn/driver/sample/SampleDriver.cpp +++ b/nn/driver/sample/SampleDriver.cpp @@ -407,6 +407,12 @@ Return<void> SamplePreparedModel::executeSynchronously_1_3(const V1_3::Request& return Void(); } +Return<void> SamplePreparedModel::executeFenced(const hal::Request&, const hidl_vec<hidl_handle>&, + MeasureTiming, executeFenced_cb cb) { + // TODO(miaowang): implement me. + cb(ErrorStatus::DEVICE_UNAVAILABLE, hidl_handle(nullptr), nullptr); + return Void(); +} // BurstExecutorWithCache maps hidl_memory when it is first seen, and preserves // the mapping until either (1) the memory is freed in the runtime, or (2) the // burst object is destroyed. This allows for subsequent executions operating on diff --git a/nn/driver/sample/SampleDriver.h b/nn/driver/sample/SampleDriver.h index b4633458b..4aabe9c94 100644 --- a/nn/driver/sample/SampleDriver.h +++ b/nn/driver/sample/SampleDriver.h @@ -137,6 +137,9 @@ class SamplePreparedModel : public hal::IPreparedModel { const MQDescriptorSync<hal::V1_2::FmqRequestDatum>& requestChannel, const MQDescriptorSync<hal::V1_2::FmqResultDatum>& resultChannel, configureExecutionBurst_cb cb) override; + hal::Return<void> executeFenced(const hal::Request& request, + const hal::hidl_vec<hal::hidl_handle>& wait_for, + hal::MeasureTiming measure, executeFenced_cb callback) override; private: hal::Model mModel; |