bin/cpubench: support benchmarks setting
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
#=====================================================================
|
#=====================================================================
|
||||||
[common]
|
[common]
|
||||||
action = standard # options: standard, build, run, clean
|
action = standard # options: standard, build, run, clean
|
||||||
benchmarks = IntSingle,FloatSingle
|
benchmarks = @@BENCHMARKS@@
|
||||||
#IntSingle
|
#IntSingle
|
||||||
#benchmarks = x264,gcc,gzip,tpcc,tpch,velvet,openssl,rapidjson,python,xz
|
#benchmarks = x264,gcc,gzip,tpcc,tpch,velvet,openssl,rapidjson,python,xz
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const cpubenchConfig = cpubench.renderConfig({
|
|||||||
...optimizeOptions({ optimize: argv.optimize as OptimizeOptions["optimize"] })
|
...optimizeOptions({ optimize: argv.optimize as OptimizeOptions["optimize"] })
|
||||||
],
|
],
|
||||||
sysroot: argv.sysroot,
|
sysroot: argv.sysroot,
|
||||||
|
benchmarks: argv.benchmarks as cpubench.CPUBenchConfigOptions["benchmarks"],
|
||||||
});
|
});
|
||||||
|
|
||||||
const uuid = randomUUID();
|
const uuid = randomUUID();
|
||||||
@@ -70,7 +71,6 @@ const systemdArgs = [
|
|||||||
path.resolve(cpubenchDir, 'cpubench.sh'),
|
path.resolve(cpubenchDir, 'cpubench.sh'),
|
||||||
`--config=${configFile}`,
|
`--config=${configFile}`,
|
||||||
"--skip_verify=1",
|
"--skip_verify=1",
|
||||||
...argv.benchmarks.map(x => `-b=${x}`),
|
|
||||||
"--rebuild=1",
|
"--rebuild=1",
|
||||||
"-i=1"
|
"-i=1"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ export interface CPUBenchConfigOptions {
|
|||||||
llvmInstall: string;
|
llvmInstall: string;
|
||||||
optimize: string[];
|
optimize: string[];
|
||||||
sysroot: string;
|
sysroot: string;
|
||||||
|
benchmarks: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function renderConfig({ llvmInstall, optimize, sysroot }: CPUBenchConfigOptions) {
|
export function renderConfig({ llvmInstall, optimize, sysroot, benchmarks }: CPUBenchConfigOptions) {
|
||||||
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpuBenchTemplate
|
return `# Rendered from TypeScript ${new Date().toLocaleString()}, do not edit!\n` + cpuBenchTemplate
|
||||||
.replace('@@LLVM_INSTALL@@', llvmInstall)
|
.replace('@@LLVM_INSTALL@@', llvmInstall)
|
||||||
.replace('@@OPTIMIZE@@', optimize.join(' '))
|
.replace('@@OPTIMIZE@@', optimize.join(' '))
|
||||||
.replace('@@SYSROOT@@', sysroot);
|
.replace('@@SYSROOT@@', sysroot)
|
||||||
|
.replace('@@BENCHMARKS@@', benchmarks.join(','));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user