aboutsummaryrefslogtreecommitdiff
path: root/include/armnn/IProfiler.hpp
blob: 5e6f5087ca6a85b5eb2714c6fb40c965f5442354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#pragma once

#include <iostream>

namespace armnn
{

class IProfiler
{
public:
    /// Enables/disables profiling for this profiler.
    /// @param [in] enableProfiling A flag that indicates whether profiling should be enabled or not.
    virtual void EnableProfiling(bool enableProfiling) = 0;

    /// Checks whether profiling is enabled.
    /// Profiling is disabled by default.
    /// @return true if profiling is enabled, false otherwise.
    virtual bool IsProfilingEnabled() = 0;

    /// Analyzes the tracked events and writes the results to the given output stream.
    /// Please refer to the configuration variables in Profiling.cpp to customize the information written.
    /// @param [out] outStream The stream where to write the profiling results to.
    virtual void AnalyzeEventsAndWriteResults(std::ostream& outStream) const = 0;

    /// Print stats for events in JSON Format to the given output stream.
    /// @param [out] outStream The stream where to write the profiling results to.
    virtual void Print(std::ostream& outStream) const = 0;

protected:
    ~IProfiler() {}
};

} // namespace armnn