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

Function main

samples/sampleNamedDimensions/sampleNamedDimensions.cpp:399–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399int32_t main(int32_t argc, char** argv)
400{
401 samplesCommon::Args args;
402 bool argsOK = samplesCommon::parseArgs(args, argc, argv);
403 if (!argsOK)
404 {
405 sample::gLogError << "Invalid arguments" << std::endl;
406 printHelpInfo();
407 return EXIT_FAILURE;
408 }
409 if (args.help)
410 {
411 printHelpInfo();
412 return EXIT_SUCCESS;
413 }
414
415 auto sampleTest = sample::gLogger.defineTest(gSampleName, argc, argv);
416
417 sample::gLogger.reportTestStart(sampleTest);
418
419 SampleNamedDimensions sample(initializeSampleParams(args));
420
421 sample::gLogInfo << "Building and running a GPU inference engine for synthetic ONNX model" << std::endl;
422
423 sample.setNamedDimension(2);
424
425 if (!sample.build())
426 {
427 return sample::gLogger.reportFail(sampleTest);
428 }
429 if (!sample.infer())
430 {
431 return sample::gLogger.reportFail(sampleTest);
432 }
433
434 return sample::gLogger.reportPass(sampleTest);
435}

Callers

nothing calls this directly

Calls 10

setNamedDimensionMethod · 0.80
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