Skip to content

Commit 228df2b

Browse files
Xarbirusggerganov
andauthored
cmake : fix sycl build (#9469)
* try fix sycl build * use CMAKE_CXX_FLAGS as a string variable --------- Co-authored-by: Georgi Gerganov <[email protected]>
1 parent b653b1e commit 228df2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ggml/src/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,7 @@ if (GGML_SYCL)
539539
add_compile_definitions(GGML_SYCL_FORCE_MMQ)
540540
endif()
541541

542-
add_link_options (-fsycl)
543-
add_compile_options(-fsycl -Wno-narrowing)
542+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-narrowing -fsycl")
544543

545544
if (GGML_SYCL_TARGET STREQUAL "NVIDIA")
546545
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
@@ -575,10 +574,13 @@ if (GGML_SYCL)
575574
if (GGML_SYCL_TARGET STREQUAL "INTEL")
576575
list(APPEND GGML_EXTRA_LIBS OpenCL mkl_core pthread m dl mkl_sycl_blas mkl_intel_ilp64 mkl_tbb_thread)
577576
elseif (GGML_SYCL_TARGET STREQUAL "NVIDIA")
578-
add_compile_options(-fsycl-targets=nvptx64-nvidia-cuda)
577+
list(APPEND CMAKE_CXX_FLAGS -fsycl-targets=nvptx64-nvidia-cuda)
579578
list(APPEND GGML_EXTRA_LIBS pthread m dl onemkl)
580579
endif()
581580
endif()
581+
if (${DNNL_FOUND} AND GGML_SYCL_TARGET STREQUAL "INTEL")
582+
list(APPEND GGML_EXTRA_LIBS DNNL::dnnl)
583+
endif()
582584
endif()
583585

584586
if (GGML_RPC)

0 commit comments

Comments
 (0)