@@ -39,49 +39,13 @@ void test(queue &Queue, const std::vector<size_t> SupportedSGSizes) {
39
39
return ;
40
40
}
41
41
42
- auto Props = ext::oneapi::experimental::properties{
43
- ext::oneapi::experimental::sub_group_size<SGSize>};
44
-
45
42
nd_range<1 > NdRange (SGSize * 4 , SGSize * 2 );
46
43
47
44
size_t ReadSubGroupSize = 0 ;
48
45
{
49
46
buffer ReadSubGroupSizeBuf (&ReadSubGroupSize, range (1 ));
50
47
ReadSubGroupSizeBuf.set_write_back (false );
51
48
52
- {
53
- exp_ext::command_graph Graph{
54
- Queue.get_context (),
55
- Queue.get_device (),
56
- {exp_ext::property::graph::assume_buffer_outlives_graph{}}};
57
-
58
- add_node (Graph, Queue, [&](handler &CGH) {
59
- accessor ReadSubGroupSizeBufAcc{ReadSubGroupSizeBuf, CGH,
60
- sycl::write_only, sycl::no_init};
61
-
62
- CGH.parallel_for <SubGroupKernel<Variant::Function, SGSize>>(
63
- NdRange, Props, [=](nd_item<1 > NdItem) {
64
- auto SG = NdItem.get_sub_group ();
65
- if (NdItem.get_global_linear_id () == 0 )
66
- ReadSubGroupSizeBufAcc[0 ] = SG.get_local_linear_range ();
67
- });
68
- });
69
-
70
- auto ExecGraph = Graph.finalize ();
71
- Queue.submit ([&](handler &CGH) { CGH.ext_oneapi_graph (ExecGraph); });
72
- Queue.wait_and_throw ();
73
- }
74
-
75
- host_accessor HostAcc (ReadSubGroupSizeBuf);
76
- ReadSubGroupSize = HostAcc[0 ];
77
- }
78
- assert (ReadSubGroupSize == SGSize && " Failed check for function." );
79
-
80
- ReadSubGroupSize = 0 ;
81
- {
82
- buffer ReadSubGroupSizeBuf (&ReadSubGroupSize, range (1 ));
83
- ReadSubGroupSizeBuf.set_write_back (false );
84
-
85
49
{
86
50
exp_ext::command_graph Graph{
87
51
Queue.get_context (),
@@ -107,38 +71,6 @@ void test(queue &Queue, const std::vector<size_t> SupportedSGSizes) {
107
71
ReadSubGroupSize = HostAcc[0 ];
108
72
}
109
73
assert (ReadSubGroupSize == SGSize && " Failed check for functor." );
110
-
111
- ReadSubGroupSize = 0 ;
112
- {
113
- buffer ReadSubGroupSizeBuf (&ReadSubGroupSize, range (1 ));
114
- ReadSubGroupSizeBuf.set_write_back (false );
115
-
116
- {
117
- exp_ext::command_graph Graph{
118
- Queue.get_context (),
119
- Queue.get_device (),
120
- {exp_ext::property::graph::assume_buffer_outlives_graph{}}};
121
-
122
- add_node (Graph, Queue, [&](handler &CGH) {
123
- accessor ReadSubGroupSizeBufAcc{ReadSubGroupSizeBuf, CGH,
124
- sycl::write_only, sycl::no_init};
125
- KernelFunctorWithSGSizeProp<SGSize> KernelFunctor{
126
- ReadSubGroupSizeBufAcc};
127
-
128
- CGH.parallel_for <SubGroupKernel<Variant::Functor, SGSize>>(
129
- NdRange, Props, KernelFunctor);
130
- });
131
-
132
- auto ExecGraph = Graph.finalize ();
133
- Queue.submit ([&](handler &CGH) { CGH.ext_oneapi_graph (ExecGraph); });
134
- Queue.wait_and_throw ();
135
- }
136
-
137
- host_accessor HostAcc (ReadSubGroupSizeBuf);
138
- ReadSubGroupSize = HostAcc[0 ];
139
- }
140
- assert (ReadSubGroupSize == SGSize &&
141
- " Failed check for functor and properties." );
142
74
}
143
75
144
76
int main () {
0 commit comments