option.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #pragma once
  15. namespace ultra_infer {
  16. namespace rknpu2 {
  17. typedef enum _rknpu2_cpu_name {
  18. RK356X = 0, /* run on RK356X. */
  19. RK3588 = 1, /* default,run on RK3588. */
  20. UNDEFINED,
  21. } CpuName;
  22. /* The specification of NPU core setting.It has the following choices :
  23. * RKNN_NPU_CORE_AUTO : Referring to automatic mode, meaning that it will
  24. * select the idle core inside the NPU.
  25. * RKNN_NPU_CORE_0 : Running on the NPU0 core.
  26. * RKNN_NPU_CORE_1: Running on the NPU1 core.
  27. * RKNN_NPU_CORE_2: Running on the NPU2 core.
  28. * RKNN_NPU_CORE_0_1: Running on both NPU0 and NPU1 core simultaneously.
  29. * RKNN_NPU_CORE_0_1_2: Running on both NPU0, NPU1 and NPU2 simultaneously.
  30. */
  31. typedef enum _rknpu2_core_mask {
  32. RKNN_NPU_CORE_AUTO = 0,
  33. RKNN_NPU_CORE_0 = 1,
  34. RKNN_NPU_CORE_1 = 2,
  35. RKNN_NPU_CORE_2 = 4,
  36. RKNN_NPU_CORE_0_1 = RKNN_NPU_CORE_0 | RKNN_NPU_CORE_1,
  37. RKNN_NPU_CORE_0_1_2 = RKNN_NPU_CORE_0_1 | RKNN_NPU_CORE_2,
  38. RKNN_NPU_CORE_UNDEFINED,
  39. } CoreMask;
  40. } // namespace rknpu2
  41. struct RKNPU2BackendOption {
  42. rknpu2::CpuName cpu_name = rknpu2::CpuName::RK3588;
  43. rknpu2::CoreMask core_mask = rknpu2::CoreMask::RKNN_NPU_CORE_AUTO;
  44. };
  45. } // namespace ultra_infer