Skip to content

Commit 9cbf82e

Browse files
luoyu-intelNeo Zhang
authored and
Neo Zhang
committed
[SYCL] Fix win build conflict of math library (ggml-org#8230)
* fix win build conflict of math library * fix the condition: !(win32 & SYCL) * revert warp_size=16
1 parent de91f8e commit 9cbf82e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakePresets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"cacheVariables": {
2020
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
2121
"CMAKE_CXX_COMPILER": "icx",
22+
"CMAKE_C_COMPILER": "cl",
2223
"GGML_SYCL": "ON",
2324
"CMAKE_INSTALL_RPATH": "$ORIGIN;$ORIGIN/.."
2425
}

ggml/src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ if (GGML_SYCL)
490490
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsycl-targets=nvptx64-nvidia-cuda")
491491
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
492492
else()
493-
add_compile_definitions(GGML_SYCL_WARP_SIZE=16)
493+
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
494494
endif()
495495

496496
file(GLOB GGML_HEADERS_SYCL "ggml-sycl/*.hpp")
@@ -1168,7 +1168,9 @@ target_link_libraries(ggml PRIVATE Threads::Threads ${GGML_EXTRA_LIBS})
11681168

11691169
find_library(MATH_LIBRARY m)
11701170
if (MATH_LIBRARY)
1171-
target_link_libraries(ggml PRIVATE ${MATH_LIBRARY})
1171+
if (NOT WIN32 OR NOT GGML_SYCL)
1172+
target_link_libraries(ggml PRIVATE ${MATH_LIBRARY})
1173+
endif()
11721174
endif()
11731175

11741176
if (BUILD_SHARED_LIBS)

0 commit comments

Comments
 (0)