@@ -40,7 +40,7 @@ def compile_legality(cls, schedule: Schedule, with_ast: bool = False):
4040
4141 output_path = os .path .join (
4242 BaseConfig .base_config .workspace ,
43- f"{ schedule .tiramisu_program .name } _legality" ,
43+ f"{ schedule .tiramisu_program .temp_files_identifier } _legality" ,
4444 )
4545
4646 cpp_code = cls .get_legality_code (schedule = schedule , with_ast = with_ast )
@@ -129,7 +129,7 @@ def compile_annotations(cls, tiramisu_program: TiramisuProgram):
129129
130130 output_path = os .path .join (
131131 BaseConfig .base_config .workspace ,
132- f"{ tiramisu_program .name } _annotations" ,
132+ f"{ tiramisu_program .temp_files_identifier } _annotations" ,
133133 )
134134 # Add code to the original file to get json annotations
135135
@@ -167,7 +167,7 @@ def compile_isl_ast_tree(
167167
168168 output_path = os .path .join (
169169 BaseConfig .base_config .workspace ,
170- f"{ tiramisu_program .name } _isl_ast" ,
170+ f"{ tiramisu_program .temp_files_identifier } _isl_ast" ,
171171 )
172172 get_isl_ast_lines = ""
173173 if schedule :
@@ -323,7 +323,7 @@ def call_skewing_solver(
323323 logger .debug ("Skewing Solver Code:\n " + solver_code )
324324 output_path = os .path .join (
325325 BaseConfig .base_config .workspace ,
326- f"{ schedule .tiramisu_program .name } _skewing_solver" ,
326+ f"{ schedule .tiramisu_program .temp_files_identifier } _skewing_solver" ,
327327 )
328328
329329 result_str = cls .run_cpp_code (cpp_code = solver_code , output_path = output_path )
@@ -443,7 +443,7 @@ def get_cpu_exec_times( # noqa: C901
443443 cpp_code = cls .get_schedule_code (tiramisu_program , optims_list )
444444 # Write the code to a file
445445 output_path = os .path .join (
446- BaseConfig .base_config .workspace , tiramisu_program .name
446+ BaseConfig .base_config .workspace , tiramisu_program .temp_files_identifier
447447 )
448448
449449 cls .write_to_disk (cpp_code , output_path + "_schedule" )
@@ -473,17 +473,17 @@ def get_cpu_exec_times( # noqa: C901
473473 shell_script = [
474474 # Compile intermidiate tiramisu file
475475 f"cd { BaseConfig .base_config .workspace } " ,
476- f"$CXX -Wl,--no-as-needed -ldl -g -fno-rtti -lpthread -fopenmp -std=c++17 -O0 -o { tiramisu_program .name } .o -c { tiramisu_program .name } _schedule.cpp" ,
476+ f"$CXX -Wl,--no-as-needed -ldl -g -fno-rtti -lpthread -fopenmp -std=c++17 -O0 -o { tiramisu_program .temp_files_identifier } .o -c { tiramisu_program .temp_files_identifier } _schedule.cpp" ,
477477 # Link generated file with executer
478- f"$CXX -Wl,--no-as-needed -ldl -g -fno-rtti -lpthread -fopenmp -std=c++17 -O0 { tiramisu_program .name } .o -o { tiramisu_program .name } .out -ltiramisu -ltiramisu_auto_scheduler -lHalide -lisl" ,
478+ f"$CXX -Wl,--no-as-needed -ldl -g -fno-rtti -lpthread -fopenmp -std=c++17 -O0 { tiramisu_program .temp_files_identifier } .o -o { tiramisu_program .temp_files_identifier } .out -ltiramisu -ltiramisu_auto_scheduler -lHalide -lisl" ,
479479 # Run the program
480- f"./{ tiramisu_program .name } .out" ,
481- f"$CXX -shared -o { tiramisu_program .name } .so { tiramisu_program .name } .o" , # noqa: E501
480+ f"./{ tiramisu_program .temp_files_identifier } .out" ,
481+ f"$CXX -shared -o { tiramisu_program .temp_files_identifier } .so { tiramisu_program .temp_files_identifier } .o" , # noqa: E501
482482 ]
483483 if not tiramisu_program .wrapper_obj :
484484 shell_script += [
485485 # compile the wrapper
486- f"$CXX -std=c++17 -fno-rtti -o { tiramisu_program .name } _wrapper -ltiramisu -lHalide -ldl -lpthread -fopenmp -lm { tiramisu_program .name } _wrapper.cpp ./{ tiramisu_program .name } .so -ltiramisu -lHalide -ldl -lpthread -fopenmp -lm -lisl"
486+ f"$CXX -std=c++17 -fno-rtti -o { tiramisu_program .temp_files_identifier } _wrapper -ltiramisu -lHalide -ldl -lpthread -fopenmp -lm { tiramisu_program .temp_files_identifier } _wrapper.cpp ./{ tiramisu_program .temp_files_identifier } .so -ltiramisu -lHalide -ldl -lpthread -fopenmp -lm -lisl"
487487 ]
488488 try :
489489 # run the compilation of the generator and wrapper
@@ -558,11 +558,6 @@ def get_cpu_exec_times( # noqa: C901
558558 check = False ,
559559 )
560560
561- if delete_files :
562- CompilingService .delete_temporary_files (
563- tiramisu_program = tiramisu_program
564- )
565-
566561 # if the command has to quit properly, that is either on timeout or (noraml completion and non-empty stdout)
567562 if not (
568563 compiler .returncode == 124
@@ -589,7 +584,10 @@ def get_cpu_exec_times( # noqa: C901
589584 f"Execution of wrapper timed-out. Completed { len (results )} out of { min_runs } min_runs and { len (compiler .stdout .split ())} out of { nb_exec_left } extra runs. Collected measurements are [{ ' ' .join (list (map (str , results )))} ]+[{ compiler .stdout } ]."
590585 )
591586 results += [float (x ) for x in compiler .stdout .split ()]
592-
587+ if delete_files :
588+ CompilingService .delete_temporary_files (
589+ tiramisu_program = tiramisu_program
590+ )
593591 return results
594592
595593 except subprocess .CalledProcessError as e :
@@ -619,9 +617,9 @@ def get_n_runs_script(
619617 # set the env variables
620618 f"export NB_EXEC={ nb_exec } " ,
621619 # run the wrapper
622- f"./{ tiramisu_program .name } _wrapper"
620+ f"./{ tiramisu_program .temp_files_identifier } _wrapper"
623621 if timeout is None
624- else f"timeout { timeout / 1000 } ./{ tiramisu_program .name } _wrapper" ,
622+ else f"timeout { timeout / 1000 } ./{ tiramisu_program .temp_files_identifier } _wrapper" ,
625623 ]
626624
627625 @classmethod
@@ -630,7 +628,7 @@ def delete_temporary_files(cls, tiramisu_program: TiramisuProgram):
630628 subprocess .run (
631629 [
632630 # cd to the workspace and clean generated files
633- f"cd { BaseConfig .base_config .workspace } && rm { tiramisu_program .name } *"
631+ f"cd { BaseConfig .base_config .workspace } && rm { tiramisu_program .temp_files_identifier } *"
634632 ],
635633 capture_output = True ,
636634 text = True ,
0 commit comments