Skip to content
Snippets Groups Projects
Commit 3758d60c authored by auphelia's avatar auphelia
Browse files

[CleanUp] Added IP Generation directories for deletion

parent afe63114
No related branches found
No related tags found
No related merge requests found
......@@ -22,11 +22,26 @@ class CleanUp(Transformation):
try:
# lookup op_type in registry of CustomOps
inst = registry.custom_op[op_type](node)
# delete code_gen_dir from npysim
code_gen_dir = inst.get_nodeattr("code_gen_dir_npysim")
if os.path.isdir(code_gen_dir):
shutil.rmtree(code_gen_dir)
inst.set_nodeattr("code_gen_dir_npysim", "")
inst.set_nodeattr("executable_path", "")
# delete code_gen_dir from ipgen and project folder
code_gen_dir = inst.get_nodeattr("code_gen_dir_ipgen")
ipgen_path = inst.get_nodeattr("ipgen_path")
if os.path.isdir(code_gen_dir):
shutil.rmtree(code_gen_dir)
if os.path.isdir(ipgen_path):
shutil.rmtree(ipgen_path)
inst.set_nodeattr("code_gen_dir_ipgen", "")
inst.set_nodeattr("ipgen_path", "")
# delete Java HotSpot Performance data log
for d_name in os.listdir("/tmp/"):
if "hsperfdata" in d_name:
shutil.rmtree("/tmp/" + str(d_name))
except KeyError:
# exception if op_type is not supported
raise Exception(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment