DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > > Class Template Reference

This is a specialization of nested simd_view class with a single element. More...

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

Inheritance diagram for sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >:
Collaboration diagram for sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >:

Public Types

using RegionTy = std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion >
 
using BaseClass = detail::simd_view_impl< BaseTy, RegionTy >
 
using ShapeTy = typename shape_type< RegionTy >::type
 
using element_type = ViewedElemT
 The element type of this class, which could be different from the element type of the base object type. More...
 
- Public Types inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >
using Derived = simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >
 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

 operator element_type () const
 
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...
 
template<class T , int N, class SimdT , class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<BaseTy>)&&(length == SimdT::length)>>
Derivedoperator= (const simd_obj_impl< T, N, SimdT > &Other)
 Assignment with element type conversion from a vector object. More...
 
template<class T1 , class = std::enable_if_t<is_valid_simd_elem_type_v<T1>>>
Derivedoperator= (T1 RHS)
 Broadcast assignment of a scalar with conversion. More...
 
- Public Member Functions inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >
 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
 

Friends

template<typename , int >
class simd
 
template<typename , typename >
class detail::simd_view_impl
 

Additional Inherited Members

- Static Public Member Functions inherited from sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >
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 NestedRegion, class ViewedElemT>
class sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >

This is a specialization of nested simd_view class with a single element.

Objects of such a class are created in the following situation: simd<int, 4> v = 1; auto v1 = v.select<2, 1>(0); auto v2 = v1[0]; // simd_view of a nested region for a single element

Definition at line 187 of file simd_view.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::BaseClass = detail::simd_view_impl<BaseTy, RegionTy>

Definition at line 195 of file simd_view.hpp.

◆ element_type

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::element_type = ViewedElemT

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

Definition at line 202 of file simd_view.hpp.

◆ RegionTy

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::RegionTy = std::pair<region1d_scalar_t<ViewedElemT>, NestedRegion>

Definition at line 194 of file simd_view.hpp.

◆ ShapeTy

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
using sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::ShapeTy = typename shape_type<RegionTy>::type

Definition at line 196 of file simd_view.hpp.

Member Function Documentation

◆ operator element_type()

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::operator element_type ( ) const
inline

Definition at line 211 of file simd_view.hpp.

◆ operator=() [1/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
Derived& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator=
inline

Assignment from an object of the derived class.

Updates the target region viewed by this object.

Parameters
OtherThe source object.
Returns
This object cast to the derived class.

Definition at line 395 of file simd_view_impl.hpp.

◆ operator=() [2/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
template<class T , int N, class SimdT , class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<BaseTy>)&&(length == SimdT::length)>>
Derived& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator= ( class T  ,
int  N,
class SimdT  ,
class  = std::enable_if_t<(is_simd_type_v<SimdT> ==                                      is_simd_type_v<BaseTy>)&&(length ==                                                                SimdT::length)> 
)
inline

Assignment with element type conversion from a vector object.

Updates the target region viewed by this object. Available only when the length (number of elements) of the source object matches the length of the target region.

Template Parameters
TThe source vector element type. Auto-deduced.
NThe source vector length. Auto-deduced.
Parameters
OtherThe source vector.
Returns
This object cast to the derived class.

Definition at line 430 of file simd_view_impl.hpp.

◆ operator=() [3/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
simd_view_impl& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator=
inline

Copy assignment.

Updates the target region viewed by this object.

Parameters
OtherThe source object.

Definition at line 387 of file simd_view_impl.hpp.

◆ operator=() [4/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
Derived& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator=
inline

Assignment from a value_type object - simd or simd_mask.

Updates the target region viewed by this object.

Parameters
ValThe source object.
Returns
This object cast to the derived class.

Definition at line 401 of file simd_view_impl.hpp.

◆ operator=() [5/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
Derived& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator=
inline

Assignment from an rvalue object of the derived class.

Updates the target region viewed by this object.

Parameters
OtherThe source rvalue object.
Returns
This object cast to the derived class.

Definition at line 407 of file simd_view_impl.hpp.

◆ operator=() [6/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
simd_view_impl& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator=
inline

Move assignment operator. Updates the target region viewed by this object.

Definition at line 413 of file simd_view_impl.hpp.

◆ operator=() [7/7]

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
template<class T1 , class = std::enable_if_t<is_valid_simd_elem_type_v<T1>>>
Derived& sycl::_V1::ext::intel::esimd::detail::simd_view_impl< BaseTy, RegionTy >::operator= ( class T1  ,
class  = std::enable_if_t<is_valid_simd_elem_type_v<T1>> 
)
inline

Broadcast assignment of a scalar with conversion.

Updates the target region viewed by this object.

Template Parameters
T1The type of the scalar.
Parameters
RHSThe scalar.
Returns
This object cast to the derived class.

Definition at line 441 of file simd_view_impl.hpp.

Friends And Related Function Documentation

◆ detail::simd_view_impl

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
template<typename , typename >
friend class detail::simd_view_impl
friend

Definition at line 191 of file simd_view.hpp.

◆ simd

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
template<typename , int >
friend class simd
friend

Definition at line 190 of file simd_view.hpp.

Member Data Documentation

◆ length

template<typename BaseTy , typename NestedRegion , class ViewedElemT >
constexpr int sycl::_V1::ext::intel::esimd::simd_view< BaseTy, std::pair< region1d_scalar_t< ViewedElemT >, NestedRegion > >::length = ShapeTy::Size_x * ShapeTy::Size_y
staticconstexpr

Definition at line 197 of file simd_view.hpp.


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