aboutsummaryrefslogtreecommitdiff
path: root/python/pyarmnn/src/pyarmnn/swig/modules/armnn_profiler.i
blob: 929a7a0006bc151476704dfd43e9fd47298ab620 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
%{
#include "armnn/IProfiler.hpp"
%}

namespace armnn
{

%feature("docstring",
"
Interface for profiling Arm NN. See `IRuntime.GetProfiler`.

IProfiler object allows you to enable profiling and get various profiling results.

") IProfiler;
%nodefaultctor IProfiler;
%nodefaultdtor IProfiler;
class IProfiler
{
public:

   %feature("docstring",
    "
    Sets the profiler to start/stop profiling.

    Args:
        enableProfiling (bool): Flag to enable/disable profiling.

    ") EnableProfiling;

  void EnableProfiling(bool enableProfiling);

  %feature("docstring",
    "
    Checks if profiling is enabled.

    Returns:
        bool: If profiling is enabled or not.

    ") IsProfilingEnabled;

  bool IsProfilingEnabled();
};

%extend IProfiler {

   %feature("docstring",
   "
   Gets the string value of the profiling events analysis log.

   Returns:
       str: The profiling events analysis log.

   ") event_log;

   std::string event_log()
   {
       std::ostringstream oss;
       $self->AnalyzeEventsAndWriteResults(oss);
       return oss.str();
   }

   %feature("docstring",
   "
   Gets the profiling log as the JSON string.

   Returns:
       str: Profiling log as JSON formatted string.

   ") as_json;

   std::string as_json()
   {
       std::ostringstream oss;
       $self->Print(oss);
       return oss.str();
   }
}
}