Skip to content

Commit 8d82afb

Browse files
authored
fix(stablediffusion-ggml): enable oneapi before build (#4593)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent aea71dd commit 8d82afb

File tree

1 file changed

+10
-0
lines changed
  • backend/go/image/stablediffusion-ggml

1 file changed

+10
-0
lines changed

backend/go/image/stablediffusion-ggml/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ LIBRARY_PATH := $(abspath ./)
44
AR?=ar
55
CMAKE_ARGS?=
66
BUILD_TYPE?=
7+
ONEAPI_VARS?=/opt/intel/oneapi/setvars.sh
78
# keep standard at C11 and C++11
89
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
910

@@ -69,10 +70,19 @@ $(COMBINED_LIB): $(ALL_ARCHIVES)
6970
rm -rf merge-tmp
7071

7172
build/libstable-diffusion.a:
73+
@echo "Building SD with $(BUILD_TYPE) build type and $(CMAKE_ARGS)"
74+
ifneq (,$(findstring sycl,$(BUILD_TYPE)))
75+
+bash -c "source $(ONEAPI_VARS); \
76+
mkdir -p build && \
77+
cd build && \
78+
cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \
79+
cmake --build . --config Release"
80+
else
7281
mkdir -p build && \
7382
cd build && \
7483
cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \
7584
cmake --build . --config Release
85+
endif
7686
$(MAKE) $(COMBINED_LIB)
7787

7888
gosd.o:

0 commit comments

Comments
 (0)