diff --git a/sycl/include/sycl/accessor.hpp b/sycl/include/sycl/accessor.hpp index 586796382bf31..9e05e48f20080 100644 --- a/sycl/include/sycl/accessor.hpp +++ b/sycl/include/sycl/accessor.hpp @@ -2529,6 +2529,12 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor // Use base classes constructors using local_acc::local_acc; + using value_type = DataT; + using iterator = value_type *; + using const_iterator = const value_type *; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + #ifdef __SYCL_DEVICE_ONLY__ // __init needs to be defined within the class not through inheritance. @@ -2550,6 +2556,24 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(local_accessor) local_accessor #endif public: + iterator begin() const noexcept { + return &this->operator[](id()); + } + iterator end() const noexcept { return begin() + this->size(); } + + const_iterator cbegin() const noexcept { return const_iterator(begin()); } + const_iterator cend() const noexcept { return const_iterator(end()); } + + reverse_iterator rbegin() const noexcept { return reverse_iterator(end()); } + reverse_iterator rend() const noexcept { return reverse_iterator(begin()); } + + const_reverse_iterator crbegin() const noexcept { + return const_reverse_iterator(end()); + } + const_reverse_iterator crend() const noexcept { + return const_reverse_iterator(begin()); + } + template bool has_property() const noexcept { #ifndef __SYCL_DEVICE_ONLY__ return this->getPropList().template has_property();