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
18273046
Commit
18273046
authored
Oct 10, 2022
by
Paul
Browse files
Allow putting inputs in the settings
parent
d11ec237
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
src/targets/gpu/driver/compile_op.cpp
src/targets/gpu/driver/compile_op.cpp
+1
-1
src/targets/gpu/driver/include/migraphx/gpu/driver/parser.hpp
...targets/gpu/driver/include/migraphx/gpu/driver/parser.hpp
+2
-0
src/targets/gpu/driver/parser.cpp
src/targets/gpu/driver/parser.cpp
+5
-0
src/targets/gpu/driver/run_op.cpp
src/targets/gpu/driver/run_op.cpp
+1
-1
No files found.
src/targets/gpu/driver/compile_op.cpp
View file @
18273046
...
...
@@ -36,7 +36,7 @@ struct compile_op : action<compile_op>
static
void
apply
(
const
parser
&
p
,
const
value
&
v
)
{
context
ctx
;
auto
inputs
=
p
.
parse_shapes
(
v
.
at
(
"
inputs
"
)
);
auto
inputs
=
p
.
get_
inputs
(
v
);
auto
op
=
gpu
::
compile_op
(
v
.
at
(
"name"
).
to
<
std
::
string
>
(),
ctx
,
inputs
,
v
);
auto
[
host_time
,
device_time
]
=
time_op
(
ctx
,
op
,
inputs
,
p
.
get
(
v
,
"iterations"
,
100
));
std
::
cout
<<
op
<<
": "
<<
host_time
<<
"ms"
;
...
...
src/targets/gpu/driver/include/migraphx/gpu/driver/parser.hpp
View file @
18273046
...
...
@@ -53,6 +53,8 @@ struct parser
std
::
vector
<
shape
>
parse_shapes
(
const
value
&
v
)
const
;
std
::
vector
<
shape
>
get_inputs
(
const
value
&
v
)
const
;
void
load_settings
(
const
value
&
v
);
static
void
process
(
const
value
&
v
);
...
...
src/targets/gpu/driver/parser.cpp
View file @
18273046
...
...
@@ -55,6 +55,11 @@ std::vector<shape> parser::parse_shapes(const value& v) const
return
result
;
}
std
::
vector
<
shape
>
parser
::
get_inputs
(
const
value
&
v
)
const
{
return
parse_shapes
(
get
(
v
,
"inputs"
,
value
{}));
}
void
parser
::
load_settings
(
const
value
&
v
)
{
if
(
v
.
contains
(
"settings"
))
...
...
src/targets/gpu/driver/run_op.cpp
View file @
18273046
...
...
@@ -36,7 +36,7 @@ struct run_op : action<run_op>
static
void
apply
(
const
parser
&
p
,
const
value
&
v
)
{
context
ctx
;
auto
inputs
=
p
.
parse_shapes
(
v
.
at
(
"
inputs
"
)
);
auto
inputs
=
p
.
get_
inputs
(
v
);
auto
name
=
v
.
at
(
"name"
).
to
<
std
::
string
>
();
if
(
not
contains
(
name
,
"::"
))
name
=
"gpu::"
+
name
;
...
...
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