Skip to content

Commit

Permalink
fix up
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrantq committed Sep 29, 2024
1 parent 0df3b8c commit 075d9ff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions example/microbm/microbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

precisions = ["double", "float", "half"]
iterations = 1000000000
unrolled = 100
unrolled = 32

precision_to_llvm_type = {
"double": "double",
Expand Down Expand Up @@ -482,8 +482,8 @@ def compile_and_run(ll_filename, executable):
try:
elapsed_time = compile_and_run(filename, executable)
adjusted_time = elapsed_time - baseline_time
adjusted_time = max(adjusted_time, 0.0)
writer.writerow({"instruction": instr, "precision": precision, "cost": adjusted_time})
cost = int(adjusted_time)
writer.writerow({"instruction": instr, "precision": precision, "cost": cost})
print(f"Benchmarked instruction {instr} with precision {precision}: {adjusted_time:.6f} seconds")
except subprocess.CalledProcessError as e:
print(f"Error compiling or running instruction {instr} for {precision}: {e}")
Expand All @@ -501,8 +501,8 @@ def compile_and_run(ll_filename, executable):
try:
elapsed_time = compile_and_run(filename, executable)
adjusted_time = elapsed_time - baseline_time
adjusted_time = max(adjusted_time, 0.0)
writer.writerow({"instruction": func, "precision": precision, "cost": adjusted_time})
cost = int(adjusted_time)
writer.writerow({"instruction": func, "precision": precision, "cost": cost})
print(f"Benchmarked function {func} with precision {precision}: {adjusted_time:.6f} seconds")
except subprocess.CalledProcessError as e:
print(f"Error compiling or running function {func} for {precision}: {e}")
Expand Down

0 comments on commit 075d9ff

Please sign in to comment.