From 228df2bc11ad9a38d1c5354be3f8d3f07db50235 Mon Sep 17 00:00:00 2001 From: Michael Podvitskiy Date: Fri, 13 Sep 2024 14:11:21 +0200 Subject: [PATCH] cmake : fix sycl build (#9469) * try fix sycl build * use CMAKE_CXX_FLAGS as a string variable --------- Co-authored-by: Georgi Gerganov --- ggml/src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ggml/src/CMakeLists.txt b/ggml/src/CMakeLists.txt index 2bb26e072..9f3873fb5 100644 --- a/ggml/src/CMakeLists.txt +++ b/ggml/src/CMakeLists.txt @@ -539,8 +539,7 @@ if (GGML_SYCL) add_compile_definitions(GGML_SYCL_FORCE_MMQ) endif() - add_link_options (-fsycl) - add_compile_options(-fsycl -Wno-narrowing) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing -fsycl") if (GGML_SYCL_TARGET STREQUAL "NVIDIA") add_compile_definitions(GGML_SYCL_WARP_SIZE=32) @@ -575,10 +574,13 @@ if (GGML_SYCL) if (GGML_SYCL_TARGET STREQUAL "INTEL") list(APPEND GGML_EXTRA_LIBS OpenCL mkl_core pthread m dl mkl_sycl_blas mkl_intel_ilp64 mkl_tbb_thread) elseif (GGML_SYCL_TARGET STREQUAL "NVIDIA") - add_compile_options(-fsycl-targets=nvptx64-nvidia-cuda) + list(APPEND CMAKE_CXX_FLAGS -fsycl-targets=nvptx64-nvidia-cuda) list(APPEND GGML_EXTRA_LIBS pthread m dl onemkl) endif() endif() + if (${DNNL_FOUND} AND GGML_SYCL_TARGET STREQUAL "INTEL") + list(APPEND GGML_EXTRA_LIBS DNNL::dnnl) + endif() endif() if (GGML_RPC)