From 71007e4e16999ca96ab80941ca021b86342668d6 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Wed, 24 Oct 2018 17:26:17 +0100 Subject: IVGCVSW-2059: Remove CL-specific code from Profiler Change-Id: I279986b83c7a38b6d395f8a496382ffaebb9ed08 --- src/armnn/Profiling.cpp | 23 ----------------------- src/armnn/Profiling.hpp | 4 ---- 2 files changed, 27 deletions(-) diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp index b749c80004..4caa31905c 100644 --- a/src/armnn/Profiling.cpp +++ b/src/armnn/Profiling.cpp @@ -9,10 +9,6 @@ #include #endif -#if ARMCOMPUTECL_ENABLED -#include -#endif - #include #include #include @@ -42,12 +38,6 @@ constexpr bool g_AggregateProfilingEventsByInference = true; // It can be convenient for local tests. constexpr bool g_WriteReportToStdOutOnProfilerDestruction = false; -// Whether events denoting operations running on the GPU should force a sync before/after the event. -// This is hardcoded to true for now as the profiling timings are not very useful without it. -#if ARMCOMPUTECL_ENABLED -constexpr bool g_ProfilingForceGpuSync = true; -#endif - Measurement FindMeasurement(const std::string& name, const Event* event) { @@ -206,9 +196,6 @@ void Profiler::EnableProfiling(bool enableProfiling) Event* Profiler::BeginEvent(Compute compute, const std::string& label, std::vector&& instruments) { - // We need to sync just before the begin event to not include time before the period we want to time. - WaitForDevice(compute); - Event* parent = m_Parents.empty() ? nullptr : m_Parents.top(); m_EventSequence.push_back(std::make_unique(label, this, parent, compute, std::move(instruments))); Event* event = m_EventSequence.back().get(); @@ -478,16 +465,6 @@ void Profiler::AnalyzeEventsAndWriteResults(std::ostream& outStream) const } } -void Profiler::WaitForDevice(Compute compute) const -{ -#if ARMCOMPUTECL_ENABLED - if(compute == Compute::GpuAcc && g_ProfilingForceGpuSync) - { - arm_compute::CLScheduler::get().sync(); - } -#endif -} - std::uint32_t Profiler::GetEventColor(Compute compute) const { switch(compute) diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp index 758b753386..ef6bfd5ffb 100644 --- a/src/armnn/Profiling.hpp +++ b/src/armnn/Profiling.hpp @@ -74,10 +74,6 @@ private: uint32_t m_Count; }; - // Waits for a compute device to finish working to guarantee correct timings. - // Currently used exclusively when emitting profiling events denoting GPU work. - void WaitForDevice(Compute compute) const; - template void AnalyzeEventSequenceAndWriteResults(EventIterType first, EventIterType last, std::ostream& outStream) const; -- cgit v1.2.1