IVGCVSW-5879 Fix problems with using internal profiling from delegate.

* Pass through the value of m_EnableProfiling from Executenetwork to
  DelegateOptions.
* If internal profiling is enabled print it out from inside the delegate.
* Remove an unnecessary ProfilerImpl instance from WorkingMemhandle.hpp
* Remove an unnecessary parameter from TfLiteDelegateMainImpl in
  ExecuteNetwork.

Signed-off-by: Colm Donelan <colm.donelan@arm.com>
Change-Id: Ia1d4b1eb3a05ca5b4d80cc39e138c7fac182d948
diff --git a/delegate/src/armnn_delegate.cpp b/delegate/src/armnn_delegate.cpp
index 5fbc920..e029e2c 100644
--- a/delegate/src/armnn_delegate.cpp
+++ b/delegate/src/armnn_delegate.cpp
@@ -397,7 +397,7 @@
                                                          networkProperties);
         if (loadingStatus != armnn::Status::Success)
         {
-            // Optimize failed
+            // Network load failed.
             throw armnn::Exception("TfLiteArmnnDelegate: Network could not be loaded:" + errorMessage);
         }
     }
@@ -457,6 +457,12 @@
 
     // Run graph
     auto status = m_Runtime->EnqueueWorkload(m_NetworkId, inputTensors, outputTensors);
+    // The delegate holds its own Arm NN runtime so this is our last chance to print internal profiling data.
+    std::shared_ptr<armnn::IProfiler> profiler = m_Runtime->GetProfiler(m_NetworkId);
+    if (profiler && profiler->IsProfilingEnabled())
+    {
+        profiler->Print(std::cout);
+    }
     return (status == armnn::Status::Success) ? kTfLiteOk : kTfLiteError;
 }