MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / EnqueueGraph

Class EnqueueGraph

samples/common/sampleInference.cpp:584–610  ·  view source on GitHub ↗

\class EnqueueGraph \brief Functor to enqueue inference from CUDA Graph

Source from the content-addressed store, hash-verified

582//! \brief Functor to enqueue inference from CUDA Graph
583//!
584class EnqueueGraph
585{
586
587public:
588 explicit EnqueueGraph(nvinfer1::IExecutionContext& context, TrtCudaGraph& graph)
589 : mGraph(graph)
590 , mContext(context)
591 {
592 }
593
594 bool operator()(TrtCudaStream& stream) const
595 {
596 if (mGraph.launch(stream))
597 {
598 // Collecting layer timing info from current profile index of execution context
599 if (mContext.getProfiler() && !mContext.getEnqueueEmitsProfile() && !mContext.reportToProfiler())
600 {
601 gLogWarning << "Failed to collect layer timing info from previous CUDA graph launch" << std::endl;
602 }
603 return true;
604 }
605 return false;
606 }
607
608 TrtCudaGraph& mGraph;
609 nvinfer1::IExecutionContext& mContext;
610};
611
612//!
613//! \class EnqueueGraphSafe

Callers 1

createEnqueueFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected