NVIDIA DeepStream SDK API Reference

7.0 Release
infer_grpc_backend.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
22 #ifndef __NVDSINFERSERVER_GRPC_BACKEND_H__
23 #define __NVDSINFERSERVER_GRPC_BACKEND_H__
24 
25 #include "infer_common.h"
26 #include "infer_trtis_backend.h"
27 #include "infer_grpc_client.h"
28 
29 namespace nvdsinferserver {
30 
35 public:
36  TritonGrpcBackend(std::string model, int64_t version);
37  ~TritonGrpcBackend() override;
38 
39  void setOutputs(const std::set<std::string>& names) {
40  m_RequestOutputs = names;
41  }
42  void setUrl (const std::string &url) { m_Url = url;}
43  void setEnableCudaBufferSharing (const bool enableSharing) {
44  m_EnableCudaBufferSharing = enableSharing;
45  }
46  NvDsInferStatus initialize() override;
47 
48 protected:
50  InputsConsumed bufConsumed, InferenceDone inferenceDone) override;
51  void requestTritonOutputNames(std::set<std::string>& names) override;
52 
57  SharedBatchArray inputs, InputsConsumed bufConsumed,
58  AsyncDone asyncDone) override;
59 
60 private:
61  std::string m_Url;
62  std::set<std::string> m_RequestOutputs;
63  std::shared_ptr<nvdsinferserver::InferGrpcClient> m_InferGrpcClient;
64  bool m_EnableCudaBufferSharing = false;
65 };
66 
67 } // namespace nvdsinferserver
68 
69 #endif
nvdsinferserver
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
Definition: infer_custom_process.h:24
nvdsinferserver::TritonGrpcBackend::setEnableCudaBufferSharing
void setEnableCudaBufferSharing(const bool enableSharing)
Definition: infer_grpc_backend.h:43
nvdsinferserver::TritonGrpcBackend::initialize
NvDsInferStatus initialize() override
nvdsinferserver::TrtISBackend::model
const std::string & model() const
Definition: infer_trtis_backend.h:73
infer_trtis_backend.h
Header file of Triton Inference Server inference backend.
nvdsinferserver::IBackend::InputsConsumed
std::function< void(SharedBatchArray)> InputsConsumed
Function wrapper called after the input buffer is consumed.
Definition: infer_ibackend.h:70
nvdsinferserver::TrtISBackend
Triton backend processing class.
Definition: infer_trtis_backend.h:39
infer_grpc_client.h
Header file for the gRPC client and request class for inference using the Triton Inference Server....
nvdsinferserver::TritonGrpcBackend::ensureServerReady
NvDsInferStatus ensureServerReady() override
nvdsinferserver::TritonGrpcBackend::requestTritonOutputNames
void requestTritonOutputNames(std::set< std::string > &names) override
nvdsinferserver::TrtISBackend::AsyncDone
std::function< void(NvDsInferStatus, SharedBatchArray)> AsyncDone
Asynchronous inference done function: AsyncDone(Status, outputs).
Definition: infer_trtis_backend.h:169
nvdsinferserver::TritonGrpcBackend::ensureModelReady
NvDsInferStatus ensureModelReady() override
nvdsinferserver::TritonGrpcBackend::setupLayersInfo
NvDsInferStatus setupLayersInfo() override
nvdsinferserver::TritonGrpcBackend::Run
NvDsInferStatus Run(SharedBatchArray inputs, InputsConsumed bufConsumed, AsyncDone asyncDone) override
nvdsinferserver::TritonGrpcBackend::setOutputs
void setOutputs(const std::set< std::string > &names)
Definition: infer_grpc_backend.h:39
infer_common.h
Header file of the common declarations for the nvinferserver library.
nvdsinferserver::IBackend::InferenceDone
std::function< void(NvDsInferStatus, SharedBatchArray)> InferenceDone
Function wrapper for post inference processing.
Definition: infer_ibackend.h:66
nvdsinferserver::TritonGrpcBackend::enqueue
NvDsInferStatus enqueue(SharedBatchArray inputs, SharedCuStream stream, InputsConsumed bufConsumed, InferenceDone inferenceDone) override
nvdsinferserver::TrtISBackend::version
int64_t version() const
Definition: infer_trtis_backend.h:74
nvdsinferserver::TritonGrpcBackend::~TritonGrpcBackend
~TritonGrpcBackend() override
nvdsinferserver::SharedCuStream
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Definition: infer_common.h:84
nvdsinferserver::TritonGrpcBackend::TritonGrpcBackend
TritonGrpcBackend(std::string model, int64_t version)
nvdsinferserver::TritonGrpcBackend::setUrl
void setUrl(const std::string &url)
Definition: infer_grpc_backend.h:42
nvdsinferserver::SharedBatchArray
std::shared_ptr< BaseBatchArray > SharedBatchArray
Definition: infer_common.h:75
nvdsinferserver::TritonGrpcBackend
Triton gRPC mode backend processing class.
Definition: infer_grpc_backend.h:34
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: nvdsinfer.h:218