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

Class EnqueueSafe

samples/common/sampleInference.cpp:637–663  ·  view source on GitHub ↗

\class EnqueueSafe \brief Functor to enqueue safe execution context

Source from the content-addressed store, hash-verified

635//! \brief Functor to enqueue safe execution context
636//!
637class EnqueueSafe
638{
639public:
640 explicit EnqueueSafe(nvinfer1::safe::IExecutionContext& context, Bindings const& bindings)
641 : mContext(context)
642 , mBindings(bindings)
643 {
644 ASSERT(mBindings.setSafeTensorAddresses(mContext));
645 }
646
647 bool operator()(TrtCudaStream& stream) const
648 {
649 try
650 {
651 return mContext.enqueueV3(stream.get());
652 }
653 catch (const std::exception&)
654 {
655 return false;
656 }
657 return false;
658 }
659
660 nvinfer1::safe::IExecutionContext& mContext;
661private:
662 Bindings const& mBindings;
663};
664
665using EnqueueFunction = std::function<bool(TrtCudaStream&)>;
666

Callers 1

createEnqueueFunctionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected