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

Class EnqueueExplicit

samples/common/sampleInference.cpp:546–578  ·  view source on GitHub ↗

\class EnqueueExplicit \brief Functor to enqueue inference with explict batch

Source from the content-addressed store, hash-verified

544//! \brief Functor to enqueue inference with explict batch
545//!
546class EnqueueExplicit : private Enqueue
547{
548
549public:
550 explicit EnqueueExplicit(nvinfer1::IExecutionContext& context, Bindings const& bindings)
551 : Enqueue(context)
552 , mBindings(bindings)
553 {
554 ASSERT(mBindings.setTensorAddresses(mContext));
555 }
556
557 bool operator()(TrtCudaStream& stream) const
558 {
559 try
560 {
561 bool const result = mContext.enqueueV3(stream.get());
562 // Collecting layer timing info from current profile index of execution context
563 if (mContext.getProfiler() && !mContext.getEnqueueEmitsProfile() && !mContext.reportToProfiler())
564 {
565 gLogWarning << "Failed to collect layer timing info from previous enqueueV3()" << std::endl;
566 }
567 return result;
568 }
569 catch (const std::exception&)
570 {
571 return false;
572 }
573 return false;
574 }
575
576private:
577 Bindings const& mBindings;
578};
579
580//!
581//! \class EnqueueGraph

Callers 1

createEnqueueFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected