DPC++ Runtime
Runtime libraries for oneAPI DPC++
accessor_iterator.hpp File Reference

The file contains implementation of accessor iterator class. More...

#include <sycl/access/access.hpp>
#include <sycl/buffer.hpp>
#include <sycl/id.hpp>
#include <cstddef>
#include <iterator>
#include <ostream>
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.

Classes

class  sycl::_V1::detail::accessor_iterator< DataT, Dimensions >
 

Namespaces

 sycl
 
 sycl::_V1
 
 sycl::_V1::detail
 

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 4.7.6.8. 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.