\class EnqueueExplicit \brief Functor to enqueue inference with explict batch
| 544 | //! \brief Functor to enqueue inference with explict batch |
| 545 | //! |
| 546 | class EnqueueExplicit : private Enqueue |
| 547 | { |
| 548 | |
| 549 | public: |
| 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 | |
| 576 | private: |
| 577 | Bindings const& mBindings; |
| 578 | }; |
| 579 | |
| 580 | //! |
| 581 | //! \class EnqueueGraph |
no outgoing calls
no test coverage detected