DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::span< _Tp, _Extent > Class Template Reference

#include <sycl/sycl_span.hpp>

Collaboration diagram for sycl::_V1::span< _Tp, _Extent >:

Public Types

using element_type = _Tp
 
using value_type = std::remove_cv_t< _Tp >
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
using pointer = _Tp *
 
using const_pointer = const _Tp *
 
using reference = _Tp &
 
using const_reference = const _Tp &
 
using iterator = pointer
 
using rev_iterator = std::reverse_iterator< pointer >
 

Public Member Functions

template<size_t _Sz = _Extent, std::enable_if_t< _Sz==0, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span () noexcept
 
constexpr span (const span &) noexcept=default
 
constexpr spanoperator= (const span &) noexcept=default
 
template<size_t _Sz = _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (element_type(&__arr)[_Sz])
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (pointer __ptr, size_type __count)
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (pointer __f, pointer __l)
 
template<class _OtherElementType , std::enable_if_t< std::is_convertible_v< _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (std::array< _OtherElementType, _Extent > &__arr) noexcept
 
template<class _OtherElementType , std::enable_if_t< std::is_convertible_v< const _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (const std::array< _OtherElementType, _Extent > &__arr) noexcept
 
template<class _Container >
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (_Container &__c, std::enable_if_t< __is_span_compatible_container< _Container, _Tp >::value, std::nullptr_t >=nullptr)
 
template<class _Container >
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (const _Container &__c, std::enable_if_t< __is_span_compatible_container< const _Container, _Tp >::value, std::nullptr_t >=nullptr)
 
template<class _OtherElementType >
constexpr _SYCL_SPAN_INLINE_VISIBILITY span (const span< _OtherElementType, _Extent > &__other, std::enable_if_t< std::is_convertible_v< _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t >=nullptr)
 
template<size_t _Count>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span< element_type, _Count > first () const noexcept
 
template<size_t _Count>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span< element_type, _Count > last () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY span< element_type, dynamic_extentfirst (size_type __count) const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY span< element_type, dynamic_extentlast (size_type __count) const noexcept
 
template<size_t _Offset, size_t _Count = dynamic_extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY auto subspan () const noexcept -> span< element_type,(_Count !=dynamic_extent ? _Count :_Extent - _Offset)>
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY span< element_type, dynamic_extentsubspan (size_type __offset, size_type __count=dynamic_extent) const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY size_type size () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY size_type size_bytes () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY bool empty () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference operator[] (size_type __idx) const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference front () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference back () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY pointer data () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY iterator begin () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY iterator end () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY rev_iterator rbegin () const noexcept
 
constexpr _SYCL_SPAN_INLINE_VISIBILITY rev_iterator rend () const noexcept
 
_SYCL_SPAN_INLINE_VISIBILITY span< const byte, _Extent *sizeof(element_type)> __as_bytes () const noexcept
 
_SYCL_SPAN_INLINE_VISIBILITY span< byte, _Extent *sizeof(element_type)> __as_writable_bytes () const noexcept
 

Static Public Attributes

static constexpr size_type extent = _Extent
 

Detailed Description

template<typename _Tp, size_t _Extent>
class sycl::_V1::span< _Tp, _Extent >

Definition at line 196 of file sycl_span.hpp.

Member Typedef Documentation

◆ const_pointer

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::const_pointer = const _Tp *

Definition at line 204 of file sycl_span.hpp.

◆ const_reference

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::const_reference = const _Tp &

Definition at line 206 of file sycl_span.hpp.

◆ difference_type

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::difference_type = ptrdiff_t

Definition at line 202 of file sycl_span.hpp.

◆ element_type

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::element_type = _Tp

Definition at line 199 of file sycl_span.hpp.

◆ iterator

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::iterator = pointer

Definition at line 207 of file sycl_span.hpp.

◆ pointer

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::pointer = _Tp *

Definition at line 203 of file sycl_span.hpp.

◆ reference

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::reference = _Tp &

Definition at line 205 of file sycl_span.hpp.

◆ rev_iterator

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::rev_iterator = std::reverse_iterator<pointer>

Definition at line 208 of file sycl_span.hpp.

◆ size_type

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::size_type = size_t

Definition at line 201 of file sycl_span.hpp.

◆ value_type

template<typename _Tp , size_t _Extent>
using sycl::_V1::span< _Tp, _Extent >::value_type = std::remove_cv_t<_Tp>

Definition at line 200 of file sycl_span.hpp.

Constructor & Destructor Documentation

◆ span() [1/10]

template<typename _Tp , size_t _Extent>
template<size_t _Sz = _Extent, std::enable_if_t< _Sz==0, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( )
inlineconstexprnoexcept

Definition at line 215 of file sycl_span.hpp.

◆ span() [2/10]

template<typename _Tp , size_t _Extent>
constexpr sycl::_V1::span< _Tp, _Extent >::span ( const span< _Tp, _Extent > &  )
constexprdefaultnoexcept

◆ span() [3/10]

template<typename _Tp , size_t _Extent>
template<size_t _Sz = _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( element_type(&)  __arr[_Sz])
inlineexplicitconstexpr

Definition at line 221 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ span() [4/10]

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( pointer  __ptr,
size_type  __count 
)
inlineexplicitconstexpr

Definition at line 229 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ span() [5/10]

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( pointer  __f,
pointer  __l 
)
inlineexplicitconstexpr

Definition at line 236 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ span() [6/10]

template<typename _Tp , size_t _Extent>
template<class _OtherElementType , std::enable_if_t< std::is_convertible_v< _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( std::array< _OtherElementType, _Extent > &  __arr)
inlineconstexprnoexcept

Definition at line 247 of file sycl_span.hpp.

◆ span() [7/10]

template<typename _Tp , size_t _Extent>
template<class _OtherElementType , std::enable_if_t< std::is_convertible_v< const _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t > = nullptr>
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( const std::array< _OtherElementType, _Extent > &  __arr)
inlineconstexprnoexcept

Definition at line 256 of file sycl_span.hpp.

◆ span() [8/10]

template<typename _Tp , size_t _Extent>
template<class _Container >
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( _Container &  __c,
std::enable_if_t< __is_span_compatible_container< _Container, _Tp >::value, std::nullptr_t >  = nullptr 
)
inlineexplicitconstexpr

Definition at line 261 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ span() [9/10]

template<typename _Tp , size_t _Extent>
template<class _Container >
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( const _Container &  __c,
std::enable_if_t< __is_span_compatible_container< const _Container, _Tp >::value, std::nullptr_t >  = nullptr 
)
inlineexplicitconstexpr

Definition at line 271 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ span() [10/10]

template<typename _Tp , size_t _Extent>
template<class _OtherElementType >
constexpr _SYCL_SPAN_INLINE_VISIBILITY sycl::_V1::span< _Tp, _Extent >::span ( const span< _OtherElementType, _Extent > &  __other,
std::enable_if_t< std::is_convertible_v< _OtherElementType(*)[], element_type(*)[]>, std::nullptr_t >  = nullptr 
)
inlineconstexpr

Definition at line 282 of file sycl_span.hpp.

Member Function Documentation

◆ __as_bytes()

template<typename _Tp , size_t _Extent>
_SYCL_SPAN_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> sycl::_V1::span< _Tp, _Extent >::__as_bytes ( ) const
inlinenoexcept

Definition at line 397 of file sycl_span.hpp.

◆ __as_writable_bytes()

template<typename _Tp , size_t _Extent>
_SYCL_SPAN_INLINE_VISIBILITY span<byte, _Extent * sizeof(element_type)> sycl::_V1::span< _Tp, _Extent >::__as_writable_bytes ( ) const
inlinenoexcept

Definition at line 403 of file sycl_span.hpp.

◆ back()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference sycl::_V1::span< _Tp, _Extent >::back ( ) const
inlineconstexprnoexcept

Definition at line 373 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ begin()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY iterator sycl::_V1::span< _Tp, _Extent >::begin ( ) const
inlineconstexprnoexcept

Definition at line 383 of file sycl_span.hpp.

◆ data()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY pointer sycl::_V1::span< _Tp, _Extent >::data ( ) const
inlineconstexprnoexcept

Definition at line 378 of file sycl_span.hpp.

Referenced by sycl::_V1::span< _Tp, dynamic_extent >::span().

◆ empty()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY bool sycl::_V1::span< _Tp, _Extent >::empty ( ) const
inlineconstexprnoexcept

Definition at line 358 of file sycl_span.hpp.

◆ end()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY iterator sycl::_V1::span< _Tp, _Extent >::end ( ) const
inlineconstexprnoexcept

Definition at line 386 of file sycl_span.hpp.

◆ first() [1/2]

template<typename _Tp , size_t _Extent>
template<size_t _Count>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span<element_type, _Count> sycl::_V1::span< _Tp, _Extent >::first ( ) const
inlineconstexprnoexcept

Definition at line 293 of file sycl_span.hpp.

◆ first() [2/2]

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span<element_type, dynamic_extent> sycl::_V1::span< _Tp, _Extent >::first ( size_type  __count) const
inlineconstexprnoexcept

Definition at line 307 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ front()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference sycl::_V1::span< _Tp, _Extent >::front ( ) const
inlineconstexprnoexcept

Definition at line 368 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ last() [1/2]

template<typename _Tp , size_t _Extent>
template<size_t _Count>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span<element_type, _Count> sycl::_V1::span< _Tp, _Extent >::last ( ) const
inlineconstexprnoexcept

Definition at line 300 of file sycl_span.hpp.

◆ last() [2/2]

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span<element_type, dynamic_extent> sycl::_V1::span< _Tp, _Extent >::last ( size_type  __count) const
inlineconstexprnoexcept

Definition at line 315 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ operator=()

template<typename _Tp , size_t _Extent>
constexpr span& sycl::_V1::span< _Tp, _Extent >::operator= ( const span< _Tp, _Extent > &  )
constexprdefaultnoexcept

◆ operator[]()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY reference sycl::_V1::span< _Tp, _Extent >::operator[] ( size_type  __idx) const
inlineconstexprnoexcept

Definition at line 363 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT.

◆ rbegin()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY rev_iterator sycl::_V1::span< _Tp, _Extent >::rbegin ( ) const
inlineconstexprnoexcept

Definition at line 389 of file sycl_span.hpp.

◆ rend()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY rev_iterator sycl::_V1::span< _Tp, _Extent >::rend ( ) const
inlineconstexprnoexcept

Definition at line 392 of file sycl_span.hpp.

◆ size()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY size_type sycl::_V1::span< _Tp, _Extent >::size ( ) const
inlineconstexprnoexcept

Definition at line 352 of file sycl_span.hpp.

◆ size_bytes()

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY size_type sycl::_V1::span< _Tp, _Extent >::size_bytes ( ) const
inlineconstexprnoexcept

Definition at line 355 of file sycl_span.hpp.

◆ subspan() [1/2]

template<typename _Tp , size_t _Extent>
template<size_t _Offset, size_t _Count = dynamic_extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY auto sycl::_V1::span< _Tp, _Extent >::subspan ( ) const -> span<element_type, (_Count != dynamic_extent ? _Count : _Extent - _Offset)>
inlineconstexprnoexcept

Definition at line 322 of file sycl_span.hpp.

References sycl::_V1::dynamic_extent.

◆ subspan() [2/2]

template<typename _Tp , size_t _Extent>
constexpr _SYCL_SPAN_INLINE_VISIBILITY span<element_type, dynamic_extent> sycl::_V1::span< _Tp, _Extent >::subspan ( size_type  __offset,
size_type  __count = dynamic_extent 
) const
inlineconstexprnoexcept

Definition at line 338 of file sycl_span.hpp.

References _SYCL_SPAN_ASSERT, and sycl::_V1::dynamic_extent.

Member Data Documentation

◆ extent

template<typename _Tp , size_t _Extent>
constexpr size_type sycl::_V1::span< _Tp, _Extent >::extent = _Extent
staticconstexpr

Definition at line 210 of file sycl_span.hpp.


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