@@ -1148,6 +1148,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1148
1148
using value_type = DataT;
1149
1149
using reference = DataT &;
1150
1150
using const_reference = const DataT &;
1151
+ using difference_type = size_t ;
1151
1152
1152
1153
// The list of accessor constructors with their arguments
1153
1154
// -------+---------+-------+----+-----+--------------
@@ -1863,6 +1864,8 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1863
1864
#endif
1864
1865
}
1865
1866
1867
+ void swap (accessor &other) { std::swap (impl, other.impl ); }
1868
+
1866
1869
constexpr bool is_placeholder () const { return IsPlaceH; }
1867
1870
1868
1871
size_t get_size () const { return getAccessRange ().size () * sizeof (DataT); }
@@ -1871,6 +1874,14 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1871
1874
size_t get_count () const { return size (); }
1872
1875
size_t size () const noexcept { return getAccessRange ().size (); }
1873
1876
1877
+ size_t byte_size () const noexcept { return size () * sizeof (DataT); }
1878
+
1879
+ size_t max_size () const noexcept {
1880
+ return std::numeric_limits<difference_type>::max ();
1881
+ }
1882
+
1883
+ bool empty () const noexcept { return size () == 0 ; }
1884
+
1874
1885
template <int Dims = Dimensions, typename = detail::enable_if_t <(Dims > 0 )>>
1875
1886
range<Dimensions> get_range () const {
1876
1887
return detail::convertToArrayOfN<Dimensions, 1 >(getAccessRange ());
@@ -2529,12 +2540,6 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor
2529
2540
// Use base classes constructors
2530
2541
using local_acc::local_acc;
2531
2542
2532
- using value_type = DataT;
2533
- using iterator = value_type *;
2534
- using const_iterator = const value_type *;
2535
- using reverse_iterator = std::reverse_iterator<iterator>;
2536
- using const_reverse_iterator = std::reverse_iterator<const_iterator>;
2537
-
2538
2543
#ifdef __SYCL_DEVICE_ONLY__
2539
2544
2540
2545
// __init needs to be defined within the class not through inheritance.
@@ -2556,6 +2561,24 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor
2556
2561
#endif
2557
2562
2558
2563
public:
2564
+ using value_type = DataT;
2565
+ using iterator = value_type *;
2566
+ using const_iterator = const value_type *;
2567
+ using reverse_iterator = std::reverse_iterator<iterator>;
2568
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
2569
+ using difference_type =
2570
+ typename std::iterator_traits<iterator>::difference_type;
2571
+
2572
+ void swap (local_accessor &other) { std::swap (this ->impl , other.impl ); }
2573
+
2574
+ size_t byte_size () const noexcept { return this ->size () * sizeof (DataT); }
2575
+
2576
+ size_t max_size () const noexcept {
2577
+ return std::numeric_limits<difference_type>::max ();
2578
+ }
2579
+
2580
+ bool empty () const noexcept { return this ->size () == 0 ; }
2581
+
2559
2582
iterator begin () const noexcept {
2560
2583
return &this ->operator [](id<Dimensions>());
2561
2584
}
0 commit comments