Only get MKL library when needed

Signed-off-by: Joe Todd <joe.todd@codeplay.com>
This commit is contained in:
Joe Todd 2024-07-23 12:58:46 +01:00
parent f2bcdb3806
commit 92d66cd8ca

View file

@ -467,10 +467,6 @@ if (GGML_SYCL)
message(FATAL_ERROR "Invalid backend chosen, supported options are INTEL or NVIDIA")
endif()
if (GGML_SYCL_TARGET STREQUAL "INTEL")
find_package(MKL REQUIRED)
endif()
check_cxx_compiler_flag("-fsycl" SUPPORTS_SYCL)
if ( DEFINED ENV{ONEAPI_ROOT})
message(STATUS "Using oneAPI Release SYCL compiler (icpx).")
@ -484,7 +480,6 @@ if (GGML_SYCL)
message(STATUS "SYCL found")
#todo: AOT
list(APPEND GGML_CDEF_PUBLIC GGML_USE_SYCL)
if (GGML_SYCL_F16)
@ -511,6 +506,7 @@ if (GGML_SYCL)
if (WIN32)
find_package(IntelSYCL REQUIRED)
find_package(MKL REQUIRED)
set(GGML_EXTRA_LIBS ${GGML_EXTRA_LIBS} IntelSYCL::SYCL_CXX MKL::MKL MKL::MKL_SYCL)
else()
if (GGML_SYCL_TARGET STREQUAL "INTEL")