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
f6fc4eb9
Commit
f6fc4eb9
authored
Apr 13, 2022
by
umangyadav
Browse files
remove directory after each use
parent
f47a39ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/include/migraphx/tracer.hpp
src/include/migraphx/tracer.hpp
+8
-7
No files found.
src/include/migraphx/tracer.hpp
View file @
f6fc4eb9
...
@@ -12,7 +12,12 @@ struct tracer
...
@@ -12,7 +12,12 @@ struct tracer
{
{
tracer
()
{}
tracer
()
{}
tracer
(
std
::
string
dump_directory
)
:
dump_dir
(
std
::
move
(
dump_directory
)),
counter
(
0
)
{}
tracer
(
const
std
::
string
&
dump_directory
)
:
dump_dir
(
dump_directory
),
counter
(
0
),
dir_path
(
fs
::
current_path
()
/
dump_directory
)
{
if
(
fs
::
exists
(
dir_path
))
{
fs
::
remove_all
(
dir_path
);
}
fs
::
create_directories
(
dir_path
);
}
bool
enabled
()
const
{
return
!
dump_dir
.
empty
();
}
bool
enabled
()
const
{
return
!
dump_dir
.
empty
();
}
...
@@ -21,13 +26,8 @@ struct tracer
...
@@ -21,13 +26,8 @@ struct tracer
{
{
if
(
this
->
enabled
())
if
(
this
->
enabled
())
{
{
fs
::
path
dir_path
=
fs
::
current_path
()
/
this
->
dump_dir
;
if
(
not
fs
::
exists
(
dir_path
))
{
fs
::
create_directories
(
dir_path
);
}
fs
::
path
ir_file_path
=
fs
::
path
ir_file_path
=
dir_path
/
(
std
::
to_string
(
this
->
counter
++
)
+
"_"
+
program_name
+
".mxr"
);
this
->
dir_path
/
(
std
::
to_string
(
this
->
counter
++
)
+
"_"
+
program_name
+
".mxr"
);
std
::
ofstream
ofs
(
ir_file_path
);
std
::
ofstream
ofs
(
ir_file_path
);
swallow
{
ofs
<<
xs
...};
swallow
{
ofs
<<
xs
...};
ofs
<<
std
::
endl
;
ofs
<<
std
::
endl
;
...
@@ -38,6 +38,7 @@ struct tracer
...
@@ -38,6 +38,7 @@ struct tracer
private:
private:
uint
counter
;
uint
counter
;
fs
::
path
dir_path
;
};
};
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
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