speccpu: add SPEC class
This commit is contained in:
@@ -84,3 +84,36 @@ def find_build(build_dir: Path) -> Path:
|
||||
if entry.startswith("build"):
|
||||
return build_dir / entry
|
||||
raise RuntimeError(f"SPEC build directory not found at {build_dir}")
|
||||
|
||||
|
||||
class SPEC:
|
||||
dir: Path
|
||||
|
||||
def __init__(self, dir: Path):
|
||||
self.dir = dir
|
||||
|
||||
@property
|
||||
def config_dir(self) -> Path:
|
||||
return self.dir / "config"
|
||||
|
||||
def env(self):
|
||||
return create_spec_env(self.dir)
|
||||
|
||||
def mkcmd_runcpu(
|
||||
self,
|
||||
config: str,
|
||||
benchmarks: list[str],
|
||||
setprocgroup: bool = True,
|
||||
workload: str = "ref",
|
||||
output_root: Path | None = None,
|
||||
):
|
||||
return [
|
||||
"runcpu",
|
||||
*(["--setprocgroup"] if setprocgroup else []),
|
||||
"-i",
|
||||
workload,
|
||||
"-c",
|
||||
config,
|
||||
*(["--outputdir", str(output_root)] if output_root else []),
|
||||
*benchmarks,
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user