tools/x264_perf_O3: support to disable loop vectorize optimization for get_ref

This commit is contained in:
2025-04-27 17:34:01 +08:00
parent 4c0c722616
commit d91125723e
3 changed files with 43 additions and 5 deletions

View File

@@ -1,19 +1,38 @@
from pathlib import Path
from subprocess import run
from speccpu import get_benchspec_dir, x264
import click
from speccpu import create_spec_env, get_benchspec_dir, x264
from speccpu.flaglib.perf import record as recordflags
def main():
@click.command()
@click.option(
"--disable-get-ref-vectorize",
type=bool,
default=False,
help="Enable or disable MC vectorization",
)
@click.option(
"--spec",
type=Path,
help="Path to SPEC CPU directory",
)
def main(disable_get_ref_vectorize: bool, spec: Path):
x264_run_id = "c56635a4-9f49-4d2b-be79-38d9e08097c5"
x264_outputroot = Path("/home/lyc/work-ts/local/specOutput") / x264_run_id
x264_dir = get_benchspec_dir(x264_outputroot) / "625.x264_s"
x264_run = x264_dir / "run" / "run_base_refspeed_mytest-m64.0000"
x264_exe = x264_run / "x264_s_base.mytest-m64"
if disable_get_ref_vectorize:
mc_src = x264.MCBuilder().with_disabled_vectorize_get_ref().build()
x264_exe = x264.recompile_mc_src(
mc_src, x264_dir / "build", create_spec_env(spec)
)
run(
[
@@ -21,7 +40,7 @@ def main():
"record",
*recordflags(
[
str(x264_run / "x264_s_base.mytest-m64"),
str(x264_exe),
*x264.specinvoke_args["ref"],
],
output=str(Path.cwd() / f"x264-{x264_run_id}perf"),
@@ -31,5 +50,6 @@ def main():
cwd=x264_run,
)
if __name__ == "__main__":
main()