Skip to content

Commit 180f73e

Browse files
authored
[SYCL][COMPAT] Add dummy template params to memory APIs to delay kernel instantiation (#17743)
The functions `syclcompat::detail::fill` and `syclcompat::detail::memcpy` define SYCL kernels. Any translation unit including the `memory.hpp` or `util.hpp` headers will contain these kernels, as DPC++'s 2-pass compiler is not currently able to reason about which kernels are actually used. Adding a dummy template parameter (typename T = void) ensures that these functions (and thus their kernels) are only instantiated if used.
1 parent 9be245c commit 180f73e

File tree

2 files changed

+130
-3
lines changed

2 files changed

+130
-3
lines changed

0 commit comments

Comments
 (0)