1 // 2 // Copyright © 2017 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include <iostream> 9 10 namespace armnn 11 { 12 13 class IProfiler 14 { 15 public: 16 /// Enables/disables profiling for this profiler. 17 /// @param [in] enableProfiling A flag that indicates whether profiling should be enabled or not. 18 virtual void EnableProfiling(bool enableProfiling) = 0; 19 20 /// Checks whether profiling is enabled. 21 /// Profiling is disabled by default. 22 /// @return true if profiling is enabled, false otherwise. 23 virtual bool IsProfilingEnabled() = 0; 24 25 /// Analyzes the tracked events and writes the results to the given output stream. 26 /// Please refer to the configuration variables in Profiling.cpp to customize the information written. 27 /// @param [out] outStream The stream where to write the profiling results to. 28 virtual void AnalyzeEventsAndWriteResults(std::ostream& outStream) const = 0; 29 30 /// Print stats for events in JSON Format to the given output stream. 31 /// @param [out] outStream The stream where to write the profiling results to. 32 virtual void Print(std::ostream& outStream) const = 0; 33 34 protected: ~IProfiler()35 ~IProfiler() {} 36 }; 37 38 } // namespace armnn 39