Skip to main content

class accessor<DataT, Dims, Mode, celerity::target::device>

Declaration

template <typename DataT, int Dims, access_mode Mode>
class accessor<DataT, Dims, Mode, celerity::target::device> { /* full declaration omitted */ };

Description

Celerity wrapper around SYCL accessors.

Template Parameters

DataT
int Dims
access_mode Mode

Member Variables

DataT* m_device_ptr = nullptr
id<Dims> m_allocation_offset
range<Dims> m_allocation_range = detail::zeros
detail::oob_bounding_box* m_oob_indices = nullptr
subrange<Dims> m_accessed_buffer_subrange = {}
DataT m_oob_fallback_value = type-parameter-0-0{}

Member Function Overview

  • accessor(accessor<DataT, Dims, Mode, celerity::target::device> &&) noexcept
  • template <typename Functor, access_mode TagMode, access_mode TagModeNoInit>
    accessor(const buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn, detail::access_tag<TagMode, TagModeNoInit, target::device>, const property_list &)
  • template <typename Functor, access_mode TagMode>
    accessor(const buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn, detail::access_tag<TagMode, Mode, target::device>, const property::no_init &)
  • template <typename Functor, access_mode TagModeNoInit>
    accessor(const buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn, detail::access_tag<Mode, TagModeNoInit, target::device>)
  • template <typename Functor>
    accessor(const buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn)
  • template <access_mode TagMode, access_mode TagModeNoInit, int D = Dims, std::enable_if_t<D == 0, int> = 0>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, detail::access_tag<TagMode, TagModeNoInit, target::device> tag, const property_list & prop_list)
  • template <access_mode TagMode, int D = Dims, std::enable_if_t<D == 0, int> = 0>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, detail::access_tag<TagMode, Mode, target::device> tag, const property::no_init & no_init)
  • template <access_mode TagModeNoInit, int D = Dims, std::enable_if_t<D == 0, int> = 0>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, detail::access_tag<Mode, TagModeNoInit, target::device> tag)
  • template <int D = Dims, std::enable_if_t<D == 0, int> = 0>
    accessor(buffer<DataT, Dims> & buff, handler & cgh)
  • template <typename Functor, access_mode TagMode>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn, detail::access_tag<TagMode, Mode, target::device>, const property::no_init &)
  • template <typename Functor>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn)
  • accessor(const accessor<DataT, Dims, Mode, celerity::target::device> & other)
  • accessor() noexcept
  • template <typename Functor, access_mode TagModeNoInit>
    accessor(buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn, detail::access_tag<Mode, TagModeNoInit, target::device>)
  • template <access_mode M = Mode, std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_producer(M), int> = 0>
    operator DataT &() const
  • template <access_mode M = Mode, std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_pure_consumer(M), int> = 0>
    operator const DataT &() const
  • template <access_mode M = Mode>
    operator*() const → std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_pure_consumer(M), const DataT &>
  • template <access_mode M = Mode>
    operator*() const → std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_producer(M), DataT &>
  • template <access_mode M = Mode>
    operator->() const → std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_pure_consumer(M), const DataT *>
  • template <access_mode M = Mode>
    operator->() const → std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_producer(M), DataT *>
  • template <int D = Dims, std::enable_if_t<D == 0, int> = 0>
    operator=(const DataT & other) const → const accessor<DataT, Dims, Mode, celerity::target::device> &
  • template <int D = Dims, std::enable_if_t<D == 0, int> = 0>
    operator=(DataT && other) const → const accessor<DataT, Dims, Mode, celerity::target::device> &
  • operator=(accessor<DataT, Dims, Mode, celerity::target::device> &&) noexcept → accessor<DataT, Dims, Mode, celerity::target::device> &
  • operator=(const accessor<DataT, Dims, Mode, celerity::target::device> & other) → accessor<DataT, Dims, Mode, celerity::target::device> &
  • template <access_mode M = Mode>
    operator[](const id<Dims> & index) const → std::conditional_t<detail::access::mode_traits::is_producer(M), DataT &, const DataT &>
  • template <int D = Dims, std::enable_if_t<(D > 0), int> = 0>
    operator[](size_t index) const → decltype(auto)
  • accessor(DataT * ptr, const id<Dims> & allocation_offset, const range<Dims> & allocation_range)
  • accessor(detail::hydration_id hid, const id<Dims> & allocation_offset, const range<Dims> & allocation_range)
  • template <typename Functor>
    accessor(ctor_internal_tag, const buffer<DataT, Dims> & buff, handler & cgh, const Functor & rmfn)
  • copy_and_hydrate(const accessor<DataT, Dims, Mode, celerity::target::device> & other) → void
  • get_linear_offset(const id<Dims> & index) const → size_t

Member Functions

accessor(
    accessor<DataT,
             Dims,
             Mode,
             celerity::target::device>&&) noexcept

Parameters

accessor<DataT, Dims, Mode, celerity::target::device>&&

template <typename Functor,
          access_mode TagMode,
          access_mode TagModeNoInit>
accessor(const buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn,
         detail::access_tag<TagMode,
                            TagModeNoInit,
                            target::device>,
         const property_list&)

Template Parameters

Functor
access_mode TagMode
access_mode TagModeNoInit

Parameters

const buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn
detail::access_tag<TagMode, TagModeNoInit, target::device>
const property_list&

template <typename Functor, access_mode TagMode>
accessor(const buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn,
         detail::access_tag<TagMode,
                            Mode,
                            target::device>,
         const property::no_init&)

Template Parameters

Functor
access_mode TagMode

Parameters

const buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn
detail::access_tag<TagMode, Mode, target::device>
const property::no_init&

template <typename Functor,
          access_mode TagModeNoInit>
accessor(const buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn,
         detail::access_tag<Mode,
                            TagModeNoInit,
                            target::device>)

Template Parameters

Functor
access_mode TagModeNoInit

Parameters

const buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn
detail::access_tag<Mode, TagModeNoInit, target::device>

template <typename Functor>
accessor(const buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn)

Template Parameters

Functor

Parameters

const buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn

template <access_mode TagMode,
          access_mode TagModeNoInit,
          int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         detail::access_tag<TagMode,
                            TagModeNoInit,
                            target::device> tag,
         const property_list& prop_list)

Template Parameters

access_mode TagMode
access_mode TagModeNoInit
int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

buffer<DataT, Dims>& buff
handler& cgh
detail::access_tag<TagMode, TagModeNoInit, target::device> tag
const property_list& prop_list

template <access_mode TagMode,
          int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         detail::access_tag<TagMode,
                            Mode,
                            target::device> tag,
         const property::no_init& no_init)

Template Parameters

access_mode TagMode
int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

buffer<DataT, Dims>& buff
handler& cgh
detail::access_tag<TagMode, Mode, target::device> tag
const property::no_init& no_init

template <access_mode TagModeNoInit,
          int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         detail::access_tag<Mode,
                            TagModeNoInit,
                            target::device> tag)

Template Parameters

access_mode TagModeNoInit
int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

buffer<DataT, Dims>& buff
handler& cgh
detail::access_tag<Mode, TagModeNoInit, target::device> tag

template <int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
accessor(buffer<DataT, Dims>& buff, handler& cgh)

Template Parameters

int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

buffer<DataT, Dims>& buff
handler& cgh

template <typename Functor, access_mode TagMode>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn,
         detail::access_tag<TagMode,
                            Mode,
                            target::device>,
         const property::no_init&)

Template Parameters

Functor
access_mode TagMode

Parameters

buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn
detail::access_tag<TagMode, Mode, target::device>
const property::no_init&

template <typename Functor>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn)

Template Parameters

Functor

Parameters

buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn

accessor(const accessor<DataT,
                        Dims,
                        Mode,
                        celerity::target::device>&
             other)

Parameters

const accessor<DataT, Dims, Mode, celerity::target::device>& other

accessor() noexcept


template <typename Functor,
          access_mode TagModeNoInit>
accessor(buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn,
         detail::access_tag<Mode,
                            TagModeNoInit,
                            target::device>)

Template Parameters

Functor
access_mode TagModeNoInit

Parameters

buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn
detail::access_tag<Mode, TagModeNoInit, target::device>

template <
    access_mode M = Mode,
    std::enable_if_t<
        Dims == 0 && detail::access::mode_traits::
                         is_producer(M),
        int> = 0>
inline operator DataT&() const

Template Parameters

access_mode M = Mode
std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_producer(M), int> = 0

template <
    access_mode M = Mode,
    std::enable_if_t<
        Dims == 0 && detail::access::mode_traits::
                         is_pure_consumer(M),
        int> = 0>
inline operator const DataT&() const

Template Parameters

access_mode M = Mode
std::enable_if_t<Dims == 0 && detail::access::mode_traits::is_pure_consumer(M), int> = 0

template <access_mode M = Mode>
inline std::enable_if_t<
    Dims == 0 && detail::access::mode_traits::
                     is_pure_consumer(M),
    const DataT&>
operator*() const

Template Parameters

access_mode M = Mode

template <access_mode M = Mode>
inline std::enable_if_t<
    Dims == 0 &&
        detail::access::mode_traits::is_producer(
            M),
    DataT&>
operator*() const

Template Parameters

access_mode M = Mode

template <access_mode M = Mode>
inline std::enable_if_t<
    Dims == 0 && detail::access::mode_traits::
                     is_pure_consumer(M),
    const DataT*>
operator->() const

Template Parameters

access_mode M = Mode

template <access_mode M = Mode>
inline std::enable_if_t<
    Dims == 0 &&
        detail::access::mode_traits::is_producer(
            M),
    DataT*>
operator->() const

Template Parameters

access_mode M = Mode

template <int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
const accessor<DataT,
               Dims,
               Mode,
               celerity::target::device>&
operator=(const DataT& other) const

Template Parameters

int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

const DataT& other

template <int D = Dims,
          std::enable_if_t<D == 0, int> = 0>
const accessor<DataT,
               Dims,
               Mode,
               celerity::target::device>&
operator=(DataT&& other) const

Template Parameters

int D = Dims
std::enable_if_t<D == 0, int> = 0

Parameters

DataT&& other

accessor<DataT,
         Dims,
         Mode,
         celerity::target::device>&
operator=(
    accessor<DataT,
             Dims,
             Mode,
             celerity::target::device>&&) noexcept

Parameters

accessor<DataT, Dims, Mode, celerity::target::device>&&

accessor<DataT,
         Dims,
         Mode,
         celerity::target::device>&
operator=(
    const accessor<DataT,
                   Dims,
                   Mode,
                   celerity::target::device>&
        other)

Parameters

const accessor<DataT, Dims, Mode, celerity::target::device>& other

template <access_mode M = Mode>
inline std::conditional_t<
    detail::access::mode_traits::is_producer(M),
    DataT&,
    const DataT&>
operator[](const id<Dims>& index) const

Template Parameters

access_mode M = Mode

Parameters

const id<Dims>& index

template <int D = Dims,
          std::enable_if_t<(D > 0), int> = 0>
inline decltype(auto) operator[](
    size_t index) const

Template Parameters

int D = Dims
std::enable_if_t<(D > 0), int> = 0

Parameters

size_t index

accessor(DataT* ptr,
         const id<Dims>& allocation_offset,
         const range<Dims>& allocation_range)

Parameters

DataT* ptr
const id<Dims>& allocation_offset
const range<Dims>& allocation_range

accessor(detail::hydration_id hid,
         const id<Dims>& allocation_offset,
         const range<Dims>& allocation_range)

Parameters

detail::hydration_id hid
const id<Dims>& allocation_offset
const range<Dims>& allocation_range

template <typename Functor>
accessor(ctor_internal_tag,
         const buffer<DataT, Dims>& buff,
         handler& cgh,
         const Functor& rmfn)

Template Parameters

Functor

Parameters

ctor_internal_tag
const buffer<DataT, Dims>& buff
handler& cgh
const Functor& rmfn

void copy_and_hydrate(
    const accessor<DataT,
                   Dims,
                   Mode,
                   celerity::target::device>&
        other)

Parameters

const accessor<DataT, Dims, Mode, celerity::target::device>& other

size_t get_linear_offset(
    const id<Dims>& index) const

Parameters

const id<Dims>& index