cpubench: allow extra optimization flags
This commit is contained in:
@@ -20,6 +20,7 @@ export interface RunCPUBenchOptions {
|
|||||||
platform: sunway.SunwayGeneration | "host";
|
platform: sunway.SunwayGeneration | "host";
|
||||||
allowMisaligned?: boolean;
|
allowMisaligned?: boolean;
|
||||||
action?: string;
|
action?: string;
|
||||||
|
extraOptimize?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +28,7 @@ export interface RunCPUBenchOptions {
|
|||||||
* @param options 运行CPUBench所需的配置选项(可选)
|
* @param options 运行CPUBench所需的配置选项(可选)
|
||||||
*/
|
*/
|
||||||
export async function runCPUBench(options: RunCPUBenchOptions): Promise<void> {
|
export async function runCPUBench(options: RunCPUBenchOptions): Promise<void> {
|
||||||
|
console.log(`Running CPUBench with options: ${JSON.stringify(options)}`);
|
||||||
const defaults: Partial<RunCPUBenchOptions> = {
|
const defaults: Partial<RunCPUBenchOptions> = {
|
||||||
uuid: true,
|
uuid: true,
|
||||||
platform: 'host',
|
platform: 'host',
|
||||||
@@ -55,7 +57,11 @@ export async function runCPUBench(options: RunCPUBenchOptions): Promise<void> {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
const optimizeFlags = optimizeProfiles[config.optimizeProfile];
|
let optimizeFlags = optimizeProfiles[config.optimizeProfile];
|
||||||
|
|
||||||
|
if (options.extraOptimize) {
|
||||||
|
optimizeFlags.push(...options.extraOptimize);
|
||||||
|
}
|
||||||
|
|
||||||
const sunwayGeneration = config.platform === "host"
|
const sunwayGeneration = config.platform === "host"
|
||||||
? sunway.getHostGeneration()
|
? sunway.getHostGeneration()
|
||||||
|
|||||||
Reference in New Issue
Block a user