NVIDIA DeepStream SDK API Reference

6.4 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 nvdsinfer_backend.h.

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

Public Member Functions

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

Protected Member Functions

 TrtBackendContext (UniquePtrWDestroy< nvinfer1::IExecutionContext > &&ctx, std::shared_ptr< TrtEngine > engine)
 
int getLayerIdx (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

UniquePtrWDestroy< 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()

nvdsinfer::TrtBackendContext::~TrtBackendContext ( )

◆ TrtBackendContext()

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

Member Function Documentation

◆ canSupportBatchDims()

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

◆ enqueueBuffer()

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

◆ getLayerIdx()

int nvdsinfer::TrtBackendContext::getLayerIdx ( const std::string &  bindingName)
overrideprotectedvirtual

◆ getLayerInfo()

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

Implements nvdsinfer::BackendContext.

Definition at line 220 of file nvdsinfer_backend.h.

References m_AllLayers.

◆ getMaxBatchDims()

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

Implements nvdsinfer::BackendContext.

Definition at line 229 of file nvdsinfer_backend.h.

References m_AllLayers.

◆ getMinBatchDims()

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

Implements nvdsinfer::BackendContext.

Definition at line 234 of file nvdsinfer_backend.h.

References m_AllLayers.

◆ getNumBoundLayers()

int nvdsinfer::TrtBackendContext::getNumBoundLayers ( )
overrideprotectedvirtual

◆ getOptBatchDims()

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

Implements nvdsinfer::BackendContext.

Definition at line 239 of file nvdsinfer_backend.h.

References m_AllLayers.

◆ initialize()

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

Field Documentation

◆ m_AllLayers

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

◆ m_Context

UniquePtrWDestroy<nvinfer1::IExecutionContext> nvdsinfer::TrtBackendContext::m_Context
protected

Definition at line 246 of file nvdsinfer_backend.h.

◆ m_CudaEngine

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

Definition at line 247 of file nvdsinfer_backend.h.

◆ m_GpuId

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

Definition at line 250 of file nvdsinfer_backend.h.

◆ sDLAExecutionMutex

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

Definition at line 252 of file nvdsinfer_backend.h.


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