@@ -22,49 +22,50 @@ void check_props(sycl::queue &q) {}
2222
2323// Full specializations for each progress guarantee
2424
25+ struct KernelFunctor {
26+ properties props;
27+ KernelFunctor (properties &props_) : props(props_) {}
28+ void operator ()() const {}
29+ auto get (properties_tag) const { return props; }
30+ };
31+
2532template <>
2633void check_props<forward_progress_guarantee::parallel>(sycl::queue &q) {
2734 constexpr auto guarantee = forward_progress_guarantee::parallel;
2835 // Check properties at execution_scope::root_group coordination level
29- q.single_task (
30- properties{work_group_progress<guarantee, execution_scope::root_group>},
31- [=]() {});
36+ q.single_task (KernelFunctor (
37+ properties{work_group_progress<guarantee, execution_scope::root_group>}));
3238 try {
33- q.single_task (
34- properties{sub_group_progress<guarantee, execution_scope::root_group>},
35- [=]() {});
39+ q.single_task (KernelFunctor (properties{
40+ sub_group_progress<guarantee, execution_scope::root_group>}));
3641 assert (false && " Expected exception not seen!" );
3742 } catch (sycl::exception &ex) {
3843 }
3944 try {
40- q.single_task (
41- properties{work_item_progress<guarantee, execution_scope::root_group>},
42- [=]() {});
45+ q.single_task (KernelFunctor (properties{
46+ work_item_progress<guarantee, execution_scope::root_group>}));
4347 assert (false && " Expected exception not seen!" );
4448 } catch (sycl::exception &ex) {
4549 }
4650
4751 // Check properties at execution_scope::work_group coordination level
4852 try {
49- q.single_task (
50- properties{sub_group_progress<guarantee, execution_scope::work_group>},
51- [=]() {});
53+ q.single_task (KernelFunctor (properties{
54+ sub_group_progress<guarantee, execution_scope::work_group>}));
5255 assert (false && " Expected exception not seen!" );
5356 } catch (sycl::exception &ex) {
5457 }
5558 try {
56- q.single_task (
57- properties{work_item_progress<guarantee, execution_scope::work_group>},
58- [=]() {});
59+ q.single_task (KernelFunctor (properties{
60+ work_item_progress<guarantee, execution_scope::work_group>}));
5961 assert (false && " Expected exception not seen!" );
6062 } catch (sycl::exception &ex) {
6163 }
6264
6365 // Check properties at execution_scope::sub_group coordination level
6466 try {
65- q.single_task (
66- properties{work_item_progress<guarantee, execution_scope::sub_group>},
67- [=]() {});
67+ q.single_task (KernelFunctor (
68+ properties{work_item_progress<guarantee, execution_scope::sub_group>}));
6869 assert (false && " Expected exception not seen!" );
6970 } catch (sycl::exception &ex) {
7071 }
@@ -74,78 +75,66 @@ template <>
7475void check_props<forward_progress_guarantee::weakly_parallel>(sycl::queue &q) {
7576 constexpr auto guarantee = forward_progress_guarantee::weakly_parallel;
7677 // Check properties at execution_scope::root_group coordination level
77- q.single_task (
78- properties{work_group_progress<guarantee, execution_scope::root_group>},
79- [=]() {});
80- q.single_task (
81- properties{sub_group_progress<guarantee, execution_scope::root_group>},
82- [=]() {});
78+ q.single_task (KernelFunctor (
79+ properties{work_group_progress<guarantee, execution_scope::root_group>}));
80+ q.single_task (KernelFunctor (
81+ properties{sub_group_progress<guarantee, execution_scope::root_group>}));
8382
84- q.single_task (
85- properties{work_item_progress<guarantee, execution_scope::root_group>},
86- [=]() {});
83+ q.single_task (KernelFunctor (
84+ properties{work_item_progress<guarantee, execution_scope::root_group>}));
8785
8886 // Check properties at execution_scope::work_group coordination level
89- q.single_task (
90- properties{sub_group_progress<guarantee, execution_scope::work_group>},
91- [=]() {});
92- q.single_task (
93- properties{work_item_progress<guarantee, execution_scope::work_group>},
94- [=]() {});
87+ q.single_task (KernelFunctor (
88+ properties{sub_group_progress<guarantee, execution_scope::work_group>}));
89+ q.single_task (KernelFunctor (
90+ properties{work_item_progress<guarantee, execution_scope::work_group>}));
9591
9692 // Check properties at execution_scope::sub_group coordination level
97- q.single_task (
98- properties{work_item_progress<guarantee, execution_scope::sub_group>},
99- [=]() {});
93+ q.single_task (KernelFunctor (
94+ properties{work_item_progress<guarantee, execution_scope::sub_group>}));
10095}
10196
10297template <>
10398void check_props<forward_progress_guarantee::concurrent>(sycl::queue &q) {
10499 constexpr auto guarantee = forward_progress_guarantee::concurrent;
105100 // Check properties at execution_scope::root_group coordination level
106101 try {
107- q.single_task (
108- properties{work_group_progress<guarantee, execution_scope::root_group>},
109- [=]() {});
102+ q.single_task (KernelFunctor (properties{
103+ work_group_progress<guarantee, execution_scope::root_group>}));
110104 assert (false && " Expected exception not seen!" );
111105 } catch (sycl::exception &ex) {
112106 }
113107 try {
114- q.single_task (
115- properties{sub_group_progress<guarantee, execution_scope::root_group>},
116- [=]() {});
108+ q.single_task (KernelFunctor (properties{
109+ sub_group_progress<guarantee, execution_scope::root_group>}));
117110 assert (false && " Expected exception not seen!" );
118111 } catch (sycl::exception &ex) {
119112 }
120113 try {
121- q.single_task (
122- properties{work_item_progress<guarantee, execution_scope::root_group>},
123- [=]() {});
114+ q.single_task (KernelFunctor (properties{
115+ work_item_progress<guarantee, execution_scope::root_group>}));
124116 assert (false && " Expected exception not seen!" );
125117 } catch (sycl::exception &ex) {
126118 }
127119
128120 // Check properties at execution_scope::work_group coordination level
129121 try {
130- q.single_task (
131- properties{sub_group_progress<guarantee, execution_scope::work_group>},
132- [=]() {});
122+ q.single_task (KernelFunctor (properties{
123+ sub_group_progress<guarantee, execution_scope::work_group>}));
133124 assert (false && " Expected exception not seen!" );
134125 } catch (sycl::exception &ex) {
135126 }
136127 try {
137- q.single_task (
138- properties{work_item_progress<guarantee, execution_scope::work_group>},
139- [=]() {});
128+ q.single_task (KernelFunctor (properties{
129+ work_item_progress<guarantee, execution_scope::work_group>}));
140130 assert (false && " Expected exception not seen!" );
141131 } catch (sycl::exception &ex) {
142132 }
143133
144134 // Check properties at execution_scope::sub_group coordination level
145135 try {
146- q.single_task (
147- properties{work_item_progress<guarantee, execution_scope::sub_group>},
148- [=]() {});
136+ q.single_task (KernelFunctor (
137+ properties{work_item_progress<guarantee, execution_scope::sub_group>}));
149138 assert (false && " Expected exception not seen!" );
150139 } catch (sycl::exception &ex) {
151140 }
0 commit comments