From 0df7a115196e464506ab130032eb24d317fdc4d5 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Thu, 19 Sep 2024 14:10:17 +0200 Subject: [PATCH 1/2] add required sycl linkage when probing for include paths --- dev/bazel/toolchains/cc_toolchain_lnx.bzl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/bazel/toolchains/cc_toolchain_lnx.bzl b/dev/bazel/toolchains/cc_toolchain_lnx.bzl index 4dd36108503..b53c4ef8627 100644 --- a/dev/bazel/toolchains/cc_toolchain_lnx.bzl +++ b/dev/bazel/toolchains/cc_toolchain_lnx.bzl @@ -128,7 +128,8 @@ def _preapre_builtin_include_directory_paths(repo_ctx, tools): tools.dpcc, "-xc++", get_no_canonical_prefixes_opt(repo_ctx, tools.dpcc) + - _add_gcc_toolchain_if_needed(repo_ctx, tools.dpcc), + _add_gcc_toolchain_if_needed(repo_ctx, tools.dpcc) + + _add_sycl_linkage(repo_ctx, tools.dpcc), ) + required_tmp_includes, ) @@ -154,6 +155,12 @@ def _add_gcc_toolchain_if_needed(repo_ctx, cc): else: return [] +def _add_sycl_linkage(repo_ctx, cc): + if ("icx" in cc) or ("icpx" in cc): + return ["-fsycl"] + else: + return [] + def configure_cc_toolchain_lnx(repo_ctx, reqs): if reqs.os_id != "lnx": auto_configure_fail("Cannot configure Linux toolchain for '{}'".format(reqs.os_id)) From 0e8dfdbf716b8883900f2f01b5b5d336e2404217 Mon Sep 17 00:00:00 2001 From: David Cortes Date: Fri, 20 Sep 2024 07:52:30 +0200 Subject: [PATCH 2/2] add sycl linkage only when using dpc --- dev/bazel/toolchains/cc_toolchain_lnx.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/bazel/toolchains/cc_toolchain_lnx.bzl b/dev/bazel/toolchains/cc_toolchain_lnx.bzl index b53c4ef8627..e9c5b631be6 100644 --- a/dev/bazel/toolchains/cc_toolchain_lnx.bzl +++ b/dev/bazel/toolchains/cc_toolchain_lnx.bzl @@ -129,7 +129,7 @@ def _preapre_builtin_include_directory_paths(repo_ctx, tools): "-xc++", get_no_canonical_prefixes_opt(repo_ctx, tools.dpcc) + _add_gcc_toolchain_if_needed(repo_ctx, tools.dpcc) + - _add_sycl_linkage(repo_ctx, tools.dpcc), + _add_sycl_linkage(repo_ctx, tools.dpcc) if tools.is_dpc_found else [], ) + required_tmp_includes, )