aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/sycl/sycl/build_defs.bzl.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sycl/sycl/build_defs.bzl.tpl')
-rwxr-xr-xthird_party/sycl/sycl/build_defs.bzl.tpl13
1 files changed, 13 insertions, 0 deletions
diff --git a/third_party/sycl/sycl/build_defs.bzl.tpl b/third_party/sycl/sycl/build_defs.bzl.tpl
new file mode 100755
index 0000000000..09bef0a661
--- /dev/null
+++ b/third_party/sycl/sycl/build_defs.bzl.tpl
@@ -0,0 +1,13 @@
+# Macros for building SYCL code.
+
+def if_sycl(if_true, if_false = []):
+ """Shorthand for select()'ing on whether we're building with SYCL.
+
+ Returns a select statement which evaluates to if_true if we're building
+ with SYCL enabled. Otherwise, the select statement evaluates to if_false.
+
+ """
+ return select({
+ "@local_config_sycl//sycl:using_sycl": if_true,
+ "//conditions:default": if_false
+ })