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)