Skip to content

Commit 38b5685

Browse files
authored
Revert accidental edit on main.py (#2612)
1 parent becbe40 commit 38b5685

File tree

1 file changed

+25
-41
lines changed

1 file changed

+25
-41
lines changed

python/compiler/aiecc/main.py

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -554,14 +554,11 @@ async def process_core(
554554
# If there are orphaned input sections, then they'd likely end up outside of the normal program memory.
555555
clang_link_args = ["-Wl,--gc-sections", "-Wl,--orphan-handling=error"]
556556

557-
if opts.progress:
558-
task = self.progress_bar.add_task(
559-
"[yellow] Core (%d, %d)" % core[0:2],
560-
total=self.maxtasks,
561-
command="starting",
562-
)
563-
else:
564-
task = None
557+
task = self.progress_bar.add_task(
558+
"[yellow] Core (%d, %d)" % core[0:2],
559+
total=self.maxtasks,
560+
command="starting",
561+
)
565562

566563
# fmt: off
567564
corecol, corerow, elf_file = core
@@ -615,10 +612,8 @@ async def process_core(
615612
elif opts.link:
616613
await self.do_call(task, [self.peano_clang_path, "-O2", "--target=" + aie_peano_target, file_core_obj, *clang_link_args, "-Wl,-T," + file_core_ldscript, "-o", file_core_elf])
617614

618-
if opts.progress:
619-
self.progress_bar.update(self.progress_bar.task_completed, advance=1)
620-
if task:
621-
self.progress_bar.update(task, advance=0, visible=False)
615+
self.progress_bar.update(self.progress_bar.task_completed, advance=1)
616+
self.progress_bar.update(task, advance=0, visible=False)
622617
# fmt: on
623618

624619
async def process_cdo(self, module_str):
@@ -787,12 +782,9 @@ async def process_pdi_gen(self):
787782
# generate an xclbin. The inputs are self.mlir_module_str and the cdo
788783
# binaries from the process_cdo step.
789784
async def process_xclbin_gen(self):
790-
if opts.progress:
791-
task = self.progress_bar.add_task(
792-
"[yellow] XCLBIN generation ", total=10, command="starting"
793-
)
794-
else:
795-
task = None
785+
task = self.progress_bar.add_task(
786+
"[yellow] XCLBIN generation ", total=10, command="starting"
787+
)
796788

797789
# collect the tasks to generate the inputs to xclbinutil
798790
processes = []
@@ -883,12 +875,9 @@ async def process_host_cgen(self, aie_target, file_physical):
883875
if self.stopall:
884876
return
885877

886-
if opts.progress:
887-
task = self.progress_bar.add_task(
888-
"[yellow] Host compilation ", total=10, command="starting"
889-
)
890-
else:
891-
task = None
878+
task = self.progress_bar.add_task(
879+
"[yellow] Host compilation ", total=10, command="starting"
880+
)
892881

893882
if opts.airbin:
894883
file_airbin = self.prepend_tmp("air.bin")
@@ -1010,10 +999,8 @@ async def process_host_cgen(self, aie_target, file_physical):
1010999
if len(opts.host_args) > 0:
10111000
await self.do_call(task, cmd + opts.host_args)
10121001

1013-
if opts.progress:
1014-
self.progress_bar.update(self.progress_bar.task_completed, advance=1)
1015-
if task:
1016-
self.progress_bar.update(task, advance=0, visible=False)
1002+
self.progress_bar.update(self.progress_bar.task_completed, advance=1)
1003+
self.progress_bar.update(task, advance=0, visible=False)
10171004

10181005
async def gen_sim(self, task, aie_target, file_physical):
10191006
# For simulation, we need to additionally parse the 'remaining' options to avoid things
@@ -1222,14 +1209,12 @@ async def run_flow(self):
12221209
progress.TextColumn("{task.fields[command]}"),
12231210
redirect_stdout=False,
12241211
redirect_stderr=False,
1212+
disable=not opts.progress,
12251213
) as progress_bar:
12261214
self.progress_bar = progress_bar
1227-
if opts.progress:
1228-
progress_bar.task = progress_bar.add_task(
1229-
"[green] MLIR compilation:", total=1, command="1 Worker"
1230-
)
1231-
else:
1232-
progress_bar.task = None
1215+
progress_bar.task = progress_bar.add_task(
1216+
"[green] MLIR compilation:", total=1, command="1 Worker"
1217+
)
12331218

12341219
t = do_run(
12351220
[
@@ -1309,13 +1294,12 @@ async def run_flow(self):
13091294
await self.do_call(progress_bar.task, [self.peano_llc_path, file_llvmir_opt, "-O2", "--march=" + aie_target.lower(), "--function-sections", "--filetype=obj", "-o", self.unified_file_core_obj])
13101295
# fmt: on
13111296

1312-
if opts.progress:
1313-
progress_bar.update(progress_bar.task, advance=0, visible=False)
1314-
progress_bar.task_completed = progress_bar.add_task(
1315-
"[green] AIE Compilation:",
1316-
total=len(cores) + 1,
1317-
command="%d Workers" % nworkers,
1318-
)
1297+
progress_bar.update(progress_bar.task, advance=0, visible=False)
1298+
progress_bar.task_completed = progress_bar.add_task(
1299+
"[green] AIE Compilation:",
1300+
total=len(cores) + 1,
1301+
command="%d Workers" % nworkers,
1302+
)
13191303

13201304
input_physical = self.prepend_tmp("input_physical.mlir")
13211305
processes = [

0 commit comments

Comments
 (0)