Files
Efim Beshmenev aea6e330e3 Realisation v1
2026-08-11 22:19:34 +03:00

16 lines
515 B
PowerShell

$ErrorActionPreference = 'Stop'
Add-Type -TypeDefinition @'
using System.Runtime.InteropServices;
public static class ProcessorFeatures {
[DllImport("kernel32.dll")]
public static extern bool IsProcessorFeaturePresent(uint feature);
}
'@
# PF_AVX2_INSTRUCTIONS_AVAILABLE from processthreadsapi.h / Windows SDK.
if (-not [ProcessorFeatures]::IsProcessorFeaturePresent(40)) {
Write-Warning 'AVX2 is not available; the AVX2 benchmark profile will be skipped.'
exit 1
}
Write-Host 'AVX2 is available.'