NVIDIA DeepStream SDK API Reference

9.0 Release
nvdsinfer::TrtBackendContext Class Referenceabstract

Detailed Description

Base class for implementations of the BackendContext interface.

Implements functionality common to all backends.

Definition at line 208 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

Inheritance diagram for nvdsinfer::TrtBackendContext:
Collaboration diagram for nvdsinfer::TrtBackendContext:

Public Member Functions

 ~TrtBackendContext ()
 
 ~TrtBackendContext ()
 
virtual NvDsInferStatus initialize ()=0
 
virtual NvDsInferStatus initialize ()=0
 
virtual NvDsInferStatus enqueueBuffer (const std::shared_ptr< InferBatchBuffer > &buffer, CudaStream &stream, CudaEvent *consumeEvent)=0
 
virtual NvDsInferStatus enqueueBuffer (const std::shared_ptr< InferBatchBuffer > &buffer, CudaStream &stream, CudaEvent *consumeEvent)=0
 

Protected Member Functions

 TrtBackendContext (std::unique_ptr< nvinfer1::IExecutionContext > &&ctx, std::shared_ptr< TrtEngine > engine)
 
bool isOutputLayer (const std::string &bindingName) override
 
int getNumBoundLayers () override
 
const NvDsInferBatchDimsLayerInfo & getLayerInfo (int bindingIdx) override
 
bool canSupportBatchDims (int bindingIdx, const NvDsInferBatchDims &batchDims) override
 
virtual NvDsInferBatchDims getMaxBatchDims (int bindingIdx) override
 
virtual NvDsInferBatchDims getMinBatchDims (int bindingIdx) override
 
virtual NvDsInferBatchDims getOptBatchDims (int bindingIdx) override
 
 TrtBackendContext (std::unique_ptr< nvinfer1::IExecutionContext > &&ctx, std::shared_ptr< TrtEngine > engine)
 
bool isOutputLayer (const std::string &bindingName) override
 
int getNumBoundLayers () override
 
const NvDsInferBatchDimsLayerInfo & getLayerInfo (int bindingIdx) override
 
bool canSupportBatchDims (int bindingIdx, const NvDsInferBatchDims &batchDims) override
 
virtual NvDsInferBatchDims getMaxBatchDims (int bindingIdx) override
 
virtual NvDsInferBatchDims getMinBatchDims (int bindingIdx) override
 
virtual NvDsInferBatchDims getOptBatchDims (int bindingIdx) override
 

Protected Attributes

std::unique_ptr< nvinfer1::IExecutionContext > m_Context
 
std::shared_ptr< TrtEnginem_CudaEngine
 
std::vector< NvDsInferBatchDimsLayerInfo > m_AllLayers
 
int m_GpuId = -1
 

Static Protected Attributes

static std::mutex sDLAExecutionMutex
 

Constructor & Destructor Documentation

◆ ~TrtBackendContext() [1/2]

nvdsinfer::TrtBackendContext::~TrtBackendContext ( )

◆ TrtBackendContext() [1/2]

nvdsinfer::TrtBackendContext::TrtBackendContext ( std::unique_ptr< nvinfer1::IExecutionContext > &&  ctx,
std::shared_ptr< TrtEngine engine 
)
protected

◆ ~TrtBackendContext() [2/2]

nvdsinfer::TrtBackendContext::~TrtBackendContext ( )

◆ TrtBackendContext() [2/2]

nvdsinfer::TrtBackendContext::TrtBackendContext ( std::unique_ptr< nvinfer1::IExecutionContext > &&  ctx,
std::shared_ptr< TrtEngine engine 
)
protected

Member Function Documentation

◆ canSupportBatchDims() [1/2]

bool nvdsinfer::TrtBackendContext::canSupportBatchDims ( int  bindingIdx,
const NvDsInferBatchDims &  batchDims 
)
overrideprotectedvirtual

◆ canSupportBatchDims() [2/2]

bool nvdsinfer::TrtBackendContext::canSupportBatchDims ( int  bindingIdx,
const NvDsInferBatchDims &  batchDims 
)
overrideprotectedvirtual

◆ enqueueBuffer() [1/2]

virtual NvDsInferStatus nvdsinfer::BackendContext::enqueueBuffer ( const std::shared_ptr< InferBatchBuffer > &  buffer,
CudaStream stream,
CudaEvent consumeEvent 
)
pure virtualinherited

◆ enqueueBuffer() [2/2]

virtual NvDsInferStatus nvdsinfer::BackendContext::enqueueBuffer ( const std::shared_ptr< InferBatchBuffer > &  buffer,
CudaStream stream,
CudaEvent consumeEvent 
)
pure virtualinherited

◆ getLayerInfo() [1/2]

const NvDsInferBatchDimsLayerInfo& nvdsinfer::TrtBackendContext::getLayerInfo ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 220 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getLayerInfo() [2/2]

const NvDsInferBatchDimsLayerInfo& nvdsinfer::TrtBackendContext::getLayerInfo ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 220 of file 9.0/sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getMaxBatchDims() [1/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getMaxBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 229 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getMaxBatchDims() [2/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getMaxBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 229 of file 9.0/sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getMinBatchDims() [1/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getMinBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 234 of file 9.0/sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getMinBatchDims() [2/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getMinBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 234 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getNumBoundLayers() [1/2]

int nvdsinfer::TrtBackendContext::getNumBoundLayers ( )
overrideprotectedvirtual

◆ getNumBoundLayers() [2/2]

int nvdsinfer::TrtBackendContext::getNumBoundLayers ( )
overrideprotectedvirtual

◆ getOptBatchDims() [1/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getOptBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 239 of file 9.0/sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ getOptBatchDims() [2/2]

virtual NvDsInferBatchDims nvdsinfer::TrtBackendContext::getOptBatchDims ( int  bindingIdx)
inlineoverrideprotectedvirtual

Implements nvdsinfer::BackendContext.

Definition at line 239 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

References m_AllLayers.

◆ initialize() [1/2]

virtual NvDsInferStatus nvdsinfer::BackendContext::initialize ( )
pure virtualinherited

◆ initialize() [2/2]

virtual NvDsInferStatus nvdsinfer::BackendContext::initialize ( )
pure virtualinherited

◆ isOutputLayer() [1/2]

bool nvdsinfer::TrtBackendContext::isOutputLayer ( const std::string &  bindingName)
overrideprotectedvirtual

◆ isOutputLayer() [2/2]

bool nvdsinfer::TrtBackendContext::isOutputLayer ( const std::string &  bindingName)
overrideprotectedvirtual

Field Documentation

◆ m_AllLayers

std::vector< NvDsInferBatchDimsLayerInfo > nvdsinfer::TrtBackendContext::m_AllLayers
protected

◆ m_Context

std::unique_ptr< nvinfer1::IExecutionContext > nvdsinfer::TrtBackendContext::m_Context
protected

Definition at line 246 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

◆ m_CudaEngine

std::shared_ptr< TrtEngine > nvdsinfer::TrtBackendContext::m_CudaEngine
protected

Definition at line 247 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

◆ m_GpuId

int nvdsinfer::TrtBackendContext::m_GpuId = -1
protected

Definition at line 250 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.

◆ sDLAExecutionMutex

static std::mutex nvdsinfer::TrtBackendContext::sDLAExecutionMutex
staticprotected

Definition at line 252 of file sources/libs/nvdsinfer/nvdsinfer_backend.h.


The documentation for this class was generated from the following file: