22 #include "fastdeploy/runtime/backends/backend.h" 23 #include "fastdeploy/core/fd_tensor.h" 25 #include "fastdeploy/utils/perf.h" 26 #ifdef ENABLE_ENCRYPTION 27 #include "fastdeploy/encryption/include/decrypt.h" 48 bool Infer(std::vector<FDTensor>& input_tensors,
49 std::vector<FDTensor>* output_tensors);
71 std::vector<TensorInfo> GetInputInfos();
74 std::vector<TensorInfo> GetOutputInfos();
77 void BindInputTensor(
const std::string& name,
FDTensor& input);
82 void BindOutputTensor(
const std::string& name,
FDTensor& output);
86 FDTensor* GetOutputTensor(
const std::string& name);
93 Runtime* Clone(
void* stream =
nullptr,
int device_id = -1);
95 void ReleaseModelMemoryBuffer();
104 bool Compile(std::vector<std::vector<FDTensor>>& prewarm_tensors);
108 return backend_->benchmark_result_.time_of_runtime;
112 void CreateOrtBackend();
113 void CreatePaddleBackend();
114 void CreateTrtBackend();
115 void CreateOpenVINOBackend();
116 void CreateLiteBackend();
117 void CreateRKNPU2Backend();
118 void CreateSophgoNPUBackend();
119 void CreatePorosBackend();
120 std::unique_ptr<BaseBackend> backend_;
121 std::vector<FDTensor> input_tensors_;
122 std::vector<FDTensor> output_tensors_;
Runtime object used to inference the loaded model on different devices.
Definition: runtime.h:37
int NumOutputs()
Get number of outputs.
Definition: runtime.h:62
Option object used when create a new Runtime object.
Definition: runtime_option.h:40
A brief file description. More details.
FDTensor object used to represend data matrix.
Definition: fd_tensor.h:31
double GetProfileTime()
Get profile time of Runtime after the profile process is done.
Definition: runtime.h:107
Information of Tensor.
Definition: backend.h:31
int NumInputs()
Get number of inputs.
Definition: runtime.h:59
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16