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
12a1d140
Commit
12a1d140
authored
Feb 20, 2019
by
Paul
Browse files
Formatting
parent
4d449dcb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
src/program.cpp
src/program.cpp
+11
-10
test/eval_test.cpp
test/eval_test.cpp
+2
-2
No files found.
src/program.cpp
View file @
12a1d140
...
@@ -348,14 +348,15 @@ argument generic_eval(const program& p,
...
@@ -348,14 +348,15 @@ argument generic_eval(const program& p,
}
}
else
if
(
ins
->
name
()
==
"@param"
)
else
if
(
ins
->
name
()
==
"@param"
)
{
{
results
.
emplace
(
ins
,
trace
(
ins
,
[
&
]
{
results
.
emplace
(
auto
param_name
=
ins
,
trace
(
ins
,
[
&
]
{
any_cast
<
builtin
::
param
>
(
ins
->
get_operator
()).
parameter
;
auto
param_name
=
any_cast
<
builtin
::
param
>
(
ins
->
get_operator
()).
parameter
;
if
(
not
contains
(
params
,
param_name
))
if
(
not
contains
(
params
,
param_name
))
MIGRAPHX_THROW
(
"Parameter not found: "
+
param_name
);
MIGRAPHX_THROW
(
"Parameter not found: "
+
param_name
);
auto
param
=
params
.
at
(
param_name
);
auto
param
=
params
.
at
(
param_name
);
if
(
param
.
get_shape
()
!=
ins
->
get_shape
())
if
(
param
.
get_shape
()
!=
ins
->
get_shape
())
MIGRAPHX_THROW
(
"Incorrect shape {"
+
to_string
(
param
.
get_shape
())
+
"} for parameter: "
+
param_name
);
MIGRAPHX_THROW
(
"Incorrect shape {"
+
to_string
(
param
.
get_shape
())
+
"} for parameter: "
+
param_name
);
return
param
;
return
param
;
}));
}));
}
}
...
...
test/eval_test.cpp
View file @
12a1d140
...
@@ -177,8 +177,8 @@ TEST_CASE(param_shape_error_test)
...
@@ -177,8 +177,8 @@ TEST_CASE(param_shape_error_test)
p
.
add_instruction
(
sum_op
{},
x
,
y
);
p
.
add_instruction
(
sum_op
{},
x
,
y
);
EXPECT
(
test
::
throws
<
migraphx
::
exception
>
(
EXPECT
(
test
::
throws
<
migraphx
::
exception
>
(
[
&
]
{
[
&
]
{
p
.
eval
(
p
.
eval
(
{{
"x"
,
migraphx
::
literal
{
1
}.
get_argument
()},
{{
"x"
,
migraphx
::
literal
{
1
}.
get_argument
()},
{
"y"
,
migraphx
::
literal
{
2
}.
get_argument
()}});
{
"y"
,
migraphx
::
literal
{
2
}.
get_argument
()}});
},
},
"Incorrect shape"
));
"Incorrect shape"
));
}
}
...
...
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