armnn/0003-add-more-test-command-line-arguments.patch
Guillaume GARDET fb9078d4c9 Accepting request 743457 from home:Guillaume_G:branches:science:machinelearning
- Enable ONNX for Tumbleweed

- Add downstream ArmnnExamples in a separate '-extratests' package
  with patches:
  * 0003-add-more-test-command-line-arguments.patch
  * 0005-add-armnn-mobilenet-test-example.patch
  * 0006-armnn-mobilenet-test-example.patch
  * 0007-enable-use-of-arm-compute-shared-library.patch
  * 0009-command-line-options-for-video-port-selection.patch
  * 0010-armnnexamples-update-for-19.08-modifications.patch
- Fix build when extratests are disabled
  * armnn-fix_find_opencv.patch

OBS-URL: https://build.opensuse.org/request/show/743457
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/armnn?expand=0&rev=9
2019-10-28 10:54:22 +00:00

75 lines
2.7 KiB
Diff

From 964cb82f3b811aec6663255ab0aa589f0a3be0ee Mon Sep 17 00:00:00 2001
From: Qin Su <qsu@ti.com>
Date: Fri, 22 Feb 2019 14:10:07 -0500
Subject: [PATCH] add more test command line arguments
Upstream-Status: Inappropriate [TI only test code]
Signed-off-by: Qin Su <qsu@ti.com>
---
tests/InferenceTest.inl | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/tests/InferenceTest.inl b/tests/InferenceTest.inl
index 538720b..6fd21b8 100644
--- a/tests/InferenceTest.inl
+++ b/tests/InferenceTest.inl
@@ -326,6 +326,55 @@ int ClassifierInferenceTestMain(int argc,
BOOST_ASSERT(modelFilename);
BOOST_ASSERT(inputBindingName);
BOOST_ASSERT(outputBindingName);
+ int count;
+ const char *p_input;
+ char inmodelname[500];
+ char outtensorname[500];
+
+ /* parse command line */
+ for (count = 1; count < argc; count++)
+ {
+ if (*(argv[count]) == '+')
+ {
+ p_input = argv[count] + 1;
+ switch (*(p_input))
+ {
+ case 'i':
+ case 'I':
+ strcpy(inmodelname, p_input + 2);
+ modelFilename = &inmodelname[0];
+ std::cout << "Input model = " << modelFilename << std::endl;
+ break;
+ case 'o':
+ case 'O':
+ strcpy(outtensorname, p_input + 2);
+ outputBindingName = &outtensorname[0];
+ std::cout << "out tensor name = " << outputBindingName << std::endl;
+ break;
+ default:
+ break;
+ }
+ }
+ else if (*(argv[count]) == '-')
+ {
+ p_input = argv[count] + 1;
+ switch (*(p_input))
+ {
+ case '-':
+ p_input = argv[count] + 2;
+ case 'h':
+ case 'H':
+ std::cout <<"\nAdditional Options: " << std::endl;
+ std::cout <<" +i Set user specified inference model name." << std::endl;
+ std::cout <<" If not set, default name is used." << std::endl;
+ std::cout <<" +o Set user specified output tensor name." << std::endl;
+ std::cout <<" If not set, default name is used.\n" << std::endl;
+ break;
+ default:
+ break;
+ }
+ }
+ }
return InferenceTestMain(argc, argv, defaultTestCaseIds,
[=]
--
1.9.1