forked from animatedread/Warrior_EA
Add type checks to correctly cast `CNeuronBaseOCL` objects in gradient clipping, softmax evaluation, and `backProp`/`backPropDfa` loops. Previously, all neurons were assumed to be `CNeuronBase`, causing invalid pointer casts and incorrect gradient/output access for OpenCL layers. This ensures proper support for both CPU and OCL neuron implementations.
59 lines
1.8 KiB
Batchfile
59 lines
1.8 KiB
Batchfile
@echo off
|
|
REM Builds WarriorCPU.dll with MSVC. Run this from a plain cmd/PowerShell
|
|
REM window - it locates and loads the VS build environment itself, no
|
|
REM need to open a "Developer Command Prompt" first.
|
|
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
|
|
)
|
|
if not exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" (
|
|
echo Found a VS install at "%VSINSTALL%" but it has no C++ toolset ^(vcvars64.bat missing^).
|
|
echo Install the "Desktop development with C++" workload ^(or the smaller
|
|
echo "Build Tools for Visual Studio"^) and re-run this script.
|
|
exit /b 1
|
|
)
|
|
|
|
call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat"
|
|
if errorlevel 1 exit /b 1
|
|
|
|
cd /d "%~dp0"
|
|
cl.exe /nologo /LD /EHsc /O2 /std:c++17 ^
|
|
WarriorCPU.cpp ^
|
|
/Fe:WarriorCPU.dll
|
|
|
|
if errorlevel 1 (
|
|
echo Build failed.
|
|
exit /b 1
|
|
)
|
|
|
|
set "TARGET_ROOT=%APPDATA%\MetaQuotes"
|
|
if exist "%TARGET_ROOT%\Terminal" (
|
|
for /d %%D in ("%TARGET_ROOT%\Terminal\*") do (
|
|
if exist "%%~fD\MQL5\Libraries" (
|
|
copy /Y "%~dp0WarriorCPU.dll" "%%~fD\MQL5\Libraries\WarriorCPU.dll" >nul 2>&1
|
|
)
|
|
)
|
|
)
|
|
if exist "%TARGET_ROOT%\Tester" (
|
|
for /d %%D in ("%TARGET_ROOT%\Tester\*") do (
|
|
if exist "%%~fD\MQL5\Libraries" (
|
|
copy /Y "%~dp0WarriorCPU.dll" "%%~fD\MQL5\Libraries\WarriorCPU.dll" >nul 2>&1
|
|
)
|
|
)
|
|
)
|
|
|
|
echo.
|
|
echo Built DirectML\WarriorCPU.dll
|
|
echo Deployed to any discovered MetaTrader MQL5\Libraries folders.
|
|
endlocal
|