NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/libs/nvdsinferserver/infer_grpc_context.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
27 #ifndef __NVDSINFERSERVER_GRPC_CONTEXT_H__
28 #define __NVDSINFERSERVER_GRPC_CONTEXT_H__
29 
30 #include "infer_base_backend.h"
31 #include "infer_cuda_context.h"
32 #include "infer_cuda_utils.h"
33 #include "infer_datatypes.h"
34 #include "infer_utils.h"
35 
36 namespace nvdsinferserver {
37 
42 class InferGrpcContext : public InferCudaContext {
43 public:
48 
52  ~InferGrpcContext() override;
53 
54 protected:
63  const ic::BackendParams& params, int maxBatchSize,
65 
69  NvDsInferStatus deinit() override;
70 
75  {
76  assert(m_Stream);
77  return m_Stream;
78  }
79 
80 private:
90  NvDsInferStatus allocateResource(
91  const ic::InferenceConfig& config) override;
92 
101  NvDsInferStatus specifyBackendDims(
102  BaseBackend* be, const std::string& model,
103  const ic::BackendParams& params);
104 
113  NvDsInferStatus getConfigInOutMap(
114  const ic::BackendParams& params,
115  std::unordered_map<std::string, InferDims>& inputs,
116  std::set<std::string>& outputs);
117 
118 private:
122  SharedCuStream m_Stream;
126  TrtISBackend* m_Backend{nullptr};
127 };
128 
129 } // namespace nvdsinferserver
130 
131 #endif //__NVDSINFERSERVER_GRPC_CONTEXT_H__
nvdsinferserver
This is a header file for pre-processing cuda kernels with normalization and mean subtraction require...
Definition: sources/gst-plugins/gst-nvinferserver/gstnvinferserver_impl.h:69
nvdsinferserver::InferGrpcContext::deinit
NvDsInferStatus deinit() override
Synchronize on the CUDA stream and call InferCudaContext::deinit().
nvdsinferserver::InferBaseContext::maxBatchSize
int maxBatchSize() const
Definition: sources/libs/nvdsinferserver/infer_base_context.h:104
nvdsinferserver::TrtISBackend
Triton backend processing class.
Definition: sources/libs/nvdsinferserver/infer_trtis_backend.h:44
infer_cuda_utils.h
Header file declaring utility classes for CUDA memory management, CIDA streams and events.
nvdsinferserver::SharedCuStream
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Definition: sources/libs/nvdsinferserver/infer_common.h:89
nvdsinferserver::UniqBackend
std::unique_ptr< BaseBackend > UniqBackend
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:217
nvdsinferserver::InferGrpcContext::createNNBackend
NvDsInferStatus createNNBackend(const ic::BackendParams &params, int maxBatchSize, UniqBackend &backend)
Create the Triton gRPC mode inference processing backend.
infer_utils.h
Header file containing utility functions and classes used by the nvinferserver low level library.
nvdsinferserver::InferBaseContext::backend
BaseBackend * backend()
Definition: sources/libs/nvdsinferserver/infer_base_context.h:106
nvdsinferserver::InferBaseContext::config
const ic::InferenceConfig & config() const
Definition: sources/libs/nvdsinferserver/infer_base_context.h:103
nvdsinferserver::InferGrpcContext::~InferGrpcContext
~InferGrpcContext() override
Destructor, default.
nvdsinferserver::InferGrpcContext::mainStream
SharedCuStream & mainStream() override
Get the main processing CUDA event.
Definition: 9.1/sources/libs/nvdsinferserver/infer_grpc_context.h:74
nvdsinferserver::BaseBackend
Base class of inference backend processing.
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:45
nvdsinferserver::InferGrpcContext::InferGrpcContext
InferGrpcContext()
Constructor, default.
infer_cuda_context.h
Header file for the CUDA inference context class.
infer_base_backend.h
Header file for inference processing backend base class.
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: sources/includes/nvdsinfer.h:231