DPC++ Runtime
Runtime libraries for oneAPI DPC++
accessor_iterator.hpp File Reference
#include <sycl/id.hpp>
#include <cstddef>
#include <iterator>
#include <ostream>
#include <type_traits>
Include dependency graph for accessor_iterator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  sycl::_V1::accessor< DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, PropertyListT >
class  sycl::_V1::detail::accessor_iterator< DataT, Dimensions >


 ---— Error handling, matching OpenCL plugin semantics.

Detailed Description

The file contains implementation of accessor iterator class.

The reason why we can't use a plain pointer as an interator and have to implement a custom class here is explained in section Ranged accessors of SYCL 2020 specification. A couple of quotes from there:

Accessors of type accessor and host_accessor can be constructed from a sub-range of a buffer by providing a range and offset to the constructor.

If the ranged accessor is multi-dimensional, the sub-range is allowed to describe a region of memory in the underlying buffer that is not contiguous in the linear address space.

Most of the accessor member functions which provide a reference to the underlying buffer elements are affected by a ranged accessor’s offset and range. ... In addition, the accessor’s iterator functions iterate only over the elements that are within the sub-range.

Definition in file accessor_iterator.hpp.