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

Function runFP32Reference

samples/sampleIOFormats/sampleIOFormats.cpp:657–683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657bool runFP32Reference(SampleIOFormats& sample, sample::Logger::TestAtom const& sampleTest, SampleBuffer& goldenInput,
658 SampleBuffer& goldenOutput)
659{
660 sample::gLogInfo << "Building and running a FP32 GPU inference to get golden input/output" << std::endl;
661
662 if (!sample.build(sizeof(float)))
663 {
664 return false;
665 }
666
667 goldenInput = SampleBuffer(sample.mInputDims, sizeof(float), TensorFormat::kLINEAR, true);
668 goldenOutput = SampleBuffer(sample.mOutputDims, sizeof(float), TensorFormat::kLINEAR, false);
669
670 sample.readDigits(goldenInput, sample.mDigit);
671
672 if (!sample.infer(goldenInput, goldenOutput))
673 {
674 return false;
675 }
676
677 if (!sample.verifyOutput<float>(goldenOutput, sample.mDigit))
678 {
679 return false;
680 }
681
682 return true;
683}
684
685//! Specification for a network I/O tensor.
686class IOSpec

Callers 1

mainFunction · 0.85

Calls 4

SampleBufferClass · 0.85
readDigitsMethod · 0.80
buildMethod · 0.45
inferMethod · 0.45

Tested by

no test coverage detected