Compile-time definitions to detect used SYCL targets
- 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
Assessment
This issue has not been assessed yet.