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
779e6525
Commit
779e6525
authored
Jan 30, 2022
by
Shucai Xiao
Browse files
clang format
parent
51452c03
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
src/program.cpp
src/program.cpp
+21
-20
No files found.
src/program.cpp
View file @
779e6525
...
@@ -548,7 +548,8 @@ auto get_flops_funcs()
...
@@ -548,7 +548,8 @@ auto get_flops_funcs()
auto
sb
=
vec_ss
.
at
(
1
);
auto
sb
=
vec_ss
.
at
(
1
);
auto
batch
=
1
;
auto
batch
=
1
;
auto
lens_a
=
sa
.
lens
();
auto
lens_a
=
sa
.
lens
();
batch
=
std
::
accumulate
(
lens_a
.
rbegin
()
+
2
,
lens_a
.
rend
(),
1
,
std
::
multiplies
<
std
::
size_t
>
{});
batch
=
std
::
accumulate
(
lens_a
.
rbegin
()
+
2
,
lens_a
.
rend
(),
1
,
std
::
multiplies
<
std
::
size_t
>
{});
auto
m
=
lens_a
[
lens_a
.
size
()
-
2
];
auto
m
=
lens_a
[
lens_a
.
size
()
-
2
];
auto
k
=
lens_a
.
back
();
auto
k
=
lens_a
.
back
();
auto
lens_b
=
sb
.
lens
();
auto
lens_b
=
sb
.
lens
();
...
@@ -632,7 +633,7 @@ void program::perf_report(std::ostream& os,
...
@@ -632,7 +633,7 @@ void program::perf_report(std::ostream& os,
this
->
print
(
names
,
[
&
](
auto
ins
,
auto
ins_names
)
{
this
->
print
(
names
,
[
&
](
auto
ins
,
auto
ins_names
)
{
std
::
stringstream
ss
;
std
::
stringstream
ss
;
instruction
::
print
(
ss
,
ins
,
ins_names
);
instruction
::
print
(
ss
,
ins
,
ins_names
);
if
(
max_ins_len
<
ss
.
str
().
length
())
if
(
max_ins_len
<
ss
.
str
().
length
())
{
{
max_ins_len
=
ss
.
str
().
length
();
max_ins_len
=
ss
.
str
().
length
();
}
}
...
@@ -669,7 +670,7 @@ void program::perf_report(std::ostream& os,
...
@@ -669,7 +670,7 @@ void program::perf_report(std::ostream& os,
double
percent
=
100.0
*
avg
/
total_instruction_time
;
double
percent
=
100.0
*
avg
/
total_instruction_time
;
std
::
string
pers
=
std
::
to_string
(
percent
);
std
::
string
pers
=
std
::
to_string
(
percent
);
auto
loc
=
pers
.
find
(
'.'
);
auto
loc
=
pers
.
find
(
'.'
);
if
(
loc
!=
std
::
string
::
npos
)
if
(
loc
!=
std
::
string
::
npos
)
{
{
pers
.
erase
(
pers
.
begin
()
+
loc
+
6
,
pers
.
end
());
pers
.
erase
(
pers
.
begin
()
+
loc
+
6
,
pers
.
end
());
}
}
...
@@ -680,7 +681,7 @@ void program::perf_report(std::ostream& os,
...
@@ -680,7 +681,7 @@ void program::perf_report(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
);
if
(
contains
(
flops_funcs
,
op_name
))
if
(
contains
(
flops_funcs
,
op_name
))
{
{
auto
op_flop_func
=
flops_funcs
.
at
(
op_name
);
auto
op_flop_func
=
flops_funcs
.
at
(
op_name
);
auto
inss
=
to_shapes
(
ins
->
inputs
());
auto
inss
=
to_shapes
(
ins
->
inputs
());
...
@@ -690,7 +691,7 @@ void program::perf_report(std::ostream& os,
...
@@ -690,7 +691,7 @@ void program::perf_report(std::ostream& os,
flops
/=
1.0e6
;
flops
/=
1.0e6
;
flps
=
std
::
to_string
(
flops
);
flps
=
std
::
to_string
(
flops
);
auto
floc
=
flps
.
find
(
'.'
);
auto
floc
=
flps
.
find
(
'.'
);
if
(
floc
!=
std
::
string
::
npos
)
if
(
floc
!=
std
::
string
::
npos
)
{
{
flps
.
erase
(
flps
.
begin
()
+
floc
+
4
,
flps
.
end
());
flps
.
erase
(
flps
.
begin
()
+
floc
+
4
,
flps
.
end
());
}
}
...
...
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