|
|
|
@ -187,14 +187,18 @@ struct NativeConfig : public PaddlePredictor::Config {
|
|
|
|
|
// `feeds` and `fetches` of the phase `save_inference_model`.
|
|
|
|
|
bool specify_input_name{false};
|
|
|
|
|
|
|
|
|
|
// Set and get the number of cpu threads.
|
|
|
|
|
void SetCPUNumThreads(int cpu_num_threads) {
|
|
|
|
|
cpu_num_threads_ = cpu_num_threads;
|
|
|
|
|
// Set and get the number of cpu math library threads.
|
|
|
|
|
void SetCpuMathLibraryNumThreads(int cpu_math_library_num_threads) {
|
|
|
|
|
cpu_math_library_num_threads_ = cpu_math_library_num_threads;
|
|
|
|
|
}
|
|
|
|
|
int cpu_math_library_num_threads() const {
|
|
|
|
|
return cpu_math_library_num_threads_;
|
|
|
|
|
}
|
|
|
|
|
int GetCPUNumThreads() const { return cpu_num_threads_; }
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int cpu_num_threads_{1}; // number of cpu threads for each instance.
|
|
|
|
|
// number of cpu math library (such as MKL, OpenBlas) threads for each
|
|
|
|
|
// instance.
|
|
|
|
|
int cpu_math_library_num_threads_{1};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// A factory to help create different predictors.
|
|
|
|
|