\class EnqueueImplicit \brief Functor to enqueue inference with implicit batch
| 505 | //! \brief Functor to enqueue inference with implicit batch |
| 506 | //! |
| 507 | class EnqueueImplicit : private Enqueue |
| 508 | { |
| 509 | |
| 510 | public: |
| 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 | |
| 537 | private: |
| 538 | void** mBuffers{}; |
| 539 | int32_t mBatch{}; |
| 540 | }; |
| 541 | |
| 542 | //! |
| 543 | //! \class EnqueueExplicit |
no outgoing calls
no test coverage detected