@@ -1146,6 +1146,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1146
1146
using value_type = DataT;
1147
1147
using reference = DataT &;
1148
1148
using const_reference = const DataT &;
1149
+ using difference_type = size_t ;
1149
1150
1150
1151
// The list of accessor constructors with their arguments
1151
1152
// -------+---------+-------+----+-----+--------------
@@ -1873,7 +1874,9 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1873
1874
1874
1875
size_t byte_size () const noexcept { return size () * sizeof (DataT); }
1875
1876
1876
- size_t max_size () const noexcept { return std::vector<DataT>().max_size (); }
1877
+ size_t max_size () const noexcept {
1878
+ std::numeric_limits<difference_type>::max ();
1879
+ }
1877
1880
1878
1881
bool empty () const noexcept { return size () == 0 ; }
1879
1882
@@ -2503,6 +2506,8 @@ class __SYCL_SPECIAL_CLASS accessor<DataT, Dimensions, AccessMode,
2503
2506
// Use base classes constructors
2504
2507
using local_acc::local_acc;
2505
2508
2509
+ using difference_type = size_t ;
2510
+
2506
2511
#ifdef __SYCL_DEVICE_ONLY__
2507
2512
2508
2513
// __init needs to be defined within the class not through inheritance.
@@ -2561,7 +2566,9 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor
2561
2566
2562
2567
size_t byte_size () const noexcept { return this ->size () * sizeof (DataT); }
2563
2568
2564
- size_t max_size () const noexcept { return std::vector<DataT>().max_size (); }
2569
+ size_t max_size () const noexcept {
2570
+ return std::numeric_limits<difference_type>::max ();
2571
+ }
2565
2572
2566
2573
bool empty () const noexcept { return this ->size () == 0 ; }
2567
2574
};
0 commit comments