[lite] add more options for lite backend (#313)

* [cmake] support Android arm64-v8a & armeabi-v7a native c++ sdk

* [cmake] fixed patchelf download on mac and android

* [lite] Add threads and power_mode option support

* [pybind] update runtime pybind for lite power mode

* [python] Add set_lite_power_mode api to runtime

* [Lite] add lite enable_fp16 option support

* [lite] add more options for lite backend.

* [cmake] fixed Paddle Lite typo

* [runtime] format LitePowerMode enum comments

* [runtime] format lite option comments
This commit is contained in:
DefTruth
2022-10-04 17:31:48 +08:00
committed by GitHub
parent f2e984fdfa
commit c4288a92e1
10 changed files with 180 additions and 40 deletions

View File

@@ -34,7 +34,11 @@ struct LiteBackendOption {
// 3: LITE_POWER_NO_BIND
// 4: LITE_POWER_RAND_HIGH
// 5: LITE_POWER_RAND_LOW
int power_mode = 0;
int power_mode = 3;
// enable fp16
bool enable_fp16 = false;
// optimized model dir for CxxConfig
std::string optimized_model_dir = "";
// TODO(qiuyanjun): support more options for lite backend.
// Such as fp16, different device target (kARM/kXPU/kNPU/...)
};
@@ -69,5 +73,7 @@ class LiteBackend : public BaseBackend {
std::vector<TensorInfo> inputs_desc_;
std::vector<TensorInfo> outputs_desc_;
std::map<std::string, int> inputs_order_;
LiteBackendOption option_;
bool supported_fp16_ = false;
};
} // namespace fastdeploy