mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-13 12:23:55 +08:00
[Serving][Backend] Backend support zero_copy_infer and Serving reduce the output memory copy (#703)
* backend add zero copy infer interface * fix bug * fix bug * fix bug * paddle ipu
This commit is contained in:
@@ -62,8 +62,11 @@ class BaseBackend {
|
||||
virtual TensorInfo GetOutputInfo(int index) = 0;
|
||||
virtual std::vector<TensorInfo> GetInputInfos() = 0;
|
||||
virtual std::vector<TensorInfo> GetOutputInfos() = 0;
|
||||
// if copy_to_fd is true, copy memory data to FDTensor
|
||||
// else share memory to FDTensor(only Paddle、ORT、TRT、OpenVINO support it)
|
||||
virtual bool Infer(std::vector<FDTensor>& inputs,
|
||||
std::vector<FDTensor>* outputs) = 0;
|
||||
std::vector<FDTensor>* outputs,
|
||||
bool copy_to_fd = true) = 0;
|
||||
virtual std::unique_ptr<BaseBackend> Clone(void *stream = nullptr,
|
||||
int device_id = -1) {
|
||||
FDERROR << "Clone no support" << std::endl;
|
||||
|
Reference in New Issue
Block a user