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
dba5bc56
Commit
dba5bc56
authored
Nov 09, 2018
by
Paul
Browse files
Improve print out of trace eval
parent
6eb13d95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
src/include/migraph/program.hpp
src/include/migraph/program.hpp
+3
-3
src/program.cpp
src/program.cpp
+5
-4
No files found.
src/include/migraph/program.hpp
View file @
dba5bc56
...
@@ -97,9 +97,9 @@ struct program
...
@@ -97,9 +97,9 @@ struct program
void
perf_report
(
std
::
ostream
&
os
,
std
::
size_t
n
,
parameter_map
params
)
const
;
void
perf_report
(
std
::
ostream
&
os
,
std
::
size_t
n
,
parameter_map
params
)
const
;
void
debug_print
();
void
debug_print
()
const
;
void
debug_print
(
instruction_ref
ins
);
void
debug_print
(
instruction_ref
ins
)
const
;
void
debug_print
(
const
std
::
vector
<
instruction_ref
>&
inss
);
void
debug_print
(
const
std
::
vector
<
instruction_ref
>&
inss
)
const
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
program
&
p
);
friend
bool
operator
==
(
const
program
&
x
,
const
program
&
y
);
friend
bool
operator
==
(
const
program
&
x
,
const
program
&
y
);
...
...
src/program.cpp
View file @
dba5bc56
...
@@ -366,7 +366,8 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
...
@@ -366,7 +366,8 @@ argument program::eval(std::unordered_map<std::string, argument> params) const
auto
&
ctx
=
this
->
impl
->
ctx
;
auto
&
ctx
=
this
->
impl
->
ctx
;
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
return
generic_eval
(
*
this
,
this
->
impl
->
ctx
,
std
::
move
(
params
),
[
&
](
auto
&
ins
,
auto
f
)
{
ctx
.
finish
();
ctx
.
finish
();
std
::
cout
<<
"Run instruction: "
<<
ins
->
name
()
<<
std
::
endl
;
std
::
cout
<<
"Run instruction: "
;
this
->
debug_print
(
ins
);
return
f
();
return
f
();
});
});
}
}
...
@@ -473,8 +474,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
...
@@ -473,8 +474,8 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
<<
", "
<<
std
::
round
(
calculate_overhead_percent
)
<<
"%"
<<
std
::
endl
;
<<
", "
<<
std
::
round
(
calculate_overhead_percent
)
<<
"%"
<<
std
::
endl
;
}
}
void
program
::
debug_print
()
{
std
::
cout
<<
*
this
<<
std
::
endl
;
}
void
program
::
debug_print
()
const
{
std
::
cout
<<
*
this
<<
std
::
endl
;
}
void
program
::
debug_print
(
instruction_ref
ins
)
void
program
::
debug_print
(
instruction_ref
ins
)
const
{
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
print_program
(
ss
,
*
this
,
[
&
](
auto
x
,
auto
&&
names
)
{
print_program
(
ss
,
*
this
,
[
&
](
auto
x
,
auto
&&
names
)
{
...
@@ -485,7 +486,7 @@ void program::debug_print(instruction_ref ins)
...
@@ -485,7 +486,7 @@ void program::debug_print(instruction_ref ins)
}
}
});
});
}
}
void
program
::
debug_print
(
const
std
::
vector
<
instruction_ref
>&
inss
)
void
program
::
debug_print
(
const
std
::
vector
<
instruction_ref
>&
inss
)
const
{
{
for
(
auto
ins
:
inss
)
for
(
auto
ins
:
inss
)
debug_print
(
ins
);
debug_print
(
ins
);
...
...
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