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
d0fec7fd
Commit
d0fec7fd
authored
May 13, 2022
by
umangyadav
Browse files
fix tidy cppcheck
parent
2d27b694
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
src/include/migraphx/tracer.hpp
src/include/migraphx/tracer.hpp
+14
-14
src/pass_manager.cpp
src/pass_manager.cpp
+3
-3
No files found.
src/include/migraphx/tracer.hpp
View file @
d0fec7fd
...
@@ -29,18 +29,20 @@ struct tracer
...
@@ -29,18 +29,20 @@ struct tracer
// file_stream
// file_stream
bool
fs_enabled
()
const
{
return
!
dump_dir
.
empty
()
&&
!
os_enabled
();
}
bool
fs_enabled
()
const
{
return
!
dump_dir
.
empty
()
&&
!
os_enabled
();
}
// output_stream
// output_stream
bool
os_enabled
()
const
{
return
os
&&
!
fs_enabled
();
}
bool
os_enabled
()
const
{
return
(
os
!=
nullptr
)
&&
!
fs_enabled
();}
bool
enabled
()
const
{
return
fs_enabled
()
or
os_enabled
();
};
bool
enabled
()
const
{
return
fs_enabled
()
or
os_enabled
();};
/*
/*
Dump any string to ostream, used for debug build or debugging purposes.
Dump any string to ostream, used for debug build or debugging purposes.
*/
*/
void
operator
()(
const
std
::
string
&
s
=
""
)
const
{
std
::
cout
<<
s
<<
std
::
endl
;
}
void
operator
()(
const
std
::
string
&
s
=
""
)
const
{
std
::
cout
<<
s
<<
std
::
endl
;
}
/*
/*
Based on user's envrionment flags, either dump IR passes' output to a file or ostream i.e. cout
Based on user's envrionment flags, either dump IR passes' output to a file or ostream i.e. cout
or cerr,
or cerr,
:param pass_file_name : file_name to be used when dumping IR pass to a file, this param
:param pass_file_name : file_name to be used when dumping IR pass to a file, this param
is not used when IR is
is not used when IR is
dumped to ostream.
dumped to ostream.
*/
*/
template
<
class
...
Ts
,
MIGRAPHX_REQUIRES
((
sizeof
...(
Ts
)
>
0
))
>
template
<
class
...
Ts
,
MIGRAPHX_REQUIRES
((
sizeof
...(
Ts
)
>
0
))
>
void
operator
()(
const
std
::
string
&
pass_file_name
,
const
Ts
&
...
xs
)
void
operator
()(
const
std
::
string
&
pass_file_name
,
const
Ts
&
...
xs
)
...
@@ -53,9 +55,7 @@ struct tracer
...
@@ -53,9 +55,7 @@ struct tracer
swallow
{
ofs
<<
xs
...};
swallow
{
ofs
<<
xs
...};
ofs
<<
std
::
endl
;
ofs
<<
std
::
endl
;
ofs
.
close
();
ofs
.
close
();
}
}
else
if
(
os_enabled
())
{
else
if
(
os_enabled
())
{
swallow
{
*
os
<<
xs
...};
swallow
{
*
os
<<
xs
...};
*
os
<<
std
::
endl
;
*
os
<<
std
::
endl
;
}
}
...
...
src/pass_manager.cpp
View file @
d0fec7fd
...
@@ -18,7 +18,7 @@ inline namespace MIGRAPHX_INLINE_NS {
...
@@ -18,7 +18,7 @@ inline namespace MIGRAPHX_INLINE_NS {
MIGRAPHX_DECLARE_ENV_VAR
(
MIGRAPHX_TRACE_PASSES
);
MIGRAPHX_DECLARE_ENV_VAR
(
MIGRAPHX_TRACE_PASSES
);
void
validate_pass
(
module
&
mod
,
const
pass
&
p
,
tracer
trace
)
void
validate_pass
(
module
&
mod
,
const
pass
&
p
,
const
tracer
&
trace
)
{
{
(
void
)
mod
;
(
void
)
mod
;
(
void
)
p
;
(
void
)
p
;
...
@@ -129,8 +129,8 @@ void run_passes(program& prog, const std::vector<pass>& passes, tracer trace)
...
@@ -129,8 +129,8 @@ void run_passes(program& prog, const std::vector<pass>& passes, tracer trace)
// the individual passes' file dumps.
// the individual passes' file dumps.
if
(
module_tracer_map
.
find
(
mod
->
name
())
==
module_tracer_map
.
end
())
if
(
module_tracer_map
.
find
(
mod
->
name
())
==
module_tracer_map
.
end
())
{
{
// cppcheck-suppress stlFindInsert
module_tracer_map
[
mod
->
name
()]
=
module_tracer_map
[
mod
->
name
()]
=
// cppcheck-suppress stlFindInsert
trace
.
fs_enabled
()
?
tracer
{
trace
.
dump_dir
+
"/"
+
mod
->
name
()}
:
trace
;
trace
.
fs_enabled
()
?
tracer
{
trace
.
dump_dir
+
"/"
+
mod
->
name
()}
:
trace
;
}
}
if
(
mod
->
bypass
())
if
(
mod
->
bypass
())
...
...
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