| 655 | } |
| 656 | |
| 657 | bool 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. |
| 686 | class IOSpec |
no test coverage detected