intel / intel/llvm

Compile-time definitions to detect used SYCL targets

Open
#5,562 9 comments 0 reactions 1 assignee Claimed by @mdtoguchi View on GitHub
confirmed enhancement
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

**Is your feature request related to a problem? Please describe**

One or more targets can be passed to `-fsycl-targets`. For the program being compiled, it can be beneficial to know at compile time which targets were used. In my use case, different flavors of a kernel are used for different architectures (NVIDIA, Intel). If a certain architecture is not among the targets, one can skip compiling the corresponding flavor.

An additional benefit is an ability to early filter-out outright-incompatible devices (`sycl::is_compatible` is more robust, but does not appear to be working at the moment: #5561).

**Describe the solution you would like**

- Have a compile-time macro for each target marking whether kernels are expected to be compiled for this target.

**Describe alternatives you have considered**

- Add a `constexpr` aspect/flag to `sycl::backend`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.