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
8d6f2370
Commit
8d6f2370
authored
Feb 18, 2022
by
Shucai Xiao
Browse files
clang format
parent
7f915595
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/program.cpp
src/program.cpp
+9
-8
No files found.
src/program.cpp
View file @
8d6f2370
...
@@ -727,7 +727,7 @@ static void print_ins_perf(std::ostream& os,
...
@@ -727,7 +727,7 @@ static void print_ins_perf(std::ostream& os,
std
::
string
op_name
=
ins
->
name
();
std
::
string
op_name
=
ins
->
name
();
auto
nloc
=
op_name
.
find
(
"::"
);
auto
nloc
=
op_name
.
find
(
"::"
);
op_name
.
erase
(
op_name
.
begin
(),
op_name
.
begin
()
+
nloc
+
2
);
op_name
.
erase
(
op_name
.
begin
(),
op_name
.
begin
()
+
nloc
+
2
);
auto
inss
=
to_shapes
(
ins
->
inputs
());
auto
inss
=
to_shapes
(
ins
->
inputs
());
if
(
contains
(
flops_funcs
,
op_name
))
if
(
contains
(
flops_funcs
,
op_name
))
{
{
// print size
// print size
...
@@ -749,7 +749,7 @@ static void print_ins_perf(std::ostream& os,
...
@@ -749,7 +749,7 @@ static void print_ins_perf(std::ostream& os,
szs
.
append
(
std
::
to_string
(
mn
));
szs
.
append
(
std
::
to_string
(
mn
));
szs
.
append
(
"}"
);
szs
.
append
(
"}"
);
szs
.
append
(
size_str
.
length
()
-
szs
.
length
(),
' '
);
szs
.
append
(
size_str
.
length
()
-
szs
.
length
(),
' '
);
auto
op_flop_func
=
flops_funcs
.
at
(
op_name
);
auto
op_flop_func
=
flops_funcs
.
at
(
op_name
);
double
flops
=
op_flop_func
(
inss
);
double
flops
=
op_flop_func
(
inss
);
flops
/=
t
;
flops
/=
t
;
...
@@ -768,16 +768,17 @@ static void print_ins_perf(std::ostream& os,
...
@@ -768,16 +768,17 @@ static void print_ins_perf(std::ostream& os,
// print throughput for pointwise instruction
// print throughput for pointwise instruction
auto
alias_num
=
ins
->
get_operator
().
output_alias
({});
auto
alias_num
=
ins
->
get_operator
().
output_alias
({});
std
::
string
thrpt
;
std
::
string
thrpt
;
if
(
alias_num
!=
0
)
if
(
alias_num
!=
0
)
{
{
auto
size
=
std
::
accumulate
(
inss
.
begin
(),
inss
.
end
(),
std
::
size_t
{
0
},
[
&
](
auto
init
,
auto
s
)
{
auto
size
=
return
init
+
s
.
bytes
();
std
::
accumulate
(
inss
.
begin
(),
inss
.
end
(),
std
::
size_t
{
0
},
[
&
](
auto
init
,
auto
s
)
{
});
return
init
+
s
.
bytes
();
});
double
throughput
=
size
/
t
;
double
throughput
=
size
/
t
;
// convert to GB/s
// convert to GB/s
throughput
/=
1.0e9
;
throughput
/=
1.0e9
;
thrpt
=
std
::
to_string
(
throughput
);
thrpt
=
std
::
to_string
(
throughput
);
auto
floc
=
flps
.
find
(
'.'
);
auto
floc
=
flps
.
find
(
'.'
);
if
(
floc
!=
std
::
string
::
npos
)
if
(
floc
!=
std
::
string
::
npos
)
{
{
...
...
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