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

Function main

samples/sampleCharRNN/sampleCharRNN.cpp:1061–1110  ·  view source on GitHub ↗

\brief Runs the char-rnn model in TensorRT with a set of expected input and output strings.

Source from the content-addressed store, hash-verified

1059//! \brief Runs the char-rnn model in TensorRT with a set of expected input and output strings.
1060//!
1061int main(int argc, char** argv)
1062{
1063 sample::setReportableSeverity(sample::Logger::Severity::kVERBOSE);
1064 samplesCommon::Args args;
1065 bool argsOK = samplesCommon::parseArgs(args, argc, argv);
1066 if (!argsOK)
1067 {
1068 sample::gLogError << "Invalid arguments" << std::endl;
1069 printHelpInfo();
1070 return EXIT_FAILURE;
1071 }
1072 if (args.help)
1073 {
1074 printHelpInfo();
1075 return EXIT_SUCCESS;
1076 }
1077
1078 auto sampleTest = sample::gLogger.defineTest(gSampleName, argc, argv);
1079
1080 sample::gLogger.reportTestStart(sampleTest);
1081
1082 SampleCharRNNParams params = initializeSampleParams(args);
1083 std::unique_ptr<SampleCharRNNBase> sample;
1084
1085 if (args.useILoop)
1086 {
1087 sample.reset(new SampleCharRNNLoop(params));
1088 }
1089 else
1090 {
1091 sample.reset(new SampleCharRNNv2(params));
1092 }
1093
1094 sample::gLogInfo << "Building and running a GPU inference engine for Char RNN model..." << std::endl;
1095
1096 if (!sample->build())
1097 {
1098 return sample::gLogger.reportFail(sampleTest);
1099 }
1100 if (!sample->infer())
1101 {
1102 return sample::gLogger.reportFail(sampleTest);
1103 }
1104 if (!sample->teardown())
1105 {
1106 return sample::gLogger.reportFail(sampleTest);
1107 }
1108
1109 return sample::gLogger.reportPass(sampleTest);
1110}

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected