From 8d82afb5958b590310b4edb8aeb1a9f72e202b2d Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 13 Jan 2025 10:11:48 +0100 Subject: [PATCH] fix(stablediffusion-ggml): enable oneapi before build (#4593) Signed-off-by: Ettore Di Giacinto --- backend/go/image/stablediffusion-ggml/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/go/image/stablediffusion-ggml/Makefile b/backend/go/image/stablediffusion-ggml/Makefile index 9d6b65974d03..259d4d38544c 100644 --- a/backend/go/image/stablediffusion-ggml/Makefile +++ b/backend/go/image/stablediffusion-ggml/Makefile @@ -4,6 +4,7 @@ LIBRARY_PATH := $(abspath ./) AR?=ar CMAKE_ARGS?= BUILD_TYPE?= +ONEAPI_VARS?=/opt/intel/oneapi/setvars.sh # keep standard at C11 and C++11 CXXFLAGS = -I. -I$(INCLUDE_PATH)/../../../../sources/stablediffusion-ggml.cpp/thirdparty -I$(INCLUDE_PATH)/../../../../sources/stablediffusion-ggml.cpp/ggml/include -I$(INCLUDE_PATH)/../../../../sources/stablediffusion-ggml.cpp -O3 -DNDEBUG -std=c++17 -fPIC @@ -69,10 +70,19 @@ $(COMBINED_LIB): $(ALL_ARCHIVES) rm -rf merge-tmp build/libstable-diffusion.a: + @echo "Building SD with $(BUILD_TYPE) build type and $(CMAKE_ARGS)" +ifneq (,$(findstring sycl,$(BUILD_TYPE))) + +bash -c "source $(ONEAPI_VARS); \ + mkdir -p build && \ + cd build && \ + cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \ + cmake --build . --config Release" +else mkdir -p build && \ cd build && \ cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \ cmake --build . --config Release +endif $(MAKE) $(COMBINED_LIB) gosd.o: