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

Function process

samples/sampleIOFormats/sampleIOFormats.cpp:631–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629//!
630template <typename T>
631bool process(SampleIOFormats& sample, sample::Logger::TestAtom const& sampleTest, SampleBuffer& inputBuf,
632 SampleBuffer& outputBuf, SampleBuffer& goldenInput)
633{
634 sample::gLogInfo << "Building and running a GPU inference engine with specified I/O formats." << std::endl;
635
636 inputBuf = SampleBuffer(sample.mInputDims, sizeof(T), sample.mTensorFormat, true);
637 outputBuf = SampleBuffer(sample.mOutputDims, sizeof(float), TensorFormat::kLINEAR, false);
638 if (!sample.build(sizeof(T)))
639 {
640 return false;
641 }
642 convertGoldenData<T>(goldenInput, inputBuf);
643
644 if (!sample.infer(inputBuf, outputBuf))
645 {
646 return false;
647 }
648
649 if (!sample.verifyOutput<T>(outputBuf, sample.mDigit))
650 {
651 return false;
652 }
653
654 return true;
655}
656
657bool runFP32Reference(SampleIOFormats& sample, sample::Logger::TestAtom const& sampleTest, SampleBuffer& goldenInput,
658 SampleBuffer& goldenOutput)

Callers

nothing calls this directly

Calls 3

SampleBufferClass · 0.85
buildMethod · 0.45
inferMethod · 0.45

Tested by

no test coverage detected