commands: create a dedicated commands directory
This commit is contained in:
38
commands/spec.ts
Normal file
38
commands/spec.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { optFlag, undefList } from "./common"
|
||||
|
||||
interface SPECOptions {
|
||||
/**
|
||||
* Config file, used for compiling flags, compiler versions, etc.
|
||||
*/
|
||||
config?: string
|
||||
|
||||
/**
|
||||
* SPEC workload scale for each benchmark
|
||||
*/
|
||||
workload?: "test" | "train" | "ref"
|
||||
|
||||
/**
|
||||
* Selected benchmarks
|
||||
*/
|
||||
benchmarks?: string[]
|
||||
|
||||
buildType?: "nobuild" | "rebuild" | "plain",
|
||||
}
|
||||
|
||||
export function runcpuOptions(o: SPECOptions): string[] {
|
||||
return [
|
||||
...optFlag("-c", o.config),
|
||||
...optFlag("-i", o.workload),
|
||||
...undefList(o.buildType, opt => {
|
||||
switch (opt) {
|
||||
case "nobuild":
|
||||
return ["--nobuild"]
|
||||
case "rebuild":
|
||||
return ["--rebuild"]
|
||||
case "plain":
|
||||
return []
|
||||
}
|
||||
}),
|
||||
...undefList(o.benchmarks, bench => bench)
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user