File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,8 @@ class accessor_common {
288
288
constexpr static bool IsAccessReadWrite =
289
289
AccessMode == access::mode::read_write;
290
290
291
+ constexpr static bool IsAccessAtomic = AccessMode == access::mode::atomic;
292
+
291
293
using RefType = detail::const_if_const_AS<AS, DataT> &;
292
294
using ConstRefType = const DataT &;
293
295
using PtrType = detail::const_if_const_AS<AS, DataT> *;
@@ -327,6 +329,14 @@ class accessor_common {
327
329
return MAccessor[MIDs];
328
330
}
329
331
332
+ template <int CurDims = SubDims>
333
+ typename detail::enable_if_t <CurDims == 1 && IsAccessAtomic,
334
+ atomic<DataT, AS>>
335
+ operator [](size_t Index) const {
336
+ MIDs[Dims - CurDims] = Index;
337
+ return MAccessor[MIDs];
338
+ }
339
+
330
340
template <int CurDims = SubDims,
331
341
typename = detail::enable_if_t <CurDims == 1 && IsAccessReadOnly>>
332
342
ConstRefType operator [](size_t Index) const {
You can’t perform that action at this time.
0 commit comments