File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,29 @@ int main() {
166
166
}
167
167
}
168
168
169
+ // Device accessor with 2-dimensional subscript operators for atomic accessor
170
+ // check compile error
171
+ {
172
+ cl::sycl::queue queue;
173
+ if (!queue.is_host ()) {
174
+ cl::sycl::range<2 > range (1 , 1 );
175
+ int Arr[] = {2 };
176
+ {
177
+ cl::sycl::buffer<int , 1 > Buf (Arr, 1 );
178
+ queue.submit ([&](cl::sycl::handler &cgh) {
179
+ auto acc =
180
+ cl::sycl::accessor<int , 2 , cl::sycl::access ::mode::atomic,
181
+ cl::sycl::access ::target::local>(range, cgh);
182
+ cgh.parallel_for <class dim2_subscr_atomic >(
183
+ cl::sycl::nd_range<2 >{range, range}, [=](cl::sycl::nd_item<2 >) {
184
+ sycl::atomic<int , sycl::access ::address_space::local_space>
185
+ value = acc[0 ][0 ];
186
+ });
187
+ });
188
+ }
189
+ }
190
+ }
191
+
169
192
// Device accessor with 3-dimensional subscript operators.
170
193
{
171
194
sycl::queue Queue;
You can’t perform that action at this time.
0 commit comments