Add additional parameters for NN Burst -- HAL
Adds deadline and loopTimeoutDuration to nn::IBurst::execute.
This CL additionally adds a test case for
IPreparedModel::configureExecutionBurst and adds the suffix "_H" to
the header guards that were missing "_H".
Bug: 180492058
Bug: 177267324
Test: mma
Test: NeuralNetworksTest_static
Change-Id: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
Merged-In: Ic9ba2fb9b4dee4e40d99ae91bb9555a58d0508d2
(cherry picked from commit bbbdb0d5f118efa8159c3cc98304208fd7631609)
diff --git a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
index eedf591..7a17f25 100644
--- a/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
+++ b/neuralnetworks/1.2/utils/src/ExecutionBurstController.cpp
@@ -276,7 +276,9 @@
}
nn::ExecutionResult<std::pair<std::vector<nn::OutputShape>, nn::Timing>>
-ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming measure) const {
+ExecutionBurstController::execute(const nn::Request& request, nn::MeasureTiming measure,
+ const nn::OptionalTimePoint& deadline,
+ const nn::OptionalDuration& loopTimeoutDuration) const {
// This is the first point when we know an execution is occurring, so begin to collect
// systraces. Note that the first point we can begin collecting systraces in
// ExecutionBurstServer is when the RequestChannelReceiver realizes there is data in the FMQ, so
@@ -289,7 +291,7 @@
version > nn::Version::ANDROID_Q) {
// fallback to another execution path if the packet could not be sent
if (kFallback) {
- return kFallback(request, measure);
+ return kFallback(request, measure, deadline, loopTimeoutDuration);
}
return NN_ERROR() << "Request object has features not supported by IBurst::execute";
}
@@ -323,7 +325,7 @@
if (!sendStatus.ok()) {
// fallback to another execution path if the packet could not be sent
if (kFallback) {
- return kFallback(request, measure);
+ return kFallback(request, measure, deadline, loopTimeoutDuration);
}
return NN_ERROR() << "Error sending FMQ packet: " << sendStatus.error();
}