@@ -77,34 +77,30 @@ void bar() {
7777 FunctorAttr fattr;
7878 kernel<class kernel_name4 >(fattr);
7979
80+ kernel<class kernel_name5 >([]() [[cl::reqd_work_group_size (32 , 32 , 32 )]] {
81+ f32x32x32 ();
82+ });
83+
84+
8085#ifdef TRIGGER_ERROR
8186 Functor8 f8 ;
82- kernel<class kernel_name5 >(f8 );
87+ kernel<class kernel_name6 >(f8 );
8388
84- kernel<class kernel_name6 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
89+ kernel<class kernel_name7 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
8590 f4x1x1 ();
8691 f32x1x1 ();
8792 });
8893
89- kernel<class kernel_name7 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
94+ kernel<class kernel_name8 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
9095 f16x1x1 ();
9196 f16x16x1 ();
9297 });
9398
94- kernel<class kernel_name8 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
99+ kernel<class kernel_name9 >([]() { // expected-error {{conflicting attributes applied to a SYCL kernel}}
95100 f32x32x32 ();
96101 f32x32x1 ();
97102 });
98103
99- // Support for reqd_work_group_size (and other SYCL attributes) that apply to
100- // lambda expressions is not implemented in clang yet.
101- // When it lands, the following code is expected to compile successfully.
102- //
103- // expected-error@+1 {{'reqd_work_group_size' attribute cannot be applied to types}}
104- kernel<class kernel_name9 >([]() [[cl::reqd_work_group_size (32 , 32 , 32 )]] {
105- f32x32x32 ();
106- });
107- // While this case is not going to work (wrong syntax):
108104 // expected-error@+1 {{expected variable name or 'this' in lambda capture list}}
109105 kernel<class kernel_name10 >([[cl::reqd_work_group_size (32 , 32 , 32 )]] []() {
110106 f32x32x32 ();
@@ -121,4 +117,6 @@ void bar() {
121117// CHECK: ReqdWorkGroupSizeAttr {{.*}} 16 16 16
122118// CHECK: FunctionDecl {{.*}} {{.*}}kernel_name4
123119// CHECK: ReqdWorkGroupSizeAttr {{.*}} 128 128 128
120+ // CHECK: FunctionDecl {{.*}} {{.*}}kernel_name5
121+ // CHECK: ReqdWorkGroupSizeAttr {{.*}} 32 32 32
124122#endif // __SYCL_DEVICE_ONLY__
0 commit comments