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

Function parseSampleINT8APIArgs

samples/sampleINT8API/sampleINT8API.cpp:688–752  ·  view source on GitHub ↗

\brief This function parses arguments specific to SampleINT8API

Source from the content-addressed store, hash-verified

686//! \brief This function parses arguments specific to SampleINT8API
687//!
688bool parseSampleINT8APIArgs(SampleINT8APIArgs& args, int argc, char* argv[])
689{
690 for (int i = 1; i < argc; ++i)
691 {
692 if (!strncmp(argv[i], "--model=", 8))
693 {
694 args.modelFileName = (argv[i] + 8);
695 }
696 else if (!strncmp(argv[i], "--image=", 8))
697 {
698 args.imageFileName = (argv[i] + 8);
699 }
700 else if (!strncmp(argv[i], "--reference=", 12))
701 {
702 args.referenceFileName = (argv[i] + 12);
703 }
704 else if (!strncmp(argv[i], "--write_tensors", 15))
705 {
706 args.writeNetworkTensors = true;
707 }
708 else if (!strncmp(argv[i], "--network_tensors_file=", 23))
709 {
710 args.networkTensorsFileName = (argv[i] + 23);
711 }
712 else if (!strncmp(argv[i], "--ranges=", 9))
713 {
714 args.dynamicRangeFileName = (argv[i] + 9);
715 }
716 else if (!strncmp(argv[i], "--int8", 6))
717 {
718 args.runInInt8 = true;
719 }
720 else if (!strncmp(argv[i], "--fp16", 6))
721 {
722 args.runInFp16 = true;
723 }
724 else if (!strncmp(argv[i], "--useDLACore=", 13))
725 {
726 args.useDLACore = std::stoi(argv[i] + 13);
727 }
728 else if (!strncmp(argv[i], "--data=", 7))
729 {
730 std::string dirPath = (argv[i] + 7);
731 if (dirPath.back() != '/')
732 {
733 dirPath.push_back('/');
734 }
735 args.dataDirs.push_back(dirPath);
736 }
737 else if (!strncmp(argv[i], "--verbose", 9) || !strncmp(argv[i], "-v", 2))
738 {
739 args.verbose = true;
740 }
741 else if (!strncmp(argv[i], "--help", 6) || !strncmp(argv[i], "-h", 2))
742 {
743 args.help = true;
744 }
745 else

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected