diff options
-rw-r--r-- | delegate/src/armnn_delegate.cpp | 8 | ||||
-rw-r--r-- | src/armnn/WorkingMemHandle.hpp | 1 | ||||
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetwork.cpp | 5 | ||||
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetworkParams.cpp | 3 |
4 files changed, 11 insertions, 6 deletions
diff --git a/delegate/src/armnn_delegate.cpp b/delegate/src/armnn_delegate.cpp index 5fbc920a1e..e029e2c420 100644 --- a/delegate/src/armnn_delegate.cpp +++ b/delegate/src/armnn_delegate.cpp @@ -397,7 +397,7 @@ ArmnnSubgraph* ArmnnSubgraph::Create(TfLiteContext* tfLiteContext, 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 @@ TfLiteStatus ArmnnSubgraph::Invoke(TfLiteContext* tfLiteContext, TfLiteNode* tfL // 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; } diff --git a/src/armnn/WorkingMemHandle.hpp b/src/armnn/WorkingMemHandle.hpp index aaa9d593ee..9078a8d54c 100644 --- a/src/armnn/WorkingMemHandle.hpp +++ b/src/armnn/WorkingMemHandle.hpp @@ -119,7 +119,6 @@ public: private: using DifferenceType = std::vector<ITensorHandle*>::difference_type; NetworkId m_NetworkId; - std::shared_ptr<ProfilerImpl> m_Profiler; std::unordered_map<LayerBindingId, ITensorHandle*> m_InputHandleMap; std::unordered_map<LayerBindingId, ITensorHandle*> m_OutputHandleMap; diff --git a/tests/ExecuteNetwork/ExecuteNetwork.cpp b/tests/ExecuteNetwork/ExecuteNetwork.cpp index 66be8fd02a..db15872ad6 100644 --- a/tests/ExecuteNetwork/ExecuteNetwork.cpp +++ b/tests/ExecuteNetwork/ExecuteNetwork.cpp @@ -68,8 +68,7 @@ bool CheckInferenceTimeThreshold(const std::chrono::duration<double, std::milli> } #if defined(ARMNN_TFLITE_DELEGATE) -int TfLiteDelegateMainImpl(const ExecuteNetworkParams& params, const armnn::IRuntime::CreationOptions runtimeOptions, - const std::shared_ptr<armnn::IRuntime>& runtime = nullptr) +int TfLiteDelegateMainImpl(const ExecuteNetworkParams& params, const armnn::IRuntime::CreationOptions runtimeOptions) { using namespace tflite; @@ -867,7 +866,7 @@ int main(int argc, const char* argv[]) ExecuteNetworkParams::TfLiteExecutor::TfliteInterpreter) { #if defined(ARMNN_TF_LITE_DELEGATE) - return TfLiteDelegateMainImpl(ProgramOptions.m_ExNetParams, ProgramOptions.m_RuntimeOptions, runtime); + return TfLiteDelegateMainImpl(ProgramOptions.m_ExNetParams, ProgramOptions.m_RuntimeOptions); #else ARMNN_LOG(fatal) << "Not built with Arm NN Tensorflow-Lite delegate support."; return EXIT_FAILURE; diff --git a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp index 541430c421..b3d18cdfd1 100644 --- a/tests/ExecuteNetwork/ExecuteNetworkParams.cpp +++ b/tests/ExecuteNetwork/ExecuteNetworkParams.cpp @@ -250,7 +250,8 @@ armnnDelegate::DelegateOptions ExecuteNetworkParams::ToDelegateOptions() const options.m_ReduceFp32ToFp16 = m_EnableFp16TurboMode; options.m_ReduceFp32ToBf16 = m_EnableBf16TurboMode; options.m_Debug = m_PrintIntermediate; - + options.m_ProfilingEnabled = m_EnableProfiling; + delegateOptions.SetInternalProfilingParams(m_EnableProfiling, armnn::ProfilingDetailsMethod::DetailsWithEvents); options.m_shapeInferenceMethod = armnn::ShapeInferenceMethod::ValidateOnly; if (m_InferOutputShape) { |