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
a4fb3d04
Commit
a4fb3d04
authored
Jul 10, 2018
by
Paul
Browse files
Formatting
parent
cf5baca1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
src/include/migraph/instruction.hpp
src/include/migraph/instruction.hpp
+2
-1
src/program.cpp
src/program.cpp
+6
-3
test/validate.cpp
test/validate.cpp
+2
-1
No files found.
src/include/migraph/instruction.hpp
View file @
a4fb3d04
...
@@ -73,7 +73,8 @@ struct instruction
...
@@ -73,7 +73,8 @@ struct instruction
{
{
computed
=
result
;
computed
=
result
;
}
}
else
{
else
{
try
try
{
{
computed
=
compute_shape
(
op
,
arguments
);
computed
=
compute_shape
(
op
,
arguments
);
...
...
src/program.cpp
View file @
a4fb3d04
...
@@ -141,14 +141,17 @@ void program::compile(const target& t)
...
@@ -141,14 +141,17 @@ void program::compile(const target& t)
p
.
apply
(
*
this
);
p
.
apply
(
*
this
);
#ifndef NDEBUG
#ifndef NDEBUG
auto
invalid
=
this
->
validate
();
auto
invalid
=
this
->
validate
();
if
(
invalid
!=
impl
->
instructions
.
end
())
{
if
(
invalid
!=
impl
->
instructions
.
end
())
{
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
MIGRAPH_THROW
(
p
.
name
()
+
" pass produces invalid program at instruction "
+
std
::
to_string
(
index
));
MIGRAPH_THROW
(
p
.
name
()
+
" pass produces invalid program at instruction "
+
std
::
to_string
(
index
));
}
}
#endif
#endif
}
}
auto
invalid
=
this
->
validate
();
auto
invalid
=
this
->
validate
();
if
(
invalid
!=
impl
->
instructions
.
end
())
{
if
(
invalid
!=
impl
->
instructions
.
end
())
{
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
auto
index
=
std
::
distance
(
impl
->
instructions
.
begin
(),
invalid
);
MIGRAPH_THROW
(
"Invalid program from compilation at instruction "
+
std
::
to_string
(
index
));
MIGRAPH_THROW
(
"Invalid program from compilation at instruction "
+
std
::
to_string
(
index
));
}
}
...
...
test/validate.cpp
View file @
a4fb3d04
...
@@ -27,7 +27,8 @@ void out_of_order()
...
@@ -27,7 +27,8 @@ void out_of_order()
EXPECT
(
bool
{
p
.
validate
()
==
ins
});
EXPECT
(
bool
{
p
.
validate
()
==
ins
});
}
}
int
main
()
{
int
main
()
{
simple_test
();
simple_test
();
out_of_order
();
out_of_order
();
}
}
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