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
bf3789fa
Commit
bf3789fa
authored
Aug 11, 2018
by
Paul
Browse files
Formatting
parent
d2d5fd19
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
13 deletions
+8
-13
src/include/migraph/instruction.hpp
src/include/migraph/instruction.hpp
+6
-9
src/include/migraph/program.hpp
src/include/migraph/program.hpp
+1
-2
src/program.cpp
src/program.cpp
+1
-2
No files found.
src/include/migraph/instruction.hpp
View file @
bf3789fa
...
@@ -75,8 +75,7 @@ struct instruction
...
@@ -75,8 +75,7 @@ struct instruction
bool
valid
(
instruction_ref
start
)
const
bool
valid
(
instruction_ref
start
)
const
{
{
return
valid
()
&&
return
valid
()
&&
std
::
all_of
(
arguments
.
begin
(),
arguments
.
end
(),
[
&
](
instruction_ref
i
)
{
std
::
all_of
(
arguments
.
begin
(),
arguments
.
end
(),
[
&
](
instruction_ref
i
)
{
auto
self
=
std
::
find
(
i
->
output
.
begin
(),
i
->
output
.
end
(),
*
this
);
auto
self
=
std
::
find
(
i
->
output
.
begin
(),
i
->
output
.
end
(),
*
this
);
return
self
!=
i
->
output
.
end
()
&&
return
self
!=
i
->
output
.
end
()
&&
std
::
distance
(
start
,
i
)
<
std
::
distance
(
start
,
*
self
);
std
::
distance
(
start
,
i
)
<
std
::
distance
(
start
,
*
self
);
...
@@ -106,9 +105,7 @@ struct instruction
...
@@ -106,9 +105,7 @@ struct instruction
}
}
}
}
return
result
==
computed
&&
return
result
==
computed
&&
std
::
all_of
(
output
.
begin
(),
std
::
all_of
(
output
.
begin
(),
output
.
end
(),
[
&
](
instruction_ref
i
)
{
output
.
end
(),
[
&
](
instruction_ref
i
)
{
return
std
::
find
(
i
->
arguments
.
begin
(),
i
->
arguments
.
end
(),
*
this
)
!=
return
std
::
find
(
i
->
arguments
.
begin
(),
i
->
arguments
.
end
(),
*
this
)
!=
i
->
arguments
.
end
();
i
->
arguments
.
end
();
});
});
...
@@ -126,7 +123,7 @@ struct instruction
...
@@ -126,7 +123,7 @@ struct instruction
output
.
push_back
(
ins
);
output
.
push_back
(
ins
);
}
}
template
<
class
T
>
template
<
class
T
>
void
remove_output
(
const
T
&
ins
)
void
remove_output
(
const
T
&
ins
)
{
{
migraph
::
erase
(
output
,
ins
);
migraph
::
erase
(
output
,
ins
);
...
...
src/include/migraph/program.hpp
View file @
bf3789fa
...
@@ -55,8 +55,7 @@ struct program
...
@@ -55,8 +55,7 @@ struct program
instruction_ref
instruction_ref
replace_instructions
(
instruction_ref
ins
,
instruction_ref
start
,
instruction_ref
last
);
replace_instructions
(
instruction_ref
ins
,
instruction_ref
start
,
instruction_ref
last
);
instruction_ref
instruction_ref
replace_instruction
(
instruction_ref
ins
,
instruction_ref
start
);
replace_instruction
(
instruction_ref
ins
,
instruction_ref
start
);
instruction_ref
remove_instruction
(
instruction_ref
ins
);
instruction_ref
remove_instruction
(
instruction_ref
ins
);
instruction_ref
remove_instructions
(
instruction_ref
first
,
instruction_ref
last
);
instruction_ref
remove_instructions
(
instruction_ref
first
,
instruction_ref
last
);
...
...
src/program.cpp
View file @
bf3789fa
...
@@ -77,8 +77,7 @@ program::replace_instructions(instruction_ref ins, instruction_ref start, instru
...
@@ -77,8 +77,7 @@ program::replace_instructions(instruction_ref ins, instruction_ref start, instru
return
rep
;
return
rep
;
}
}
instruction_ref
instruction_ref
program
::
replace_instruction
(
instruction_ref
ins
,
instruction_ref
start
)
program
::
replace_instruction
(
instruction_ref
ins
,
instruction_ref
start
)
{
{
assert
(
ins
!=
start
);
assert
(
ins
!=
start
);
return
replace_instructions
(
ins
,
start
,
std
::
next
(
start
));
return
replace_instructions
(
ins
,
start
,
std
::
next
(
start
));
...
...
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