NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/libs/nvdsinferserver/infer_trtis_context.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019-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 __INFER_TRTIS_CONTEXT_H__
28 #define __INFER_TRTIS_CONTEXT_H__
29 
30 #include "infer_common.h"
31 #include "infer_cuda_context.h"
32 
33 namespace nvdsinferserver {
34 
38 class InferTrtISContext : public InferCudaContext {
39 public:
44 
48  ~InferTrtISContext() override;
49 
53  NvDsInferStatus deinit() override;
54 
59  {
60  assert(m_MainStream);
61  return m_MainStream;
62  }
63 
64 private:
72  NvDsInferStatus createNNBackend(const ic::BackendParams& params,
74 
84  NvDsInferStatus allocateResource(
85  const ic::InferenceConfig& config) override;
86 
95  NvDsInferStatus specifyBackendDims(
96  BaseBackend* be, const std::string& model, const ic::BackendParams& params);
97 
106  NvDsInferStatus getConfigInOutMap(
107  const ic::BackendParams& params,
108  std::unordered_map<std::string, InferDims>& inputs,
109  std::set<std::string>& outputs);
110 
111 private:
115  SharedCuStream m_MainStream;
119  TrtISBackend* m_Backend{nullptr};
120 };
121 
122 } // namespace nvdsinferserver
123 
124 #endif
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::InferTrtISContext::InferTrtISContext
InferTrtISContext()
Constructor, default.
infer_common.h
Header file of the common declarations for the nvinferserver library.
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
nvdsinferserver::InferTrtISContext::mainStream
SharedCuStream & mainStream() override
Get the main processing CUDA event.
Definition: 9.1/sources/libs/nvdsinferserver/infer_trtis_context.h:58
nvdsinferserver::SharedCuStream
std::shared_ptr< CudaStream > SharedCuStream
Cuda based pointers.
Definition: sources/libs/nvdsinferserver/infer_common.h:89
nvdsinferserver::InferTrtISContext::~InferTrtISContext
~InferTrtISContext() override
Destructor, default.
nvdsinferserver::UniqBackend
std::unique_ptr< BaseBackend > UniqBackend
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:217
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::InferTrtISContext::deinit
NvDsInferStatus deinit() override
Synchronize on the CUDA stream and call InferCudaContext::deinit().
nvdsinferserver::BaseBackend
Base class of inference backend processing.
Definition: sources/libs/nvdsinferserver/infer_base_backend.h:45
infer_cuda_context.h
Header file for the CUDA inference context class.
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: sources/includes/nvdsinfer.h:231