From c0fd6692e32e3d550d71a7919b9532987f35684e Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 28 Jul 2025 09:36:12 -0700 Subject: [PATCH 1/3] [SYCL][CMake] Apply SYCL_LIBDEVICE_CXX_FLAGS to IMF host compile Signed-off-by: Sarnie, Nick --- libdevice/cmake/modules/SYCLLibdevice.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index 42eaab4ce4f2d..db562cf0e419a 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -646,6 +646,7 @@ set(imf_bf16_fallback_src ${imf_fallback_src_dir}/imf_bf16_fallback.cpp) set(imf_host_cxx_flags -c --target=${LLVM_HOST_TRIPLE} -D__LIBDEVICE_HOST_IMPL__ + ${SYCL_LIBDEVICE_CXX_FLAGS} ) if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "") From 90ba768b9d6d15581e27fb6dc50c9841fa2c82aa Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 28 Jul 2025 10:07:07 -0700 Subject: [PATCH 2/3] simplify args Signed-off-by: Sarnie, Nick --- libdevice/cmake/modules/SYCLLibdevice.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index db562cf0e419a..d70542477f4df 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -57,7 +57,7 @@ set(SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation") set(SYCL_LIBDEVICE_CXX_FLAGS "" CACHE STRING "C++ compiler flags for SYCL libdevice") if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "") - list(APPEND compile_opts "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}") + list(APPEND SYCL_LIBDEVICE_CXX_FLAGS "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}") endif() if(NOT SYCL_LIBDEVICE_CXX_FLAGS STREQUAL "") separate_arguments(SYCL_LIBDEVICE_CXX_FLAGS NATIVE_COMMAND ${SYCL_LIBDEVICE_CXX_FLAGS}) @@ -649,10 +649,6 @@ set(imf_host_cxx_flags -c ${SYCL_LIBDEVICE_CXX_FLAGS} ) -if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "") - list(APPEND imf_host_cxx_flags "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}") -endif() - if(LLVM_LIBCXX_USED) list(APPEND imf_host_cxx_flags "-stdlib=libc++") endif() From 49153e77e0788aa4d45085541db41cfba7b0f171 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 28 Jul 2025 10:42:58 -0700 Subject: [PATCH 3/3] whoops Signed-off-by: Sarnie, Nick --- libdevice/cmake/modules/SYCLLibdevice.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libdevice/cmake/modules/SYCLLibdevice.cmake b/libdevice/cmake/modules/SYCLLibdevice.cmake index d70542477f4df..9635ec800c0c2 100644 --- a/libdevice/cmake/modules/SYCLLibdevice.cmake +++ b/libdevice/cmake/modules/SYCLLibdevice.cmake @@ -56,13 +56,18 @@ set(compile_opts set(SYCL_LIBDEVICE_GCC_TOOLCHAIN "" CACHE PATH "Path to GCC installation") set(SYCL_LIBDEVICE_CXX_FLAGS "" CACHE STRING "C++ compiler flags for SYCL libdevice") +if(NOT SYCL_LIBDEVICE_CXX_FLAGS STREQUAL "") + separate_arguments(SYCL_LIBDEVICE_CXX_FLAGS NATIVE_COMMAND ${SYCL_LIBDEVICE_CXX_FLAGS}) +endif() + if (NOT SYCL_LIBDEVICE_GCC_TOOLCHAIN STREQUAL "") list(APPEND SYCL_LIBDEVICE_CXX_FLAGS "--gcc-install-dir=${SYCL_LIBDEVICE_GCC_TOOLCHAIN}") endif() + if(NOT SYCL_LIBDEVICE_CXX_FLAGS STREQUAL "") - separate_arguments(SYCL_LIBDEVICE_CXX_FLAGS NATIVE_COMMAND ${SYCL_LIBDEVICE_CXX_FLAGS}) list(APPEND compile_opts ${SYCL_LIBDEVICE_CXX_FLAGS}) endif() + if(LLVM_LIBCXX_USED) list(APPEND compile_opts "-stdlib=libc++") endif()