]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
[SYCL] fix SYCL backend build on windows is break by LOG() error (#6290)
authorNeo Zhang Jianyu <redacted>
Mon, 25 Mar 2024 07:52:41 +0000 (15:52 +0800)
committerGitHub <redacted>
Mon, 25 Mar 2024 07:52:41 +0000 (15:52 +0800)
* fix LOG() error for SYCL, enhance erro check by CI

* rollback to bash

* add newline at end of file

common/log.h
examples/sycl/win-build-sycl.bat

index 48d21e43cae274d20ded3a58c84533fdf84c5ea2..e4edcac7d77355b793e67f7de186970e1858a607 100644 (file)
@@ -234,7 +234,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
 // INTERNAL, DO NOT USE
 //  USE LOG() INSTEAD
 //
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) or defined(__INTEL_LLVM_COMPILER)
     #define LOG_IMPL(str, ...)                                                                                      \
     do {                                                                                                            \
         if (LOG_TARGET != nullptr)                                                                                  \
@@ -257,7 +257,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
 // INTERNAL, DO NOT USE
 //  USE LOG_TEE() INSTEAD
 //
-#ifndef _MSC_VER
+#if !defined(_MSC_VER) or defined(__INTEL_LLVM_COMPILER)
     #define LOG_TEE_IMPL(str, ...)                                                                                                      \
     do {                                                                                                                                \
         if (LOG_TARGET != nullptr)                                                                                                      \
index f9d43f8ed6aafeeabee4440a0325594d9a82bb22..1b0dc41babd351c5eeca6dee53b6e0d6b39413eb 100644 (file)
@@ -3,9 +3,13 @@
 ::  Copyright (C) 2024 Intel Corporation
 ::  SPDX-License-Identifier: MIT
 
-mkdir -p build
+
+IF not exist build (mkdir build)
 cd build
+if %errorlevel% neq 0 goto ERROR
+
 @call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force
+if %errorlevel% neq 0 goto ERROR
 
 ::  for FP16
 ::  faster for long-prompt inference
@@ -13,11 +17,18 @@ cd build
 
 ::  for FP32
 cmake -G "MinGW Makefiles" ..  -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx  -DCMAKE_BUILD_TYPE=Release
-
-
+if %errorlevel% neq 0 goto ERROR
 ::  build example/main only
 ::  make main
 
 ::  build all binary
 make -j
+if %errorlevel% neq 0 goto ERROR
+
 cd ..
+exit /B 0
+
+:ERROR
+echo comomand error: %errorlevel%
+exit /B %errorlevel%
+