Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
9077db18
Unverified
Commit
9077db18
authored
Mar 14, 2022
by
Paul Fultz II
Committed by
GitHub
Mar 14, 2022
Browse files
Show the operator fields in the driver (#1103)
* Show the operator fields in the driver
parent
b3b44f5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
src/driver/main.cpp
src/driver/main.cpp
+8
-0
src/include/migraphx/json.hpp
src/include/migraphx/json.hpp
+1
-0
src/json.cpp
src/json.cpp
+6
-0
No files found.
src/driver/main.cpp
View file @
9077db18
...
...
@@ -505,8 +505,10 @@ struct roctx : command<roctx>
struct
op
:
command
<
op
>
{
bool
show_ops
=
false
;
std
::
string
op_name
{};
void
parse
(
argument_parser
&
ap
)
{
ap
(
op_name
,
{},
ap
.
metavar
(
"<MIGraphX operator name>"
));
ap
(
show_ops
,
{
"--list"
,
"-l"
},
ap
.
help
(
"List all the operators of MIGraphX"
),
...
...
@@ -519,6 +521,12 @@ struct op : command<op>
for
(
const
auto
&
name
:
get_operators
())
std
::
cout
<<
name
<<
std
::
endl
;
}
else
{
auto
op
=
load_op
(
op_name
);
std
::
cout
<<
op_name
<<
": "
<<
std
::
endl
;
std
::
cout
<<
to_pretty_json_string
(
op
.
to_value
())
<<
std
::
endl
;
}
}
};
...
...
src/include/migraphx/json.hpp
View file @
9077db18
...
...
@@ -8,6 +8,7 @@
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
std
::
string
to_pretty_json_string
(
const
value
&
val
,
std
::
size_t
indent
=
4
);
std
::
string
to_json_string
(
const
value
&
val
);
value
from_json_string
(
const
std
::
string
&
str
);
value
from_json_string
(
const
char
*
str
,
std
::
size_t
size
);
...
...
src/json.cpp
View file @
9077db18
...
...
@@ -133,6 +133,12 @@ std::string to_json_string(const value& val)
return
j
.
dump
();
}
std
::
string
to_pretty_json_string
(
const
value
&
val
,
std
::
size_t
indent
)
{
json
j
=
val
;
return
j
.
dump
(
indent
);
}
migraphx
::
value
from_json_string
(
const
char
*
str
,
std
::
size_t
size
)
{
json
j
=
json
::
parse
(
str
,
str
+
size
);
...
...
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