mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 09:07:10 +08:00
[Backend & Serving] Serving and Runtime support Clone (#464)
* Add Serving and Runtime use Clone * support TRT, OpenVINO and Paddle Backend Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -20,17 +20,20 @@
|
||||
#include <vector>
|
||||
|
||||
#include "fastdeploy/backends/backend.h"
|
||||
#include "fastdeploy/utils/unique_ptr.h"
|
||||
#include "openvino/openvino.hpp"
|
||||
|
||||
namespace fastdeploy {
|
||||
|
||||
struct OpenVINOBackendOption {
|
||||
int cpu_thread_num = 8;
|
||||
int cpu_thread_num = -1;
|
||||
int ov_num_streams = 1;
|
||||
std::map<std::string, std::vector<int64_t>> shape_infos;
|
||||
};
|
||||
|
||||
class OpenVINOBackend : public BaseBackend {
|
||||
public:
|
||||
static ov::Core core_;
|
||||
OpenVINOBackend() {}
|
||||
virtual ~OpenVINOBackend() = default;
|
||||
|
||||
@@ -54,10 +57,13 @@ class OpenVINOBackend : public BaseBackend {
|
||||
std::vector<TensorInfo> GetInputInfos() override;
|
||||
std::vector<TensorInfo> GetOutputInfos() override;
|
||||
|
||||
std::unique_ptr<BaseBackend> Clone(void *stream = nullptr,
|
||||
int device_id = -1) override;
|
||||
|
||||
private:
|
||||
void InitTensorInfo(const std::vector<ov::Output<ov::Node>>& ov_outputs,
|
||||
std::map<std::string, TensorInfo>* tensor_infos);
|
||||
ov::Core core_;
|
||||
|
||||
ov::CompiledModel compiled_model_;
|
||||
ov::InferRequest request_;
|
||||
OpenVINOBackendOption option_;
|
||||
|
Reference in New Issue
Block a user