diff --git a/example/microbm/microbm.py b/example/microbm/microbm.py index 27d59ff..9c540d7 100644 --- a/example/microbm/microbm.py +++ b/example/microbm/microbm.py @@ -13,7 +13,7 @@ precisions = ["double", "float", "half"] iterations = 1000000000 -unrolled = 100 +unrolled = 32 precision_to_llvm_type = { "double": "double", @@ -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}") @@ -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}")