diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-10 17:34:20 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-11 12:20:47 +0000 |
commit | 992d6dc57d8463729910b688f0fb5825d0d3ccf2 (patch) | |
tree | 87b504d174848169550240f300f359dd57aaa1fd /src/armnn/Profiling.hpp | |
parent | 1f0ff35236c1dd05954735f7fed9c2807770479e (diff) | |
download | armnn-992d6dc57d8463729910b688f0fb5825d0d3ccf2.tar.gz |
IVGCVSW-2454 Refactor ArmNN to support pluggable backends from a separate
code base
* Made the virtual functions in ILayerSupport.hpp pure
* Created a LayerSupportBase class with the default implementation of
the interface
* Made the backend layer support classes inherit from the base
class, instead of directly from the interface
* Refactored the profiler and the profiling event classes to use
the BackendId instead of the Compute
* Implemented a proper MemCopy support method
* Changed Compute to BackendId in the profiling API and objects
* Removed static references to pluggable backends
!android-nn-driver:492
Change-Id: Id6332b5f48c980819e0a09adc818d1effd057296
Diffstat (limited to 'src/armnn/Profiling.hpp')
-rw-r--r-- | src/armnn/Profiling.hpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/armnn/Profiling.hpp b/src/armnn/Profiling.hpp index ef6bfd5ffb..0fb60d346a 100644 --- a/src/armnn/Profiling.hpp +++ b/src/armnn/Profiling.hpp @@ -35,7 +35,7 @@ public: // Marks the beginning of a user-defined event. // No attempt will be made to copy the name string: it must be known at compile time. - Event* BeginEvent(Compute compute, const std::string& name, std::vector<InstrumentPtr>&& instruments); + Event* BeginEvent(const BackendId& backendId, const std::string& name, std::vector<InstrumentPtr>&& instruments); // Marks the end of a user-defined event. void EndEvent(Event* event); @@ -117,7 +117,7 @@ public: using InstrumentPtr = std::unique_ptr<Instrument>; template<typename... Args> - ScopedProfilingEvent(Compute compute, const std::string& name, Args... args) + ScopedProfilingEvent(const BackendId& backendId, const std::string& name, Args... args) : m_Event(nullptr) , m_Profiler(ProfilerManager::GetInstance().GetProfiler()) { @@ -126,7 +126,7 @@ public: std::vector<InstrumentPtr> instruments(0); instruments.reserve(sizeof...(args)); //One allocation ConstructNextInVector(instruments, args...); - m_Event = m_Profiler->BeginEvent(compute, name, std::move(instruments)); + m_Event = m_Profiler->BeginEvent(backendId, name, std::move(instruments)); } } @@ -152,15 +152,15 @@ private: ConstructNextInVector(instruments, args...); } - Event* m_Event; ///< Event to track - Profiler* m_Profiler; ///< Profiler used + Event* m_Event; ///< Event to track + Profiler* m_Profiler; ///< Profiler used }; } // namespace armnn // The event name must be known at compile time -#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(compute, /*name,*/ ...) \ - armnn::ScopedProfilingEvent e_##__FILE__##__LINE__(compute, /*name,*/ __VA_ARGS__); +#define ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, /*name,*/ ...) \ + armnn::ScopedProfilingEvent e_##__FILE__##__LINE__(backendId, /*name,*/ __VA_ARGS__); -#define ARMNN_SCOPED_PROFILING_EVENT(compute, name) \ - ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(compute, name, armnn::WallClockTimer()) +#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name) \ + ARMNN_SCOPED_PROFILING_EVENT_WITH_INSTRUMENTS(backendId, name, armnn::WallClockTimer()) |