Skip to content

Commit

Permalink
#287: Hotfix for seg fault when executing dir of flatbuffers
Browse files Browse the repository at this point in the history
  • Loading branch information
tapspatel committed Aug 2, 2024
1 parent dcb4b51 commit 16b592e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions runtime/tools/python/ttrt/common/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def read(args):
arg_binary = args.binary
arg_clean_artifacts = args.clean_artifacts
arg_save_artifacts = args.save_artifacts
arg_section = arg.section
arg_section = args.section

# preprocessing
if os.path.isdir(arg_binary):
Expand Down Expand Up @@ -182,11 +182,13 @@ def run(args):

system_desc, device_ids = ttrt.runtime.get_current_system_desc()
device = ttrt.runtime.open_device(device_ids)
atexit.register(lambda: ttrt.runtime.close_device(device))
#atexit.register(lambda: ttrt.runtime.close_device(device))
for loop in range(arg_loops):
ttrt.runtime.submit(device, fbb, 0, total_inputs[loop], total_outputs[loop])
print(f"finished loop={loop}")
print("outputs:\n", torch_outputs)
ttrt.runtime.close_device(device)


# save artifacts
if arg_save_artifacts:
Expand Down

0 comments on commit 16b592e

Please sign in to comment.