The file contains implementations of accessor class. More...
#include <sycl/access/access.hpp>
#include <sycl/aliases.hpp>
#include <sycl/aspects.hpp>
#include <sycl/atomic.hpp>
#include <sycl/buffer.hpp>
#include <sycl/detail/accessor_iterator.hpp>
#include <sycl/detail/common.hpp>
#include <sycl/detail/defines.hpp>
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/export.hpp>
#include <sycl/detail/generic_type_traits.hpp>
#include <sycl/detail/handler_proxy.hpp>
#include <sycl/detail/helpers.hpp>
#include <sycl/detail/owner_less_base.hpp>
#include <sycl/detail/property_helper.hpp>
#include <sycl/detail/property_list_base.hpp>
#include <sycl/detail/type_list.hpp>
#include <sycl/detail/type_traits.hpp>
#include <sycl/exception.hpp>
#include <sycl/ext/oneapi/accessor_property_list.hpp>
#include <sycl/ext/oneapi/weak_object_base.hpp>
#include <sycl/id.hpp>
#include <sycl/multi_ptr.hpp>
#include <sycl/pointers.hpp>
#include <sycl/properties/accessor_properties.hpp>
#include <sycl/properties/buffer_properties.hpp>
#include <sycl/property_list.hpp>
#include <sycl/range.hpp>
#include <sycl/sampler.hpp>
#include <ur_api.h>
#include <cstddef>
#include <functional>
#include <iterator>
#include <limits>
#include <memory>
#include <optional>
#include <stdint.h>
#include <tuple>
#include <type_traits>
#include <typeinfo>
#include <variant>
Go to the source code of this file.
Namespaces | |
sycl | |
sycl::_V1 | |
sycl::_V1::ext | |
sycl::_V1::ext::intel | |
sycl::_V1::ext::intel::esimd | |
sycl::_V1::ext::intel::esimd::detail | |
sycl::_V1::detail | |
std | |
Typedefs | |
template<typename T > | |
using | sycl::_V1::detail::IsPropertyListT = typename std::is_base_of< PropertyListBase, T > |
template<typename T > | |
using | sycl::_V1::detail::IsRunTimePropertyListT = typename std::is_same< ext::oneapi::accessor_property_list<>, T > |
using | sycl::_V1::detail::AccessorImplPtr = std::shared_ptr< AccessorImplHost > |
using | sycl::_V1::detail::LocalAccessorImplPtr = std::shared_ptr< LocalAccessorImplHost > |
Functions | |
void | sycl::_V1::detail::constructorNotification (void *BufferObj, void *AccessorObj, access::target Target, access::mode Mode, const code_location &CodeLoc) |
template<typename BufferT > | |
sycl::range< 1 > | sycl::_V1::detail::GetZeroDimAccessRange (BufferT Buffer) |
device | sycl::_V1::detail::getDeviceFromHandler (handler &CommandGroupHandlerRef) |
template<typename DataT > | |
constexpr access::mode | sycl::_V1::detail::accessModeFromConstness () |
template<typename MayBeTag1 , typename MayBeTag2 > | |
constexpr access::mode | sycl::_V1::detail::deduceAccessMode () |
template<typename MayBeTag1 , typename MayBeTag2 > | |
constexpr access::target | sycl::_V1::detail::deduceAccessTarget (access::target defaultTarget) |
void | sycl::_V1::detail::addHostAccessorAndWait (AccessorImplHost *Req) |
template<typename DataT , int Dimensions, typename AllocatorT > | |
class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor | sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::true_t > |
Buffer accessor. More... | |
template<typename DataT , int Dimensions, typename AllocatorT , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::true_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type1 >(), detail::deduceAccessTarget< Type1, Type1 >(target::device), access::placeholder::true_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type1 >(), detail::deduceAccessTarget< Type1, Type1 >(target::device), access::placeholder::true_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type2 >(), detail::deduceAccessTarget< Type1, Type2 >(target::device), access::placeholder::true_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type2 >(), detail::deduceAccessTarget< Type1, Type2 >(target::device), access::placeholder::true_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type2, Type3 >(), detail::deduceAccessTarget< Type2, Type3 >(target::device), access::placeholder::true_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type2, Type3 >(), detail::deduceAccessTarget< Type2, Type3 >(target::device), access::placeholder::true_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3, Type4) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >(), detail::deduceAccessTarget< Type3, Type4 >(target::device), access::placeholder::true_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3, Type4, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >(), detail::deduceAccessTarget< Type3, Type4 >(target::device), access::placeholder::true_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::false_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, access::mode::read_write, target::device, access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type1 >(), detail::deduceAccessTarget< Type1, Type1 >(target::device), access::placeholder::false_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type1 >(), detail::deduceAccessTarget< Type1, Type1 >(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type2 >(), detail::deduceAccessTarget< Type1, Type2 >(target::device), access::placeholder::false_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type2 >(), detail::deduceAccessTarget< Type1, Type2 >(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, Type3) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type2, Type3 >(), detail::deduceAccessTarget< Type2, Type3 >(target::device), access::placeholder::false_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, Type3, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type2, Type3 >(), detail::deduceAccessTarget< Type2, Type3 >(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 > | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, Type3, Type4) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >(), detail::deduceAccessTarget< Type3, Type4 >(target::device), access::placeholder::false_t > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 , typename... PropsT> | |
sycl::_V1::accessor (buffer< DataT, Dimensions, AllocatorT >, handler &, Type1, Type2, Type3, Type4, const ext::oneapi::accessor_property_list< PropsT... > &) -> accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >(), detail::deduceAccessTarget< Type3, Type4 >(target::device), access::placeholder::false_t, ext::oneapi::accessor_property_list< PropsT... >> | |
template<typename DataT , int Dimensions, typename AllocatorT > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >) -> host_accessor< DataT, Dimensions, access::mode::read_write > | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >, Type1) -> host_accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type1 >()> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2) -> host_accessor< DataT, Dimensions, detail::deduceAccessMode< Type1, Type2 >()> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3) -> host_accessor< DataT, Dimensions, detail::deduceAccessMode< Type2, Type3 >()> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3, Type4) -> host_accessor< DataT, Dimensions, detail::deduceAccessMode< Type3, Type4 >()> | |
template<typename DataT , int Dimensions, typename AllocatorT , typename Type1 , typename Type2 , typename Type3 , typename Type4 , typename Type5 > | |
sycl::_V1::host_accessor (buffer< DataT, Dimensions, AllocatorT >, Type1, Type2, Type3, Type4, Type5) -> host_accessor< DataT, Dimensions, detail::deduceAccessMode< Type4, Type5 >()> | |
The file contains implementations of accessor class.
For device side AccessorImplHost/LocalAccessorImplHost are fileds of accessor(1) and accessor(3).
For host side AccessorBaseHost/LocalAccessorBaseHost contains shared_ptr which points to AccessorImplHost/LocalAccessorImplHost object.
Objects of accessor class define a requirement to access some SYCL memory object or local memory of the device.
Basically there are 3 distinct types of accessors.
One of them is an accessor to a SYCL buffer object(Buffer accessor) which has the richest interface. It supports things like accessing only a part of buffer, multidimensional access using sycl::id, conversions to various multi_ptr and atomic classes.
Second type is an accessor to a SYCL image object(Image accessor) which has "image" specific methods for reading and writing.
Finally, accessor to local memory(Local accessor) doesn't require access to any SYCL memory object, but asks for some local memory on device to be available. Some methods overlap with ones that "Buffer accessor" provides.
Buffer and Image accessors create the requirement to access some SYCL memory object(or part of it). SYCL RT must detect when two kernels want to access the same memory objects and make sure they are executed in correct order.
"accessor_common" class that contains several common methods between Buffer and Local accessors.
Accessors have different representation on host and on device. On host they have non-templated base class, that is needed to safely work with any accessor type. Furhermore on host we need some additional fields in order to implement functionality required by Specification, for example during lifetime of a host accessor other operations with memory object the accessor refers to should be blocked and when all references to the host accessor are desctructed, the memory this host accessor refers to should be "written back".
The scheme of inheritance for host side:
The scheme of inheritance for device side:
accessor(1) declares accessor as a template class and implements accessor class for access targets: host_buffer, global_buffer and constant_buffer.
accessor(3) specializes accessor(1) for the local access target.
image_accessor contains implements interfaces for access targets: host_image, image and image_array. But there are three distinct specializations of the accessor(1) (accessor(2), accessor(4), accessor(5)) that are just inherited from image_accessor.
accessor_common contains several helpers common for both accessor(1) and accessor(3)
Definition in file accessor.hpp.