17 #include "fastdeploy/utils/utils.h" 18 #include "fastdeploy/vision/common/processors/mat.h" 19 #include "fastdeploy/vision/common/processors/mat_batch.h" 20 #include "fastdeploy/vision/common/processors/base.h" 37 void UseCuda(
bool enable_cv_cuda =
false,
int gpu_id = -1);
42 cudaStream_t Stream()
const {
return stream_; }
45 void SetStream(
FDMat* mat) {
47 mat->SetStream(stream_);
53 mat_batch->SetStream(stream_);
59 FDASSERT(cudaStreamSynchronize(stream_) == cudaSuccess,
60 "[ERROR] Error occurs while sync cuda stream.");
64 int DeviceId() {
return device_id_; }
72 bool Run(std::vector<FDMat>* images, std::vector<FDTensor>* outputs);
81 std::vector<FDTensor>* outputs) = 0;
88 ProcLib proc_lib_ = ProcLib::DEFAULT;
92 cudaStream_t stream_ =
nullptr;
96 std::vector<FDTensor> input_caches_;
97 std::vector<FDTensor> output_caches_;
FDTensor object used to represend data matrix.
Definition: fd_tensor.h:31
FDMat is a structure for replace cv::Mat.
Definition: mat.h:34
FDMatBatch contains batch data for preprocess.
Definition: mat_batch.h:28
ProcessorManager for Preprocess.
Definition: manager.h:27
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16