From 8b1521f224332a82fa8a61f5f63da187c13a8cf9 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Wed, 13 Nov 2024 17:38:05 +0100 Subject: [PATCH] [sycl] use newer MKL target if available --- dpcpp/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dpcpp/CMakeLists.txt b/dpcpp/CMakeLists.txt index bf65888a6ab..8505fa73d98 100644 --- a/dpcpp/CMakeLists.txt +++ b/dpcpp/CMakeLists.txt @@ -117,7 +117,13 @@ endif() target_include_directories(ginkgo_dpcpp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/..) target_link_libraries(ginkgo_dpcpp PUBLIC ginkgo_device) -target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_DPCPP oneDPL) +target_link_libraries(ginkgo_dpcpp PRIVATE oneDPL) +# MKL 2024.0+ provides the MKL::MKL_SYCL target, while older versions provide *_DPCPP +if(TARGET MKL::MKL_SYCL) + target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_SYCL) +elseif () + target_link_libraries(ginkgo_dpcpp PRIVATE MKL::MKL_DPCPP) +endif () if (GINKGO_DPCPP_SINGLE_MODE) target_compile_definitions(ginkgo_dpcpp PRIVATE GINKGO_DPCPP_SINGLE_MODE=1) endif()