\brief Runs the char-rnn model in TensorRT with a set of expected input and output strings.
| 1059 | //! \brief Runs the char-rnn model in TensorRT with a set of expected input and output strings. |
| 1060 | //! |
| 1061 | int 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 | } |
nothing calls this directly
no test coverage detected