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
d68d3b7e
Commit
d68d3b7e
authored
Feb 18, 2022
by
Shucai Xiao
Browse files
clang format
parent
f5681052
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
src/include/migraphx/program.hpp
src/include/migraphx/program.hpp
+2
-1
src/program.cpp
src/program.cpp
+9
-7
No files found.
src/include/migraphx/program.hpp
View file @
d68d3b7e
...
@@ -77,7 +77,8 @@ struct program
...
@@ -77,7 +77,8 @@ struct program
void
debug_print
()
const
;
void
debug_print
()
const
;
void
debug_print
(
instruction_ref
ins
)
const
;
void
debug_print
(
instruction_ref
ins
)
const
;
void
debug_print
(
instruction_ref
ins
,
const
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
)
const
;
void
debug_print
(
instruction_ref
ins
,
const
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
)
const
;
void
print
(
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
,
void
print
(
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
,
const
std
::
function
<
void
(
instruction_ref
,
const
std
::
function
<
void
(
instruction_ref
,
std
::
unordered_map
<
instruction_ref
,
std
::
string
>
)
>&
std
::
unordered_map
<
instruction_ref
,
std
::
string
>
)
>&
...
...
src/program.cpp
View file @
d68d3b7e
...
@@ -548,7 +548,7 @@ std::vector<argument> program::eval(parameter_map params) const
...
@@ -548,7 +548,7 @@ std::vector<argument> program::eval(parameter_map params) const
if
(
trace_level
>
0
)
if
(
trace_level
>
0
)
{
{
std
::
unordered_map
<
instruction_ref
,
std
::
string
>
ins_names
;
std
::
unordered_map
<
instruction_ref
,
std
::
string
>
ins_names
;
this
->
print
(
ins_names
,
[
&
](
auto
,
auto
)
{
});
this
->
print
(
ins_names
,
[
&
](
auto
,
auto
)
{});
return
generic_eval
(
*
this
,
return
generic_eval
(
*
this
,
ctx
,
ctx
,
std
::
move
(
params
),
std
::
move
(
params
),
...
@@ -561,8 +561,9 @@ std::vector<argument> program::eval(parameter_map params) const
...
@@ -561,8 +561,9 @@ std::vector<argument> program::eval(parameter_map params) const
double
t1
=
t
.
record
<
milliseconds
>
();
double
t1
=
t
.
record
<
milliseconds
>
();
ctx
.
finish
();
ctx
.
finish
();
double
t2
=
t
.
record
<
milliseconds
>
();
double
t2
=
t
.
record
<
milliseconds
>
();
std
::
cout
<<
"Time: "
<<
t1
<<
"ms, "
<<
t2
<<
"ms, execution time:
\t
"
;
std
::
cout
<<
"Time: "
<<
t1
<<
"ms, "
<<
t2
if
(
trace_level
==
2
and
ins
->
name
().
front
()
!=
'@'
and
<<
"ms, execution time:
\t
"
;
if
(
trace_level
==
2
and
ins
->
name
().
front
()
!=
'@'
and
ins
->
name
()
!=
"load"
and
not
result
.
empty
())
ins
->
name
()
!=
"load"
and
not
result
.
empty
())
{
{
target
tgt
=
make_target
(
this
->
impl
->
target_name
);
target
tgt
=
make_target
(
this
->
impl
->
target_name
);
...
@@ -581,7 +582,7 @@ std::vector<argument> program::eval(parameter_map params) const
...
@@ -581,7 +582,7 @@ std::vector<argument> program::eval(parameter_map params) const
std
::
cout
<<
"Output: "
<<
buffer
<<
std
::
endl
;
std
::
cout
<<
"Output: "
<<
buffer
<<
std
::
endl
;
}
}
}
}
else
if
(
trace_level
==
3
)
else
if
(
trace_level
==
3
)
{
{
// count max instruction length
// count max instruction length
auto
titles
=
get_titles
();
auto
titles
=
get_titles
();
...
@@ -943,7 +944,8 @@ void program::debug_print(instruction_ref ins) const
...
@@ -943,7 +944,8 @@ void program::debug_print(instruction_ref ins) const
});
});
}
}
void
program
::
debug_print
(
instruction_ref
ins
,
const
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
)
const
void
program
::
debug_print
(
instruction_ref
ins
,
const
std
::
unordered_map
<
instruction_ref
,
std
::
string
>&
names
)
const
{
{
if
(
std
::
any_of
(
this
->
impl
->
modules
.
begin
(),
this
->
impl
->
modules
.
end
(),
[
&
](
const
auto
&
pp
)
{
if
(
std
::
any_of
(
this
->
impl
->
modules
.
begin
(),
this
->
impl
->
modules
.
end
(),
[
&
](
const
auto
&
pp
)
{
return
is_end
(
pp
.
second
.
end
(),
ins
);
return
is_end
(
pp
.
second
.
end
(),
ins
);
...
@@ -960,7 +962,7 @@ void program::debug_print(instruction_ref ins, const std::unordered_map<instruct
...
@@ -960,7 +962,7 @@ void program::debug_print(instruction_ref ins, const std::unordered_map<instruct
return
;
return
;
}
}
if
(
contains
(
names
,
ins
))
if
(
contains
(
names
,
ins
))
{
{
instruction
::
print
(
std
::
cout
,
ins
,
names
);
instruction
::
print
(
std
::
cout
,
ins
,
names
);
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
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