From 446dc1a1282d45a9c7b44549a91e8ddf68ec52bc Mon Sep 17 00:00:00 2001 From: Zhang Date: Mon, 25 Mar 2024 09:47:03 +0800 Subject: [PATCH] fix LOG() error for SYCL, enhance erro check by CI --- .github/workflows/build.yml | 2 +- common/log.h | 4 ++-- examples/sycl/win-build-sycl.bat | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e7643bba..570296f7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -803,7 +803,7 @@ jobs: defaults: run: - shell: bash + shell: cmd env: WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/62641e01-1e8d-4ace-91d6-ae03f7f8a71f/w_BaseKit_p_2024.0.0.49563_offline.exe diff --git a/common/log.h b/common/log.h index eb111e784..253a394c1 100644 --- a/common/log.h +++ b/common/log.h @@ -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) \ diff --git a/examples/sycl/win-build-sycl.bat b/examples/sycl/win-build-sycl.bat index f9d43f8ed..aea74278c 100644 --- a/examples/sycl/win-build-sycl.bat +++ b/examples/sycl/win-build-sycl.bat @@ -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,17 @@ 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% \ No newline at end of file