\brief Perform one time step of inference with the TensorRT execution context
| 931 | //! \brief Perform one time step of inference with the TensorRT execution context |
| 932 | //! |
| 933 | bool SampleCharRNNBase::stepOnce( |
| 934 | samplesCommon::BufferManager& buffers, SampleUniquePtr<nvinfer1::IExecutionContext>& context, cudaStream_t& stream) |
| 935 | { |
| 936 | // Asynchronously copy data from host input buffers to device input buffers |
| 937 | buffers.copyInputToDeviceAsync(stream); |
| 938 | |
| 939 | // Asynchronously enqueue the inference work |
| 940 | if (mParams.useILoop ? !context->enqueueV2(buffers.getDeviceBindings().data(), stream, nullptr) |
| 941 | : !context->enqueue(mParams.batchSize, buffers.getDeviceBindings().data(), stream, nullptr)) |
| 942 | { |
| 943 | return false; |
| 944 | } |
| 945 | // Asynchronously copy data from device output buffers to host output buffers |
| 946 | buffers.copyOutputToHostAsync(stream); |
| 947 | |
| 948 | CHECK(cudaStreamSynchronize(stream)); |
| 949 | return true; |
| 950 | } |
| 951 | |
| 952 | //! |
| 953 | //! \brief Copies Ct/Ht output from the RNN to the Ct-1/Ht-1 input buffers for next time step |
nothing calls this directly
no test coverage detected