\class EnqueueGraph \brief Functor to enqueue inference from CUDA Graph
| 582 | //! \brief Functor to enqueue inference from CUDA Graph |
| 583 | //! |
| 584 | class EnqueueGraph |
| 585 | { |
| 586 | |
| 587 | public: |
| 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 |
no outgoing calls
no test coverage detected