NVIDIA DeepStream SDK API Reference

6.4 Release
infer_grpc_context.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_CONTEXT_H__
23 #define __NVDSINFERSERVER_GRPC_CONTEXT_H__
24 
25 #include "infer_base_backend.h"
26 #include "infer_cuda_context.h"
27 #include "infer_cuda_utils.h"
28 #include "infer_datatypes.h"
29 #include "infer_utils.h"
30 
31 namespace nvdsinferserver {
32 
38 public:
43 
47  ~InferGrpcContext() override;
48 
49 protected:
58  const ic::BackendParams& params, int maxBatchSize,
60 
64  NvDsInferStatus deinit() override;
65 
70  {
71  assert(m_Stream);
72  return m_Stream;
73  }
74 
75 private:
85  NvDsInferStatus allocateResource(
86  const ic::InferenceConfig& config) override;
87 
96  NvDsInferStatus specifyBackendDims(
97  BaseBackend* be, const std::string& model,
98  const ic::BackendParams& params);
99 
108  NvDsInferStatus getConfigInOutMap(
109  const ic::BackendParams& params,
110  std::unordered_map<std::string, InferDims>& inputs,
111  std::set<std::string>& outputs);
112 
113 private:
117  SharedCuStream m_Stream;
121  TrtISBackend* m_Backend{nullptr};
122 };
123 
124 } // namespace nvdsinferserver
125 
126 #endif //__NVDSINFERSERVER_GRPC_CONTEXT_H__
nvdsinferserver
Copyright (c) 2021, NVIDIA CORPORATION.
Definition: infer_custom_process.h:28
nvdsinferserver::InferGrpcContext::deinit
NvDsInferStatus deinit() override
Synchronize on the CUDA stream and call InferCudaContext::deinit().
nvdsinferserver::InferBaseContext::maxBatchSize
int maxBatchSize() const
Definition: infer_base_context.h:99
infer_datatypes.h
Header file for the data types used in the inference processing.
nvdsinferserver::TrtISBackend
Triton backend processing class.
Definition: infer_trtis_backend.h:39
infer_utils.h
Header file containing utility functions and classes used by the nvinferserver low level library.
infer_cuda_context.h
Header file for the CUDA inference context class.
nvdsinferserver::UniqBackend
std::unique_ptr< BaseBackend > UniqBackend
Definition: infer_base_backend.h:212
infer_cuda_utils.h
Header file declaring utility classes for CUDA memory management, CIDA streams and events.
nvdsinferserver::InferGrpcContext::createNNBackend
NvDsInferStatus createNNBackend(const ic::BackendParams &params, int maxBatchSize, UniqBackend &backend)
Create the Triton gRPC mode inference processing backend.
nvdsinferserver::SharedCuStream
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Definition: infer_common.h:84
nvdsinferserver::InferBaseContext::backend
BaseBackend * backend()
Definition: infer_base_context.h:101
nvdsinferserver::InferBaseContext::config
const ic::InferenceConfig & config() const
Definition: infer_base_context.h:98
nvdsinferserver::InferGrpcContext::~InferGrpcContext
~InferGrpcContext() override
Destructor, default.
nvdsinferserver::InferGrpcContext
Inference context class accessing Triton Inference Server in gRPC mode.
Definition: infer_grpc_context.h:37
nvdsinferserver::InferGrpcContext::mainStream
SharedCuStream & mainStream() override
Get the main processing CUDA event.
Definition: infer_grpc_context.h:69
nvdsinferserver::BaseBackend
Base class of inference backend processing.
Definition: infer_base_backend.h:40
infer_base_backend.h
Header file for inference processing backend base class.
nvdsinferserver::InferGrpcContext::InferGrpcContext
InferGrpcContext()
Constructor, default.
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: nvdsinfer.h:218
nvdsinferserver::InferCudaContext
Class for inference context CUDA processing.
Definition: infer_cuda_context.h:44