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
9799d373
Commit
9799d373
authored
Oct 28, 2019
by
Paul Fultz II
Committed by
mvermeulen
Oct 28, 2019
Browse files
Sort instruction in perf report by time (#398)
parent
522da00b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
src/program.cpp
src/program.cpp
+9
-3
No files found.
src/program.cpp
View file @
9799d373
...
@@ -538,10 +538,16 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
...
@@ -538,10 +538,16 @@ void program::perf_report(std::ostream& os, std::size_t n, parameter_map params)
os
<<
std
::
endl
;
os
<<
std
::
endl
;
os
<<
"Summary:"
<<
std
::
endl
;
os
<<
"Summary:"
<<
std
::
endl
;
for
(
auto
&&
p
:
op_times
)
std
::
vector
<
std
::
pair
<
double
,
std
::
string
>>
op_times_sorted
;
std
::
transform
(
op_times
.
begin
(),
op_times
.
end
(),
std
::
back_inserter
(
op_times_sorted
),
[](
auto
p
)
{
return
std
::
make_pair
(
p
.
second
,
p
.
first
);
});
std
::
sort
(
op_times_sorted
.
begin
(),
op_times_sorted
.
end
(),
std
::
greater
<>
{});
for
(
auto
&&
p
:
op_times_sorted
)
{
{
auto
&&
name
=
p
.
first
;
auto
&&
name
=
p
.
second
;
double
avg
=
p
.
second
;
double
avg
=
p
.
first
;
double
percent
=
std
::
ceil
(
100.0
*
avg
/
total_instruction_time
);
double
percent
=
std
::
ceil
(
100.0
*
avg
/
total_instruction_time
);
os
<<
name
<<
": "
<<
avg
<<
"ms, "
<<
percent
<<
"%"
<<
std
::
endl
;
os
<<
name
<<
": "
<<
avg
<<
"ms, "
<<
percent
<<
"%"
<<
std
::
endl
;
}
}
...
...
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