xref: /aosp_15_r20/external/executorch/backends/qualcomm/runtime/backends/QnnSysImplementation.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/Logging.h>
11 #include <executorch/backends/qualcomm/runtime/backends/QnnSysFunctionInterface.h>
12 
13 #include <string>
14 namespace executorch {
15 namespace backends {
16 namespace qnn {
17 class QnnSystemImplementation {
18  public:
QnnSystemImplementation(std::string lib_path)19   explicit QnnSystemImplementation(std::string lib_path)
20       : lib_path_(std::move(lib_path)){};
21 
22   executorch::runtime::Error Load();
23 
24   const QnnSystemInterface& GetQnnSystemInterface() const;
25 
26   executorch::runtime::Error Unload();
27 
28  private:
29   static constexpr const int required_num_providers_{1};
30 
31   std::string lib_path_;
32   QnnSystemInterface qnn_sys_interface_;
33   void* lib_handle_{nullptr};
34 };
35 } // namespace qnn
36 } // namespace backends
37 } // namespace executorch
38