-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_optimize_tests.ps1
26 lines (23 loc) · 1.35 KB
/
compile_optimize_tests.ps1
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
& g++ .\temp_tests.cpp .\signals.cpp .\gates.cpp .\arithmetics.cpp .\switches.cpp .\alu.cpp .\mux.cpp .\mem.cpp .\stats.cpp .\decoder.cpp .\components.cpp .\rom.cpp .\controller.cpp -O3 -Ofast -frename-registers -funroll-loops -o .\opt_tests.exe
if ($LASTEXITCODE -eq 0) {
Write-Host "Compilation successful. Executable: .\opt_tests.exe"
& .\opt_tests.exe
} else {
Write-Host "Compilation failed."
}
Write-Host "Profile Guided Optimization"
& g++ .\temp_tests.cpp .\signals.cpp .\gates.cpp .\arithmetics.cpp .\switches.cpp .\alu.cpp .\mux.cpp .\mem.cpp .\stats.cpp .\decoder.cpp .\components.cpp .\rom.cpp .\controller.cpp -O3 -Ofast -frename-registers -funroll-loops -fprofile-generate -o .\opt_tests.exe
if ($LASTEXITCODE -eq 0) {
Write-Host "Compilation successful. Profiling Executable: .\opt_tests.exe"
& .\opt_tests.exe
} else {
Write-Host "Compilation failed."
}
Write-Host "Compiling With Generated Profile"
& g++ .\temp_tests.cpp .\signals.cpp .\gates.cpp .\arithmetics.cpp .\switches.cpp .\alu.cpp .\mux.cpp .\mem.cpp .\stats.cpp .\decoder.cpp .\components.cpp .\rom.cpp .\controller.cpp -O3 -Ofast -frename-registers -funroll-loops -fprofile-use -o .\opt_tests.exe
if ($LASTEXITCODE -eq 0) {
Write-Host "Compilation successful. Profiling Executable: .\opt_tests.exe"
& .\opt_tests.exe
} else {
Write-Host "Compilation failed."
}