option_pybind.cc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #include "ultra_infer/pybind/main.h"
  15. #include "ultra_infer/runtime/backends/poros/option.h"
  16. namespace ultra_infer {
  17. void BindPorosOption(pybind11::module &m) {
  18. pybind11::class_<PorosBackendOption>(m, "PorosBackendOption")
  19. .def(pybind11::init())
  20. .def_readwrite("long_to_int", &PorosBackendOption::long_to_int)
  21. .def_readwrite("use_nvidia_tf32", &PorosBackendOption::use_nvidia_tf32)
  22. .def_readwrite("unconst_ops_thres",
  23. &PorosBackendOption::unconst_ops_thres)
  24. .def_readwrite("prewarm_datatypes",
  25. &PorosBackendOption::prewarm_datatypes)
  26. .def_readwrite("enable_fp16", &PorosBackendOption::enable_fp16)
  27. .def_readwrite("enable_int8", &PorosBackendOption::enable_int8)
  28. .def_readwrite("is_dynamic", &PorosBackendOption::is_dynamic)
  29. .def_readwrite("max_batch_size", &PorosBackendOption::max_batch_size)
  30. .def_readwrite("max_workspace_size",
  31. &PorosBackendOption::max_workspace_size);
  32. }
  33. } // namespace ultra_infer