@@ -21,7 +21,7 @@ else ifeq ($(BUILD_TYPE),openblas)
2121# If build type is clblas (openCL) we set -DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
2222else ifeq ($(BUILD_TYPE),clblas)
2323 CMAKE_ARGS+=-DGGML_CLBLAST=ON -DCLBlast_DIR=/some/path
24- # If it's hipblas we do have also to set CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++
24+ # If it's hipblas we do have also to set CC=/opt/rocm/llvm/bin/clang CXX=/opt/rocm/llvm/bin/clang++
2525else ifeq ($(BUILD_TYPE),hipblas)
2626 CMAKE_ARGS+=-DGGML_HIP=ON
2727# If it's OSX, DO NOT embed the metal library - -DGGML_METAL_EMBED_LIBRARY=ON requires further investigation
@@ -36,13 +36,22 @@ else ifeq ($(OS),Darwin)
3636 endif
3737endif
3838
39- # ifeq ($(BUILD_TYPE),sycl_f16)
40- # CMAKE_ARGS+=-DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON -DSD_SYCL=ON -DGGML_SYCL_F16=ON
41- # endif
39+ ifeq ($(BUILD_TYPE ) ,sycl_f16)
40+ CMAKE_ARGS+=-DGGML_SYCL=ON \
41+ -DCMAKE_C_COMPILER=icx \
42+ -DCMAKE_CXX_COMPILER=icpx \
43+ -DSD_SYCL=ON \
44+ -DGGML_SYCL_F16=ON \
45+ -DCMAKE_CXX_FLAGS="-fsycl"
46+ endif
4247
43- # ifeq ($(BUILD_TYPE),sycl_f32)
44- # CMAKE_ARGS+=-DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DSD_SYCL=ON
45- # endif
48+ ifeq ($(BUILD_TYPE ) ,sycl_f32)
49+ CMAKE_ARGS+=-DGGML_SYCL=ON \
50+ -DCMAKE_C_COMPILER=icx \
51+ -DCMAKE_CXX_COMPILER=icpx \
52+ -DSD_SYCL=ON \
53+ -DCMAKE_CXX_FLAGS="-fsycl"
54+ endif
4655
4756# warnings
4857CXXFLAGS += -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function
@@ -76,12 +85,12 @@ ifneq (,$(findstring sycl,$(BUILD_TYPE)))
7685 mkdir -p build && \
7786 cd build && \
7887 cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \
79- cmake --build . --config Release"
88+ cmake --build . --config Release -j$(nproc) "
8089else
8190 mkdir -p build && \
8291 cd build && \
8392 cmake $(CMAKE_ARGS) ../../../../../sources/stablediffusion-ggml.cpp && \
84- cmake --build . --config Release
93+ cmake --build . --config Release -j$(nproc)
8594endif
8695 $(MAKE) $(COMBINED_LIB)
8796
@@ -93,4 +102,4 @@ libsd.a: gosd.o
93102 $(AR ) rcs libsd.a gosd.o
94103
95104clean :
96- rm -rf gosd.o libsd.a build $(COMBINED_LIB )
105+ rm -rf gosd.o libsd.a build $(COMBINED_LIB )
0 commit comments