-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_all_simd.ps1
More file actions
27 lines (21 loc) · 1.34 KB
/
build_all_simd.ps1
File metadata and controls
27 lines (21 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# PowerShell script to build all 3 SIMD versions of the Windows OOM Killer
$distDir = "dist"
if (!(Test-Path $distDir)) {
New-Item -ItemType Directory -Path $distDir
}
Write-Host "--- Building SSE2 Version (Generic) ---" -ForegroundColor Cyan
$env:RUSTFLAGS = "-C target-feature=+sse2"
cargo build --release --target x86_64-pc-windows-msvc
Move-Item -Path ".\target\x86_64-pc-windows-msvc\release\symphony-memory-guard.exe" -Destination "$distDir\symphony-memory-guard-sse2.exe" -Force
Write-Host "`n--- Building AVX2 Version ---" -ForegroundColor Cyan
$env:RUSTFLAGS = "-C target-feature=+avx2"
cargo build --release --target x86_64-pc-windows-msvc
Move-Item -Path ".\target\x86_64-pc-windows-msvc\release\symphony-memory-guard.exe" -Destination "$distDir\symphony-memory-guard-avx2.exe" -Force
Write-Host "`n--- Building AVX-512 Version ---" -ForegroundColor Cyan
$env:RUSTFLAGS = "-C target-feature=+avx512f,+avx512bw"
cargo build --release --target x86_64-pc-windows-msvc
Move-Item -Path ".\target\x86_64-pc-windows-msvc\release\symphony-memory-guard.exe" -Destination "$distDir\symphony-memory-guard-avx512.exe" -Force
# Reset RUSTFLAGS
$env:RUSTFLAGS = ""
Write-Host "`nBuild complete! Binaries are in the '$distDir' folder:" -ForegroundColor Green
Get-ChildItem $distDir | Select-Object Name, @{Name="Size(MB)";Expression={"{0:N2}" -f ($_.Length / 1MB)}}