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

Class EnqueueImplicit

samples/common/sampleInference.cpp:507–540  ·  view source on GitHub ↗

\class EnqueueImplicit \brief Functor to enqueue inference with implicit batch

Source from the content-addressed store, hash-verified

505//! \brief Functor to enqueue inference with implicit batch
506//!
507class EnqueueImplicit : private Enqueue
508{
509
510public:
511 explicit EnqueueImplicit(nvinfer1::IExecutionContext& context, void** buffers, int32_t batch)
512 : Enqueue(context)
513 , mBuffers(buffers)
514 , mBatch(batch)
515 {
516 }
517
518 bool operator()(TrtCudaStream& stream) const
519 {
520 try
521 {
522 bool const result = mContext.enqueue(mBatch, mBuffers, stream.get(), nullptr);
523 // Collecting layer timing info from current profile index of execution context
524 if (mContext.getProfiler() && !mContext.getEnqueueEmitsProfile() && !mContext.reportToProfiler())
525 {
526 gLogWarning << "Failed to collect layer timing info from previous enqueue()" << std::endl;
527 }
528 return result;
529 }
530 catch (const std::exception&)
531 {
532 return false;
533 }
534 return false;
535 }
536
537private:
538 void** mBuffers{};
539 int32_t mBatch{};
540};
541
542//!
543//! \class EnqueueExplicit

Callers 1

createEnqueueFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected