forked from animatedread/Warrior_EA
35 lines
1.2 KiB
Batchfile
35 lines
1.2 KiB
Batchfile
|
|
@echo off
|
||
|
|
REM Builds and runs dense_backprop_check.exe - the offline math check for the
|
||
|
|
REM 2026-08-11 dense hidden-gradient transpose fix. Locates the VS build
|
||
|
|
REM environment itself, exactly like build_cpu.bat beside it.
|
||
|
|
REM Run build_cpu.bat FIRST so WarriorCPU.lib/.dll match the current source.
|
||
|
|
setlocal
|
||
|
|
|
||
|
|
set VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
||
|
|
if not exist %VSWHERE% (
|
||
|
|
echo Could not find vswhere.exe - is Visual Studio / Build Tools installed?
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
for /f "usebackq tokens=*" %%i in (`%VSWHERE% -latest -products * -property installationPath`) do (
|
||
|
|
set VSINSTALL=%%i
|
||
|
|
)
|
||
|
|
if not defined VSINSTALL (
|
||
|
|
echo Could not find any Visual Studio / Build Tools installation.
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
|
||
|
|
if errorlevel 1 exit /b 1
|
||
|
|
|
||
|
|
cd /d "%~dp0"
|
||
|
|
cl.exe /nologo /EHsc /O2 /std:c++17 dense_backprop_check.cpp WarriorCPU.lib /Fe:dense_backprop_check.exe
|
||
|
|
if errorlevel 1 (
|
||
|
|
echo Build failed.
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
REM ".\" prefix on purpose - some shells refuse to launch an executable by bare
|
||
|
|
REM relative name, and the failure reads as "build produced nothing".
|
||
|
|
.\dense_backprop_check.exe
|
||
|
|
exit /b %errorlevel%
|