xref: /aosp_15_r20/external/executorch/backends/qualcomm/runtime/backends/QnnProfiler.h (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Qualcomm Innovation Center, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 #pragma once
9 
10 #include <executorch/backends/qualcomm/runtime/QnnExecuTorch.h>
11 #include <executorch/backends/qualcomm/runtime/backends/QnnBackendCommon.h>
12 #include <executorch/backends/qualcomm/runtime/backends/QnnImplementation.h>
13 #include <executorch/runtime/core/event_tracer_hooks_delegate.h>
14 #include "QnnProfile.h"
15 namespace executorch {
16 namespace backends {
17 namespace qnn {
18 
19 class QnnProfile {
20  public:
21   explicit QnnProfile(
22       const QnnImplementation& implementation,
23       QnnBackend* backend,
24       const QnnExecuTorchProfileLevel& profile_level);
25   ~QnnProfile();
26   Qnn_ErrorHandle_t ProfileData(executorch::runtime::EventTracer* event_tracer);
27 
GetHandle()28   Qnn_ProfileHandle_t GetHandle() {
29     return handle_;
30   }
31 
32  private:
33   Qnn_ProfileHandle_t handle_;
34   const QnnImplementation& implementation_;
35   QnnBackend* backend_;
36 };
37 } // namespace qnn
38 } // namespace backends
39 } // namespace executorch
40