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
af86d975
"test/ref_ops_test.cpp" did not exist on "41ed1924e77fc0c19b20569f5b56428bd1d6569f"
Commit
af86d975
authored
Oct 10, 2018
by
Paul
Browse files
Formatting
parent
94ef1ad0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
src/constant_propagate.cpp
src/constant_propagate.cpp
+2
-5
test/constant_propagate_test.cpp
test/constant_propagate_test.cpp
+7
-8
No files found.
src/constant_propagate.cpp
View file @
af86d975
...
...
@@ -14,7 +14,7 @@ struct match_const_add
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
{
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
arg1
=
ins
->
inputs
().
at
(
0
)
->
get_literal
();
auto
arg2
=
ins
->
inputs
().
at
(
1
)
->
get_literal
();
...
...
@@ -23,9 +23,6 @@ struct match_const_add
}
};
void
constant_propagate
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
match_const_add
{});
}
void
constant_propagate
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
match_const_add
{});
}
}
// namespace migraph
test/constant_propagate_test.cpp
View file @
af86d975
...
...
@@ -14,7 +14,7 @@ struct const_prop_target
migraph
::
context
get_context
()
const
{
return
{};
}
};
void
const_add1
()
void
const_add1
()
{
migraph
::
program
p1
;
auto
one
=
p1
.
add_literal
(
1
);
...
...
@@ -29,8 +29,7 @@ void const_add1()
EXPECT
(
p1
==
p2
);
}
void
const_add2
()
void
const_add2
()
{
migraph
::
program
p1
;
auto
one
=
p1
.
add_parameter
(
"one"
,
{
migraph
::
shape
::
int32_type
,
{
1
}});
...
...
@@ -45,11 +44,11 @@ void const_add2()
EXPECT
(
p1
!=
p2
);
}
void
const_add3
()
void
const_add3
()
{
migraph
::
program
p1
;
auto
one
=
p1
.
add_literal
(
1
);
auto
two
=
p1
.
add_literal
(
2
);
auto
one
=
p1
.
add_literal
(
1
);
auto
two
=
p1
.
add_literal
(
2
);
auto
sum1
=
p1
.
add_instruction
(
migraph
::
op
::
add
{},
one
,
two
);
auto
sum2
=
p1
.
add_instruction
(
migraph
::
op
::
add
{},
sum1
,
two
);
p1
.
add_instruction
(
pass_op
{},
sum2
);
...
...
@@ -61,9 +60,9 @@ void const_add3()
EXPECT
(
p1
==
p2
);
}
int
main
()
{
int
main
()
{
const_add1
();
const_add2
();
const_add3
();
}
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