DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy > Class Template Reference

This class represents a reference to a sub-region of a base simd object. More...

#include <sycl/ext/intel/esimd/simd_view.hpp>

Inheritance diagram for sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >:
Collaboration diagram for sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >:

Public Types

using region_type = RegionTy
 The region type of this class. More...
 
using element_type = typename ShapeTy::element_type
 The element type of this class, which could be different from the element type of the base object type. More...
 
using value_type = get_simd_t< element_type, length >
 The simd type if reading the object. More...
 
using raw_vector_type = detail::vector_type_t< detail::__raw_t< element_type >, length >
 The underlying builtin value type. More...
 
- Public Types inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, region1d_t< typename BaseTy::element_type, BaseTy::length, 1 > >
using Derived = simd_view< BaseTy, region1d_t< typename BaseTy::element_type, BaseTy::length, 1 > >
 The only type which is supposed to extend this one and be used in user code. More...
 
using element_type = typename ShapeTy::element_type
 Element type of this view, may differ from the element type of the target object. More...
 
using raw_element_type = __raw_t< element_type >
 Corresponding "raw" (storage) type for the element type. More...
 
using value_type = get_simd_t< element_type, length >
 The simd type of the viewed region of the target object. More...
 
using raw_vector_type = vector_type_t< __raw_t< element_type >, length >
 The underlying builtin vector type of the the viewed region. More...
 

Public Member Functions

 simd_view (const simd_view &Other)=default
 Default copy and move constructors for simd_view. More...
 
 simd_view (simd_view &&Other)=default
 
 simd_view (BaseTy &Base)
 Construct a complete view of a vector. More...
 
simd_viewoperator= (const simd_view &Other)
 Copy assignment operator. More...
 
- Public Member Functions inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, region1d_t< typename BaseTy::element_type, BaseTy::length, 1 > >
 simd_view_impl (const simd_view_impl &Other)=default
 Default copy constructor. More...
 
 simd_view_impl (simd_view_impl &&Other)=default
 Default move constructor. More...
 
 operator simd< ToTy, length > () const
 Implicit conversion to a simd object with potentially different element type. More...
 
 operator simd_mask_type< length > () const
 Implicit conversion to a simd_mask object. More...
 
constexpr uint16_t getOffsetX () const
 Get the offset of the first element of the view within the parent object along X dimension. More...
 
constexpr uint16_t getOffsetY () const
 Get the offset of the first element of the view within the parent object along Y dimension. More...
 
value_type read () const
 Reads the viewed region from the target w/o any conversion and returns as an object of the value_type type. More...
 
value_type::raw_vector_type data () const
 
Derivedwrite (const value_type &Val)
 Assigns a new value to the viewed target's region. More...
 
void merge (const value_type &Val, const simd_mask_type< length > &Mask)
 "Merges" the viewed target's region with given value according to a per-element mask. More...
 
void merge (const value_type &Val1, value_type Val2, const simd_mask_type< length > &Mask)
 "Merges" given values according to a per-element mask and writes the result to the viewed target's region. More...
 
auto bit_cast_view ()
 Create a 1-dimensional view of the target region. More...
 
auto bit_cast_view ()
 Create a 2-dimensional view of the target region. More...
 
auto select (uint16_t Offset=0)
 1D region select. More...
 
auto select (uint16_t OffsetY=0, uint16_t OffsetX=0)
 2D region select. More...
 
Derivedoperator^= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator^= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator^= (T1 RHS)
 
Derivedoperator|= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator|= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator|= (T1 RHS)
 
Derivedoperator&= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator&= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator&= (T1 RHS)
 
Derivedoperator%= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator%= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator%= (T1 RHS)
 
Derivedoperator<<= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator<<= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator<<= (T1 RHS)
 
Derivedoperator>>= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator>>= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator>>= (T1 RHS)
 
Derivedoperator+= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator+= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator+= (T1 RHS)
 
Derivedoperator-= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator-= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator-= (T1 RHS)
 
Derivedoperator*= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator*= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator*= (T1 RHS)
 
Derivedoperator/= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
Derivedoperator/= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
Derivedoperator/= (T1 RHS)
 
auto operator! ()
 Unary logical negeation operator. Applies only to integer element types. More...
 
simd_view_imploperator= (const simd_view_impl &Other)
 Copy assignment. More...
 
Derivedoperator= (const Derived &Other)
 Assignment from an object of the derived class. More...
 
Derivedoperator= (const value_type &Val)
 Assignment from a value_type object - simd or simd_mask. More...
 
Derivedoperator= (Derived &&Other)
 Assignment from an rvalue object of the derived class. More...
 
simd_view_imploperator= (simd_view_impl &&Other)
 Move assignment operator. Updates the target region viewed by this object. More...
 
Derivedoperator= (const simd_obj_impl< T, N, SimdT > &Other)
 Assignment with element type conversion from a vector object. More...
 
Derivedoperator= (T1 RHS)
 Broadcast assignment of a scalar with conversion. More...
 
Derivedoperator++ ()
 Prefix increment. More...
 
value_type operator++ (int)
 Postfix increment. More...
 
Derivedoperator-- ()
 Prefix decrement. More...
 
value_type operator-- (int)
 Postfix decrement. More...
 
auto row (int i)
 Reference a row from a 2D region. More...
 
auto column (int i)
 Reference a column from a 2D region. More...
 
element_type operator[] (int i) const
 Read a single element from the target 1D region. More...
 
auto operator[] (int i)
 Return a writeable view of a single element in the target 1D region. More...
 
get_simd_t< element_type, Rep > replicate ()
 Applies simd_obj_impl::replicate to the target region. More...
 
get_simd_t< element_type, Rep *W > replicate_w (uint16_t OffsetX)
 Shortcut to replicate_vs_w<int Rep, int Vs, int W>(uint16_t) with with Vs = 0. More...
 
get_simd_t< element_type, Rep *W > replicate_w (uint16_t OffsetY, uint16_t OffsetX)
 Shortcut to replicate_vs_w<int Rep, int Vs, int W>(uint16_t, uint16_t) with Vs = 0. More...
 
get_simd_t< element_type, Rep *W > replicate_vs_w (uint16_t OffsetX)
 Shortcut to replicate_vs_w_hs<int Rep, int VS, int W, int Hs>(uint16_t OffsetY, uint16_t OffsetX) with Hs = 1 and OffsetY = 0. More...
 
get_simd_t< element_type, Rep *W > replicate_vs_w (uint16_t OffsetY, uint16_t OffsetX)
 Shortcut to replicate_vs_w_hs<int Rep, int VS, int W, int Hs>(uint16_t OffsetY, uint16_t OffsetX) with Hs = 1. More...
 
get_simd_t< element_type, Rep *W > replicate_vs_w_hs (uint16_t OffsetX)
 Applies simd_obj_impl::replicate_vs_w_hs<int Rep, int VS, int W, int HS> to the target region. More...
 
get_simd_t< element_type, Rep *W > replicate_vs_w_hs (uint16_t OffsetY, uint16_t OffsetX)
 Applies simd_obj_impl::replicate_vs_w_hs<int Rep, int VS, int W, int HS> to the target region. More...
 
uint16_t any ()
 Applies simd_obj_impl::any operation to the target region. More...
 
uint16_t all ()
 Applies simd_obj_impl::all operation to the target region. More...
 

Static Public Attributes

static constexpr int length = ShapeTy::Size_x * ShapeTy::Size_y
 

Additional Inherited Members

- Static Public Member Functions inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, region1d_t< typename BaseTy::element_type, BaseTy::length, 1 > >
static constexpr bool is1D ()
 Tells whether this view is 1-dimensional. More...
 
static constexpr bool is2D ()
 Tells whether this view is 2-dimensional. More...
 
static constexpr int getSizeX ()
 Get number of elements in the view along X dimension. More...
 
static constexpr int getStrideX ()
 Get element stride of the view along X dimension. More...
 
static constexpr int getSizeY ()
 Get number of elements in the view along Y dimension. More...
 
static constexpr int getStrideY ()
 Get element stride of the view along Y dimension. More...
 

Detailed Description

template<typename BaseTy, typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
class sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >

This class represents a reference to a sub-region of a base simd object.

The referenced sub-region of the base object can be read from and written to via an instance of this class. Derives from detail::simd_view_impl, which defines the majority of available APIs for view classes.

User code is never supposed to explicitly provide actual template parameters for this class. They are always auto-deduced or provided by APIs.

Template Parameters
BaseTyThe base type - type of the object viewed by this one.
RegionTyDescribes the viewed region - its shape and element type. Regions can be 1D and 2D.

Definition at line 37 of file simd_view.hpp.

Member Typedef Documentation

◆ element_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::element_type = typename ShapeTy::element_type

The element type of this class, which could be different from the element type of the base object type.

Definition at line 64 of file simd_view.hpp.

◆ raw_vector_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::raw_vector_type = detail::vector_type_t<detail::__raw_t<element_type>, length>

The underlying builtin value type.

Definition at line 70 of file simd_view.hpp.

◆ region_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::region_type = RegionTy

The region type of this class.

Definition at line 60 of file simd_view.hpp.

◆ value_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::value_type = get_simd_t<element_type, length>

The simd type if reading the object.

Definition at line 67 of file simd_view.hpp.

Constructor & Destructor Documentation

◆ simd_view() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::simd_view ( const simd_view< BaseTy, RegionTy > &  Other)
default

Default copy and move constructors for simd_view.

◆ simd_view() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::simd_view ( simd_view< BaseTy, RegionTy > &&  Other)
default

◆ simd_view() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::simd_view ( BaseTy &  Base)
inline

Construct a complete view of a vector.

Parameters
BaseThe vector to construct a view of.

Definition at line 86 of file simd_view.hpp.

Member Function Documentation

◆ operator=()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
simd_view& sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::operator= ( const simd_view< BaseTy, RegionTy > &  Other)
inline

Copy assignment operator.

Definition at line 89 of file simd_view.hpp.

Member Data Documentation

◆ length

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
constexpr int sycl::_V1::ext::intel::esimd::simd_view< BaseTy, RegionTy >::length = ShapeTy::Size_x * ShapeTy::Size_y
staticconstexpr

Definition at line 57 of file simd_view.hpp.


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