IVGCVSW-6801 Remove the call to sync after EnqueueWorkload if we didn't import
Signed-off-by: David Monahan <David.Monahan@arm.com>
Change-Id: I0c79518fb0d849809d972241ce02653259d4f8c4
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index 1abe0f3..a913681 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -630,15 +630,18 @@
auto status = loadedNetwork->EnqueueWorkload(inputTensors, outputTensors,
preImportedInputIds, preImportedOutputIds);
+
+ // Check if we imported, if not there's no need to call the After EnqueueWorkload events
+ if (!preImportedInputIds.empty() || !preImportedOutputIds.empty())
+ {
+ // Call After EnqueueWorkload events
+ for (auto&& context : m_BackendContexts)
+ {
+ context.second->AfterEnqueueWorkload(networkId);
+ }
+ }
ARMNN_LOG(info) << "Execution time: " << std::setprecision(2)
<< std::fixed << armnn::GetTimeDuration(startTime).count() << " ms.";
-
- // Call After EnqueueWorkload events
- for (auto&& context : m_BackendContexts)
- {
- context.second->AfterEnqueueWorkload(networkId);
- }
-
return status;
}