Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
5e1f59eb
Commit
5e1f59eb
authored
Jun 06, 2019
by
Paul
Browse files
Print out default values
parent
39151d49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/driver/argument_parser.hpp
src/driver/argument_parser.hpp
+8
-1
No files found.
src/driver/argument_parser.hpp
View file @
5e1f59eb
...
...
@@ -16,6 +16,7 @@
#include <migraphx/requires.hpp>
#include <migraphx/type_name.hpp>
#include <migraphx/functional.hpp>
#include <migraphx/stringutils.hpp>
namespace
migraphx
{
namespace
driver
{
...
...
@@ -64,6 +65,7 @@ struct argument_parser
std
::
string
type
=
""
;
std
::
string
help
=
""
;
std
::
string
metavar
=
""
;
std
::
string
default_value
=
""
;
unsigned
nargs
=
1
;
};
...
...
@@ -79,6 +81,7 @@ struct argument_parser
argument
&
arg
=
arguments
.
back
();
arg
.
type
=
migraphx
::
get_type_name
<
T
>
();
arg
.
default_value
=
to_string
(
x
);
migraphx
::
each_args
([
&
](
auto
f
)
{
f
(
x
,
arg
);
},
fs
...);
}
...
...
@@ -150,8 +153,12 @@ struct argument_parser
std
::
cout
<<
a
;
prefix
=
", "
;
}
if
(
not
arg
.
type
.
empty
())
if
(
not
arg
.
type
.
empty
())
{
std
::
cout
<<
" ["
<<
arg
.
type
<<
"]"
;
if
(
not
arg
.
default_value
.
empty
())
std
::
cout
<<
" (Default: "
<<
arg
.
default_value
<<
")"
;
}
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
" "
<<
arg
.
help
<<
std
::
endl
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment