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
4f2a71af
Commit
4f2a71af
authored
May 04, 2018
by
Paul
Browse files
Track the ouput of instructions
parent
323f2714
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
1 deletion
+4
-1
include/rtg/instruction.hpp
include/rtg/instruction.hpp
+1
-0
src/program.cpp
src/program.cpp
+3
-1
No files found.
include/rtg/instruction.hpp
View file @
4f2a71af
...
@@ -22,6 +22,7 @@ struct instruction
...
@@ -22,6 +22,7 @@ struct instruction
operation
op
;
operation
op
;
shape
result
;
shape
result
;
std
::
vector
<
instruction_ref
>
output
;
std
::
vector
<
instruction_ref
>
arguments
;
std
::
vector
<
instruction_ref
>
arguments
;
literal
lit
;
literal
lit
;
};
};
...
...
src/program.cpp
View file @
4f2a71af
...
@@ -29,7 +29,9 @@ instruction_ref program::add_instruction(operation op, std::vector<instruction_r
...
@@ -29,7 +29,9 @@ instruction_ref program::add_instruction(operation op, std::vector<instruction_r
shape
r
=
op
.
compute_shape
(
shapes
);
shape
r
=
op
.
compute_shape
(
shapes
);
impl
->
instructions
.
push_back
({
op
,
r
,
args
});
impl
->
instructions
.
push_back
({
op
,
r
,
args
});
assert
(
impl
->
instructions
.
back
().
arguments
==
args
);
assert
(
impl
->
instructions
.
back
().
arguments
==
args
);
return
std
::
prev
(
impl
->
instructions
.
end
());
auto
result
=
std
::
prev
(
impl
->
instructions
.
end
());
for
(
auto
&&
arg
:
args
)
arg
->
output
.
push_back
(
result
);
return
result
;
}
}
instruction_ref
program
::
add_literal
(
literal
l
)
instruction_ref
program
::
add_literal
(
literal
l
)
...
...
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