Felipe97/llama-cpp-compiled
01.1k
1 2:: MIT license3:: Copyright (C) 2024 Intel Corporation4:: SPDX-License-Identifier: MIT5 6IF /I "%1"=="--help" (7 echo Usage: win-build-sycl.bat [fp32^|fp16] [--help]8 echo.9 echo Options:10 echo fp32 Build with FP32 precision ^(default^)11 echo fp16 Build with FP16 precision ^(faster for long-prompt inference^)12 echo --help Print this help message13 exit /B 014)15 16SET PRECISION=%117IF "%PRECISION%"=="" SET PRECISION=fp3218IF /I NOT "%PRECISION%"=="fp32" IF /I NOT "%PRECISION%"=="fp16" (19 echo Error: invalid value '%PRECISION%'. Use 'fp32' or 'fp16'.20 echo Usage: win-build-sycl.bat [fp32^|fp16] [--help]21 exit /B 122)23 24IF not exist build (mkdir build)25cd build26if %errorlevel% neq 0 goto ERROR27 28@call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force29if %errorlevel% neq 0 goto ERROR30 31IF /I "%PRECISION%"=="fp16" (32 :: for FP1633 :: faster for long-prompt inference34 cmake -G "MinGW Makefiles" .. -DLLAMA_OPENSSL=OFF -DGGML_SYCL=ON -DCMAKE_CXX_COMPILER=icx -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DGGML_SYCL_F16=ON35) ELSE (36 :: for FP3237 cmake -G "Ninja" .. -DLLAMA_OPENSSL=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release38)39if %errorlevel% neq 0 goto ERROR40 41:: build all binary42cmake --build . -j43if %errorlevel% neq 0 goto ERROR44 45cd ..46exit /B 047 48:ERROR49echo comomand error: %errorlevel%50exit /B %errorlevel%51 