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
ac031de5
Commit
ac031de5
authored
May 01, 2019
by
Paul
Browse files
Formatting
parent
029d227a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
src/propagate_constant.cpp
src/propagate_constant.cpp
+6
-5
No files found.
src/propagate_constant.cpp
View file @
ac031de5
...
@@ -22,14 +22,15 @@ bool skip_propogate(instruction_ref ins)
...
@@ -22,14 +22,15 @@ bool skip_propogate(instruction_ref ins)
void
propagate_constant
::
apply
(
program
&
p
)
const
void
propagate_constant
::
apply
(
program
&
p
)
const
{
{
for
(
auto
i
:
iterator_for
(
p
))
for
(
auto
i
:
iterator_for
(
p
))
{
{
if
(
i
->
name
()
!=
"@literal"
)
if
(
i
->
name
()
!=
"@literal"
)
continue
;
continue
;
if
(
i
->
outputs
().
empty
())
if
(
i
->
outputs
().
empty
())
continue
;
continue
;
fix
([
&
](
auto
self
,
auto
ins
)
{
fix
([
&
](
auto
self
,
auto
ins
)
{
std
::
unordered_set
<
instruction_ref
>
children
(
ins
->
outputs
().
begin
(),
ins
->
outputs
().
end
());
std
::
unordered_set
<
instruction_ref
>
children
(
ins
->
outputs
().
begin
(),
ins
->
outputs
().
end
());
for
(
auto
child
:
children
)
for
(
auto
child
:
children
)
{
{
if
(
not
skip_propogate
(
child
))
if
(
not
skip_propogate
(
child
))
...
@@ -41,7 +42,7 @@ void propagate_constant::apply(program& p) const
...
@@ -41,7 +42,7 @@ void propagate_constant::apply(program& p) const
auto
l
=
p
.
add_literal
(
r
.
get_shape
(),
r
.
data
());
auto
l
=
p
.
add_literal
(
r
.
get_shape
(),
r
.
data
());
self
(
p
.
replace_instruction
(
child
,
l
));
self
(
p
.
replace_instruction
(
child
,
l
));
}
}
}
}
else
else
{
{
self
(
child
);
self
(
child
);
...
...
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