You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Fail on kernel lambda size mismatch (#6374)
* [SYCL] Fail on kernel lambda size mismatch
Some host-compilers may create lambdas with captures that do not match
the ones used when extracting kernel descriptors. The compiler does not
currently have a stable way of handling these cases, so instead this PR
adds a static assertion that the sizes match with a message informing
about the limitation.
Signed-off-by: Larsen, Steffen <[email protected]>
// Tests for static assertion failure when kernel lambda mismatches between host
4
+
// and device.
5
+
6
+
#include<CL/sycl.hpp>
7
+
8
+
intmain() {
9
+
sycl::queue Q;
10
+
int A = 1;
11
+
Q.single_task([=]() {
12
+
#ifdef __SYCL_DEVICE_ONLY__
13
+
(void)A;
14
+
// expected-no-diagnostics
15
+
#else
16
+
// expected-error-re@CL/sycl/handler.hpp:* {{static_assert failed due to requirement '{{.*}}' "Unexpected kernel lambda size. This can be caused by an external host compiler producing a lambda with an unexpected layout. This is a limitation of the compiler."}}
0 commit comments