Skip to content

Commit 247cc1c

Browse files
NeoZhangJianyutybalex
authored andcommitted
[SYCL] fix SYCL backend build on windows is break by LOG() error (ggml-org#6290)
* fix LOG() error for SYCL, enhance erro check by CI * rollback to bash * add newline at end of file
1 parent c8b7620 commit 247cc1c

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

common/log.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
234234
// INTERNAL, DO NOT USE
235235
// USE LOG() INSTEAD
236236
//
237-
#ifndef _MSC_VER
237+
#if !defined(_MSC_VER) or defined(__INTEL_LLVM_COMPILER)
238238
#define LOG_IMPL(str, ...) \
239239
do { \
240240
if (LOG_TARGET != nullptr) \
@@ -257,7 +257,7 @@ inline std::string log_filename_generator_impl(LogTriState multilog, const std::
257257
// INTERNAL, DO NOT USE
258258
// USE LOG_TEE() INSTEAD
259259
//
260-
#ifndef _MSC_VER
260+
#if !defined(_MSC_VER) or defined(__INTEL_LLVM_COMPILER)
261261
#define LOG_TEE_IMPL(str, ...) \
262262
do { \
263263
if (LOG_TARGET != nullptr) \

examples/sycl/win-build-sycl.bat

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,32 @@
33
:: Copyright (C) 2024 Intel Corporation
44
:: SPDX-License-Identifier: MIT
55

6-
mkdir -p build
6+
7+
IF not exist build (mkdir build)
78
cd build
9+
if %errorlevel% neq 0 goto ERROR
10+
811
@call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force
12+
if %errorlevel% neq 0 goto ERROR
913

1014
:: for FP16
1115
:: faster for long-prompt inference
1216
:: cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release -DLLAMA_SYCL_F16=ON
1317

1418
:: for FP32
1519
cmake -G "MinGW Makefiles" .. -DLLAMA_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icx -DCMAKE_BUILD_TYPE=Release
16-
17-
20+
if %errorlevel% neq 0 goto ERROR
1821
:: build example/main only
1922
:: make main
2023

2124
:: build all binary
2225
make -j
26+
if %errorlevel% neq 0 goto ERROR
27+
2328
cd ..
29+
exit /B 0
30+
31+
:ERROR
32+
echo comomand error: %errorlevel%
33+
exit /B %errorlevel%
34+

0 commit comments

Comments
 (0)