IVGCVSW-6747 Call Cl sync after EnqueueWorkload

 * Add AfterEnqueueWorkload to IBackendContext
 * Implement AfterEnqueueWorkload in ClBackendContext to call Cl sync
 * Set allocated data on outputhandler only once
 * Handle PreImportedHandles and CurImportedId the same way as Async

Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com>
Change-Id: I9f59d57e298d4a494569faec3078d66af799f77b
diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp
index 95fb8a3..1abe0f3 100644
--- a/src/armnn/Runtime.cpp
+++ b/src/armnn/Runtime.cpp
@@ -242,6 +242,7 @@
                                            profiling::LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS);
             }
         }
+
         if (m_LoadedNetworks.erase(networkId) == 0)
         {
             ARMNN_LOG(warning) << "WARNING: RuntimeImpl::UnloadNetwork(): " << networkId << " not found!";
@@ -632,6 +633,12 @@
     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;
 }