@@ -27,6 +27,15 @@ file(GLOB GGML_HEADERS_SYCL "*.hpp")
27
27
file (GLOB GGML_SOURCES_SYCL "*.cpp" )
28
28
target_sources (ggml-sycl PRIVATE ${GGML_HEADERS_SYCL} ${GGML_SOURCES_SYCL} )
29
29
30
+ if (WIN32 )
31
+ # To generate a Visual Studio solution, using Intel C++ Compiler for ggml-sycl is mandatory
32
+ if ( ${CMAKE_GENERATOR} MATCHES "Visual Studio" AND NOT (${CMAKE_GENERATOR_TOOLSET} MATCHES "Intel C" ))
33
+ set_target_properties (ggml-sycl PROPERTIES VS_PLATFORM_TOOLSET "Intel C++ Compiler 2025" )
34
+ set (CMAKE_CXX_COMPILER "icx" )
35
+ set (CMAKE_CXX_COMPILER_ID "IntelLLVM" )
36
+ endif ()
37
+ endif ()
38
+
30
39
find_package (IntelSYCL )
31
40
if (IntelSYCL_FOUND )
32
41
# Use oneAPI CMake when possible
@@ -95,19 +104,10 @@ if (GGML_SYCL_GRAPH)
95
104
target_compile_definitions (ggml-sycl PRIVATE GGML_SYCL_GRAPH )
96
105
endif ()
97
106
98
- if (WIN32 )
99
- if ( ${CMAKE_GENERATOR} MATCHES "Visual Studio" AND NOT (${CMAKE_GENERATOR_TOOLSET} MATCHES "Intel C" ))
100
- set_target_properties (ggml-sycl PROPERTIES VS_PLATFORM_TOOLSET "Intel C++ Compiler 2025" )
101
- set (CMAKE_CXX_COMPILER "icx" )
102
- set (CMAKE_CXX_COMPILER_ID "IntelLLVM" )
103
- endif ()
104
- endif ()
105
-
106
107
# Link against Intel oneMKL or oneMath
107
108
if (GGML_SYCL_TARGET STREQUAL "INTEL" )
108
109
# Intel devices use Intel oneMKL directly instead of oneMath to avoid the limitation of linking Intel oneMKL statically
109
110
# See https://github.com/uxlfoundation/oneMath/issues/654
110
- find_package (IntelSYCL REQUIRED )
111
111
find_package (MKL REQUIRED )
112
112
target_link_libraries (ggml-sycl PRIVATE MKL::MKL_SYCL::BLAS )
113
113
target_compile_definitions (ggml-sycl PRIVATE GGML_SYCL_USE_INTEL_ONEMKL )
0 commit comments