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

Function main

samples/sampleOnnxMNIST/sampleOnnxMNIST.cpp:376–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376int main(int argc, char** argv)
377{
378 samplesCommon::Args args;
379 bool argsOK = samplesCommon::parseArgs(args, argc, argv);
380 if (!argsOK)
381 {
382 sample::gLogError << "Invalid arguments" << std::endl;
383 printHelpInfo();
384 return EXIT_FAILURE;
385 }
386 if (args.help)
387 {
388 printHelpInfo();
389 return EXIT_SUCCESS;
390 }
391
392 auto sampleTest = sample::gLogger.defineTest(gSampleName, argc, argv);
393
394 sample::gLogger.reportTestStart(sampleTest);
395
396 SampleOnnxMNIST sample(initializeSampleParams(args));
397
398 sample::gLogInfo << "Building and running a GPU inference engine for Onnx MNIST" << std::endl;
399
400 if (!sample.build())
401 {
402 return sample::gLogger.reportFail(sampleTest);
403 }
404 if (!sample.infer())
405 {
406 return sample::gLogger.reportFail(sampleTest);
407 }
408
409 return sample::gLogger.reportPass(sampleTest);
410}

Callers

nothing calls this directly

Calls 9

printHelpInfoFunction · 0.70
initializeSampleParamsFunction · 0.70
parseArgsFunction · 0.50
defineTestMethod · 0.45
reportTestStartMethod · 0.45
buildMethod · 0.45
reportFailMethod · 0.45
inferMethod · 0.45
reportPassMethod · 0.45

Tested by

no test coverage detected