feat: add AVX2 support detection for x64 Linux systems (#167)
This commit is contained in:
parent
0ff83bfc51
commit
4c32875876
4
dist/cache-save/index.js
generated
vendored
4
dist/cache-save/index.js
generated
vendored
File diff suppressed because one or more lines are too long
70
dist/setup/index.js
generated
vendored
70
dist/setup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
12
src/utils.ts
12
src/utils.ts
@ -98,6 +98,18 @@ export function getAvx2(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check AVX2 support on x64 Linux
|
||||||
|
if (os === "linux" && arch === "x64" && avx2 === undefined) {
|
||||||
|
try {
|
||||||
|
const cpuInfo = readFileSync("/proc/cpuinfo", "utf8");
|
||||||
|
const hasAvx2 = cpuInfo.includes("avx2");
|
||||||
|
return hasAvx2;
|
||||||
|
} catch (error) {
|
||||||
|
warning(`Failed to detect AVX2 support.`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return avx2 ?? true;
|
return avx2 ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user