DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder > Class Template Reference

Local accessor. More...

#include <CL/sycl/accessor.hpp>

Inheritance diagram for cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >:
Collaboration diagram for cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >:

Public Types

using value_type = DataT
 
using reference = DataT &
 
using const_reference = const DataT &
 

Public Member Functions

template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0>>
 accessor (handler &, const detail::code_location CodeLoc=detail::code_location::current())
 
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0>>
 accessor (handler &, const property_list &propList, const detail::code_location CodeLoc=detail::code_location::current())
 
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
 accessor (range< Dimensions > AllocationSize, handler &, const detail::code_location CodeLoc=detail::code_location::current())
 
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
 accessor (range< Dimensions > AllocationSize, handler &, const property_list &propList, const detail::code_location CodeLoc=detail::code_location::current())
 
size_t get_size () const
 
 __SYCL2020_DEPRECATED ("get_count() is deprecated, please use size() instead") size_t get_count() const
 
size_t size () const noexcept
 
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
range< Dims > get_range () const
 
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0 && IsAccessAnyWrite>>
 operator RefType () const
 
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0) && IsAccessAnyWrite>>
RefType operator[] (id< Dimensions > Index) const
 
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 1 && IsAccessAnyWrite>>
RefType operator[] (size_t Index) const
 
template<int Dims = Dimensions>
 operator typename detail::enable_if_t< Dims==0 &&AccessMode==access::mode::atomic, atomic< DataT, AS >> () const
 
template<int Dims = Dimensions>
detail::enable_if_t<(Dims > 0) &&AccessMode==access::mode::atomic, atomic< DataT, AS > > operator[] (id< Dimensions > Index) const
 
template<int Dims = Dimensions>
detail::enable_if_t< Dims==1 &&AccessMode==access::mode::atomic, atomic< DataT, AS > > operator[] (size_t Index) const
 
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 1)>>
AccessorCommonT::template AccessorSubscript< Dims - 1 > operator[] (size_t Index) const
 
local_ptr< DataT > get_pointer () const
 
bool operator== (const accessor &Rhs) const
 
bool operator!= (const accessor &Rhs) const
 
- Public Member Functions inherited from cl::sycl::detail::LocalAccessorBaseHost
 LocalAccessorBaseHost (sycl::range< 3 > Size, int Dims, int ElemSize)
 
sycl::range< 3 > & getSize ()
 
const sycl::range< 3 > & getSize () const
 
void * getPtr ()
 
void * getPtr () const
 
int getNumOfDims ()
 
int getElementSize ()
 

Protected Types

using AccessorCommonT = detail::accessor_common< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >
 
template<int Dims>
using AccessorSubscript = typename AccessorCommonT::template AccessorSubscript< Dims >
 
using ConcreteASPtrType = typename detail::DecoratedType< DataT, AS >::type *
 
using RefType = detail::const_if_const_AS< AS, DataT > &
 
using PtrType = detail::const_if_const_AS< AS, DataT > *
 
- Protected Types inherited from cl::sycl::detail::accessor_common< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >
using RefType = detail::const_if_const_AS< AS, DataT > &
 
using ConstRefType = const DataT &
 
using PtrType = detail::const_if_const_AS< AS, DataT > *
 
using AccType = accessor< DataT, Dimensions, AccessMode, AccessTarget, IsPlaceholder, ext::oneapi::accessor_property_list<> >
 

Protected Member Functions

PtrType getQualifiedPtr () const
 
template<int Dims = AdjustedDim>
size_t getLinearIndex (id< Dims > Id) const
 
- Protected Member Functions inherited from cl::sycl::detail::LocalAccessorBaseHost
template<class Obj >
decltype(Obj::impl) friend getSyclObjImpl (const Obj &SyclObject)
 

Protected Attributes

char padding [sizeof(detail::LocalAccessorBaseDevice< AdjustedDim >)+sizeof(PtrType) - sizeof(detail::LocalAccessorBaseHost)]
 
- Protected Attributes inherited from cl::sycl::detail::LocalAccessorBaseHost
std::shared_ptr< LocalAccessorImplHostimpl
 

Static Protected Attributes

constexpr static int AdjustedDim = Dimensions == 0 ? 1 : Dimensions
 
- Static Protected Attributes inherited from cl::sycl::detail::accessor_common< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >
constexpr static bool IsPlaceH
 
constexpr static access::address_space AS
 
constexpr static bool IsHostBuf
 
constexpr static bool IsGlobalBuf
 
constexpr static bool IsConstantBuf
 
constexpr static bool IsAccessAnyWrite
 
constexpr static bool IsAccessReadOnly
 
constexpr static bool IsAccessReadWrite
 
constexpr static bool IsAccessAtomic
 

Detailed Description

template<typename DataT, int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
class cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >

Local accessor.

Definition at line 2018 of file accessor.hpp.

Member Typedef Documentation

◆ AccessorCommonT

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::AccessorCommonT = detail::accessor_common<DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder>
protected

Definition at line 2030 of file accessor.hpp.

◆ AccessorSubscript

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::AccessorSubscript = typename AccessorCommonT::template AccessorSubscript<Dims>
protected

Definition at line 2036 of file accessor.hpp.

◆ ConcreteASPtrType

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::ConcreteASPtrType = typename detail::DecoratedType<DataT, AS>::type *
protected

Definition at line 2038 of file accessor.hpp.

◆ const_reference

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::const_reference = const DataT &

Definition at line 2090 of file accessor.hpp.

◆ PtrType

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::PtrType = detail::const_if_const_AS<AS, DataT> *
protected

Definition at line 2041 of file accessor.hpp.

◆ reference

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::reference = DataT &

Definition at line 2089 of file accessor.hpp.

◆ RefType

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::RefType = detail::const_if_const_AS<AS, DataT> &
protected

Definition at line 2040 of file accessor.hpp.

◆ value_type

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
using cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::value_type = DataT

Definition at line 2088 of file accessor.hpp.

Constructor & Destructor Documentation

◆ accessor() [1/4]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0>>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::accessor ( handler ,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Definition at line 2093 of file accessor.hpp.

◆ accessor() [2/4]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0>>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::accessor ( handler ,
const property_list propList,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Definition at line 2106 of file accessor.hpp.

◆ accessor() [3/4]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::accessor ( range< Dimensions AllocationSize,
handler ,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Definition at line 2122 of file accessor.hpp.

◆ accessor() [4/4]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::accessor ( range< Dimensions AllocationSize,
handler ,
const property_list propList,
const detail::code_location  CodeLoc = detail::code_location::current() 
)
inline

Definition at line 2137 of file accessor.hpp.

Member Function Documentation

◆ __SYCL2020_DEPRECATED()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::__SYCL2020_DEPRECATED ( "get_count() is  deprecated,
please use size() instead  
) const
inline

Definition at line 2156 of file accessor.hpp.

◆ get_pointer()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
local_ptr<DataT> cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::get_pointer ( ) const
inline

Definition at line 2213 of file accessor.hpp.

◆ get_range()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0)>>
range<Dims> cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::get_range ( ) const
inline

Definition at line 2161 of file accessor.hpp.

◆ get_size()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
size_t cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::get_size ( ) const
inline

Definition at line 2154 of file accessor.hpp.

◆ getLinearIndex()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = AdjustedDim>
size_t cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::getLinearIndex ( id< Dims >  Id) const
inlineprotected

Definition at line 2080 of file accessor.hpp.

◆ getQualifiedPtr()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
PtrType cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::getQualifiedPtr ( ) const
inlineprotected

Definition at line 2073 of file accessor.hpp.

◆ operator RefType()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 0 && IsAccessAnyWrite>>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator RefType ( ) const
inline

Definition at line 2167 of file accessor.hpp.

◆ operator typename detail::enable_if_t< Dims==0 &&AccessMode==access::mode::atomic, atomic< DataT, AS >>()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions>
cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator typename detail::enable_if_t< Dims==0 &&AccessMode==access::mode::atomic, atomic< DataT, AS >> ( ) const
inline

Definition at line 2186 of file accessor.hpp.

◆ operator!=()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
bool cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator!= ( const accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder > &  Rhs) const
inline

Definition at line 2218 of file accessor.hpp.

◆ operator==()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
bool cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator== ( const accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder > &  Rhs) const
inline

Definition at line 2217 of file accessor.hpp.

◆ operator[]() [1/5]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 0) && IsAccessAnyWrite>>
RefType cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator[] ( id< Dimensions Index) const
inline

Definition at line 2173 of file accessor.hpp.

References cl::sycl::detail::getLinearIndex().

◆ operator[]() [2/5]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions>
detail::enable_if_t<(Dims > 0) && AccessMode == access::mode::atomic, atomic<DataT, AS> > cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator[] ( id< Dimensions Index) const
inline

Definition at line 2194 of file accessor.hpp.

References cl::sycl::detail::getLinearIndex().

◆ operator[]() [3/5]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<Dims == 1 && IsAccessAnyWrite>>
RefType cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator[] ( size_t  Index) const
inline

Definition at line 2180 of file accessor.hpp.

◆ operator[]() [4/5]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions>
detail::enable_if_t<Dims == 1 && AccessMode == access::mode::atomic, atomic<DataT, AS> > cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator[] ( size_t  Index) const
inline

Definition at line 2203 of file accessor.hpp.

◆ operator[]() [5/5]

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
template<int Dims = Dimensions, typename = detail::enable_if_t<(Dims > 1)>>
AccessorCommonT::template AccessorSubscript<Dims - 1> cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::operator[] ( size_t  Index) const
inline

Definition at line 2209 of file accessor.hpp.

◆ size()

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
size_t cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::size ( ) const
inlinenoexcept

Definition at line 2158 of file accessor.hpp.

Member Data Documentation

◆ AdjustedDim

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
constexpr static int cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::AdjustedDim = Dimensions == 0 ? 1 : Dimensions
staticconstexprprotected

Definition at line 2026 of file accessor.hpp.

◆ padding

template<typename DataT , int Dimensions, access::mode AccessMode, access::placeholder IsPlaceholder>
char cl::sycl::accessor< DataT, Dimensions, AccessMode, access::target::local, IsPlaceholder >::padding[sizeof(detail::LocalAccessorBaseDevice< AdjustedDim >)+ sizeof(PtrType) - sizeof(detail::LocalAccessorBaseHost)]
protected

Definition at line 2070 of file accessor.hpp.


The documentation for this class was generated from the following file: