DPC++ Runtime
Runtime libraries for oneAPI DPC++
cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy > Class Template Reference

Base class for "simd view" types. More...

#include <sycl/ext/intel/esimd/detail/simd_view_impl.hpp>

Public Types

using Derived = simd_view< BaseTy, RegionTy >
 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_impl (const simd_view_impl &Other)=default
 Default copy constructor. More...
 
 simd_view_impl (simd_view_impl &&Other)=default
 Default move constructor. More...
 
template<typename ToTy , class T = BaseTy, class = std::enable_if_t<is_simd_type_v<T>>>
 operator simd< ToTy, length > () const
 Implicit conversion to a simd object with potentially different element type. More...
 
template<class T = BaseTy, class = std::enable_if_t<is_simd_mask_type_v<T>>>
 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...
 
template<typename EltTy >
auto bit_cast_view ()
 Create a 1-dimensional view of the target region. More...
 
template<typename EltTy , int Height, int Width>
auto bit_cast_view ()
 Create a 2-dimensional view of the target region. More...
 
template<int Size, int Stride, typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
auto select (uint16_t Offset=0)
 1D region select. More...
 
template<int SizeY, int StrideY, int SizeX, int StrideX, typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto select (uint16_t OffsetY=0, uint16_t OffsetX=0)
 2D region select. More...
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derivedoperator^= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator^= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator^= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derivedoperator|= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator|= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator|= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derivedoperator&= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator&= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator&= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derivedoperator%= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator%= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derivedoperator%= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator<<= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_SHIFT_OP_FILTER >>
Derivedoperator<<= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_SHIFT_OP_FILTER >>
Derivedoperator<<= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator>>= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_SHIFT_OP_FILTER >>
Derivedoperator>>= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_SHIFT_OP_FILTER >>
Derivedoperator>>= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator+= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derivedoperator+= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derivedoperator+= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator-= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derivedoperator-= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derivedoperator-= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator*= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derivedoperator*= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derivedoperator*= (T1 RHS)
 
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derivedoperator/= (const simd_obj_impl< T1, N1, SimdT1 > &RHS)
 
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derivedoperator/= (const simd_view_impl< SimdT1, RegionT1 > &RHS)
 
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derivedoperator/= (T1 RHS)
 
template<class T = element_type, class = std::enable_if_t<std::is_integral_v<T>>>
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...
 
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...
 
Derivedoperator++ ()
 Prefix increment. More...
 
value_type operator++ (int)
 Postfix increment. More...
 
Derivedoperator-- ()
 Prefix decrement. More...
 
value_type operator-- (int)
 Postfix decrement. More...
 
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto row (int i)
 Reference a row from a 2D region. More...
 
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto column (int i)
 Reference a column from a 2D region. More...
 
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
element_type operator[] (int i) const
 Read a single element from the target 1D region. More...
 
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
auto operator[] (int i)
 Return a writeable view of a single element in the target 1D region. More...
 
template<int Rep>
get_simd_t< element_type, Rep > replicate ()
 Applies simd_obj_impl::replicate to the target region. More...
 
template<int Rep, int W>
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...
 
template<int Rep, int W>
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...
 
template<int Rep, int VS, int W>
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...
 
template<int Rep, int VS, int W>
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...
 
template<int Rep, int VS, int W, int HS>
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...
 
template<int Rep, int VS, int W, int HS>
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...
 
template<typename T1 = element_type, typename T2 = BaseTy, typename = std::enable_if_t<std::is_integral<T1>::value, T2>>
uint16_t any ()
 Applies simd_obj_impl::any operation to the target region. More...
 
template<typename T1 = element_type, typename T2 = BaseTy, typename = std::enable_if_t<std::is_integral<T1>::value, T2>>
uint16_t all ()
 Applies simd_obj_impl::all operation to the target region. More...
 

Static Public Member Functions

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 cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >

Base class for "simd view" types.

It is an internal class implementing basic functionality inherited by all simd_view specializations. Objects of this type and its subclasses provide a "view" into objects of types inheriting from simd_obj_impl - simd or simd_mask. Such "viewed into" object are called view "targets". The element type of the view and the target object may differ. The view can also span a subset of target's elements (region) - e.g. in a strided manner. These view parameters - element type and region - are defined by the region type the view class is templated on. simd_view_impl objects are never created directly, only via subclassing.

Template Parameters
BaseTyThe type of the target object. Auto-deduced.
RegionTyThe type defining compile-time known characteristics of the viewed region within the target object. Auto-deduced.

Definition at line 40 of file simd_view_impl.hpp.

Member Typedef Documentation

◆ Derived

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::Derived = simd_view<BaseTy, RegionTy>

The only type which is supposed to extend this one and be used in user code.

Definition at line 44 of file simd_view_impl.hpp.

◆ element_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::element_type = typename ShapeTy::element_type

Element type of this view, may differ from the element type of the target object.

Definition at line 73 of file simd_view_impl.hpp.

◆ raw_element_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::raw_element_type = __raw_t<element_type>

Corresponding "raw" (storage) type for the element type.

Definition at line 76 of file simd_view_impl.hpp.

◆ raw_vector_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::raw_vector_type = vector_type_t<__raw_t<element_type>, length>

The underlying builtin vector type of the the viewed region.

Definition at line 82 of file simd_view_impl.hpp.

◆ value_type

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
using cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::value_type = get_simd_t<element_type, length>

The simd type of the viewed region of the target object.

Definition at line 79 of file simd_view_impl.hpp.

Constructor & Destructor Documentation

◆ simd_view_impl() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::simd_view_impl ( const simd_view_impl< BaseTy, RegionTy > &  Other)
default

Default copy constructor.

◆ simd_view_impl() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::simd_view_impl ( simd_view_impl< BaseTy, RegionTy > &&  Other)
default

Default move constructor.

Member Function Documentation

◆ all()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T1 = element_type, typename T2 = BaseTy, typename = std::enable_if_t<std::is_integral<T1>::value, T2>>
uint16_t cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::all ( )
inline

Applies simd_obj_impl::all operation to the target region.

Definition at line 582 of file simd_view_impl.hpp.

◆ any()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T1 = element_type, typename T2 = BaseTy, typename = std::enable_if_t<std::is_integral<T1>::value, T2>>
uint16_t cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::any ( )
inline

Applies simd_obj_impl::any operation to the target region.

Definition at line 575 of file simd_view_impl.hpp.

◆ bit_cast_view() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename EltTy >
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::bit_cast_view ( )
inline

Create a 1-dimensional view of the target region.

Template Parameters
EltTyThe element type of the new view.
Returns
a new simd_view object which spans the same target region, but with the new element type and potentially different number of elements, if the sizes of this view's element type and the new one don't match.

Definition at line 198 of file simd_view_impl.hpp.

◆ bit_cast_view() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename EltTy , int Height, int Width>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::bit_cast_view ( )
inline

Create a 2-dimensional view of the target region.

sizeof(EltTy)*Height*Width must be equal to the byte size of the target region.

Template Parameters
ElTyThe element type of the new view.
HeightHeight of the new view in rows.
WidthWidth of the new view in elements.
Returns
A new 2D simd_view object which spans the same target region, but potentially with a different element type and different number of elements, if the sizes of this object's element type and the new one don't match.

Definition at line 216 of file simd_view_impl.hpp.

◆ column()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::column ( int  i)
inline

Reference a column from a 2D region.

Available only if this object is 2D.

Parameters
iColumn index.
Returns
A 2D view of a region representing i'th column of the target region.

Definition at line 487 of file simd_view_impl.hpp.

◆ data()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
value_type::raw_vector_type cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::data ( ) const
inline
Returns
Viewed region's raw elements as a vector.

Definition at line 161 of file simd_view_impl.hpp.

◆ getOffsetX()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
constexpr uint16_t cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getOffsetX ( ) const
inlineconstexpr

Get the offset of the first element of the view within the parent object along X dimension.

Definition at line 141 of file simd_view_impl.hpp.

◆ getOffsetY()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
constexpr uint16_t cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getOffsetY ( ) const
inlineconstexpr

Get the offset of the first element of the view within the parent object along Y dimension.

Definition at line 147 of file simd_view_impl.hpp.

◆ getSizeX()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr int cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getSizeX ( )
inlinestaticconstexpr

Get number of elements in the view along X dimension.

Definition at line 131 of file simd_view_impl.hpp.

◆ getSizeY()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr int cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getSizeY ( )
inlinestaticconstexpr

Get number of elements in the view along Y dimension.

Definition at line 135 of file simd_view_impl.hpp.

◆ getStrideX()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr int cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getStrideX ( )
inlinestaticconstexpr

Get element stride of the view along X dimension.

Definition at line 133 of file simd_view_impl.hpp.

◆ getStrideY()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr int cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::getStrideY ( )
inlinestaticconstexpr

Get element stride of the view along Y dimension.

Definition at line 137 of file simd_view_impl.hpp.

◆ is1D()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr bool cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::is1D ( )
inlinestaticconstexpr

Tells whether this view is 1-dimensional.

Definition at line 127 of file simd_view_impl.hpp.

◆ is2D()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
static constexpr bool cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::is2D ( )
inlinestaticconstexpr

Tells whether this view is 2-dimensional.

Definition at line 129 of file simd_view_impl.hpp.

◆ merge() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
void cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::merge ( const value_type Val,
const simd_mask_type< length > &  Mask 
)
inline

"Merges" the viewed target's region with given value according to a per-element mask.

Parameters
ValThe new value to merge with.
MaskThe mask. Only elements in lanes with non-zero mask predicate are assigned from corresponding Val elements.

Definition at line 177 of file simd_view_impl.hpp.

References cl::sycl::ext::intel::esimd::merge().

◆ merge() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
void cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::merge ( const value_type Val1,
value_type  Val2,
const simd_mask_type< length > &  Mask 
)
inline

"Merges" given values according to a per-element mask and writes the result to the viewed target's region.

Parameters
Val1Value1 being merged.
Val2Value2 being merged.
MaskThe mask. non-zero in a mask's lane tells to take corresponding element from Val1, zero - from Val2.

Definition at line 187 of file simd_view_impl.hpp.

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

◆ operator simd< ToTy, length >()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename ToTy , class T = BaseTy, class = std::enable_if_t<is_simd_type_v<T>>>
cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator simd< ToTy, length > ( ) const
inline

Implicit conversion to a simd object with potentially different element type.

Reads the viewed region from the target, converts elements to the requested type and returns as a simd object. Available only when the type of the view target is simd.

Template Parameters
ToTyThe element type of the result.

Definition at line 111 of file simd_view_impl.hpp.

◆ operator simd_mask_type< length >()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T = BaseTy, class = std::enable_if_t<is_simd_mask_type_v<T>>>
cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator simd_mask_type< length > ( ) const
inline

Implicit conversion to a simd_mask object.

Reads the viewed region from the target and returns it as a simd object. Available only when the type of the view target is simd_mask.

Definition at line 122 of file simd_view_impl.hpp.

◆ operator!()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T = element_type, class = std::enable_if_t<std::is_integral_v<T>>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator! ( )
inline

Unary logical negeation operator. Applies only to integer element types.

Definition at line 372 of file simd_view_impl.hpp.

◆ operator%=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator%= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 334 of file simd_view_impl.hpp.

◆ operator%=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator%= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 334 of file simd_view_impl.hpp.

◆ operator%=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator%= ( T1  RHS)
inline

Definition at line 334 of file simd_view_impl.hpp.

◆ operator&=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator&= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 333 of file simd_view_impl.hpp.

◆ operator&=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator&= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 333 of file simd_view_impl.hpp.

◆ operator&=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator&= ( T1  RHS)
inline

Definition at line 333 of file simd_view_impl.hpp.

◆ operator*=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator*= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 350 of file simd_view_impl.hpp.

◆ operator*=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator*= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 350 of file simd_view_impl.hpp.

◆ operator*=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator*= ( T1  RHS)
inline

Definition at line 350 of file simd_view_impl.hpp.

◆ operator++() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator++ ( )
inline

Prefix increment.

Updates the target region viewed by this object.

Returns
This object cast to the derived class.

Definition at line 441 of file simd_view_impl.hpp.

◆ operator++() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
value_type cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator++ ( int  )
inline

Postfix increment.

Returns
New vector object, whose element values are incremented values of the target region elements.

Definition at line 449 of file simd_view_impl.hpp.

◆ operator+=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator+= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 348 of file simd_view_impl.hpp.

◆ operator+=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator+= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 348 of file simd_view_impl.hpp.

◆ operator+=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator+= ( T1  RHS)
inline

Definition at line 348 of file simd_view_impl.hpp.

◆ operator--() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator-- ( )
inline

Prefix decrement.

Updates the target region viewed by this object.

Returns
This object cast to the derived class.

Definition at line 457 of file simd_view_impl.hpp.

◆ operator--() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
value_type cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator-- ( int  )
inline

Postfix decrement.

Returns
New vector object, whose element values are decremented values of the target region elements.

Definition at line 465 of file simd_view_impl.hpp.

◆ operator-=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator-= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 349 of file simd_view_impl.hpp.

◆ operator-=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator-= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 349 of file simd_view_impl.hpp.

◆ operator-=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator-= ( T1  RHS)
inline

Definition at line 349 of file simd_view_impl.hpp.

◆ operator/=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && is_valid_simd_elem_type_v<T> &&is_valid_simd_elem_type_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator/= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 351 of file simd_view_impl.hpp.

◆ operator/=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator/= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 351 of file simd_view_impl.hpp.

◆ operator/=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_ARITH_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator/= ( T1  RHS)
inline

Definition at line 351 of file simd_view_impl.hpp.

◆ operator<<=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator<<= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 340 of file simd_view_impl.hpp.

◆ operator<<=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_SHIFT_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator<<= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 340 of file simd_view_impl.hpp.

◆ operator<<=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_SHIFT_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator<<= ( T1  RHS)
inline

Definition at line 340 of file simd_view_impl.hpp.

◆ operator=() [1/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( const Derived Other)
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 389 of file simd_view_impl.hpp.

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

◆ operator=() [2/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
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& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( const simd_obj_impl< T, N, SimdT > &  Other)
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 424 of file simd_view_impl.hpp.

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

◆ operator=() [3/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
simd_view_impl& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( const simd_view_impl< BaseTy, RegionTy > &  Other)
inline

Copy assignment.

Updates the target region viewed by this object.

Parameters
OtherThe source object.

Definition at line 381 of file simd_view_impl.hpp.

References cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::read(), and cl::sycl::detail::write().

◆ operator=() [4/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( const value_type Val)
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 395 of file simd_view_impl.hpp.

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

◆ operator=() [5/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( Derived &&  Other)
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 401 of file simd_view_impl.hpp.

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

◆ operator=() [6/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
simd_view_impl& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( simd_view_impl< BaseTy, RegionTy > &&  Other)
inline

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

Definition at line 407 of file simd_view_impl.hpp.

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

◆ operator=() [7/7]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class = std::enable_if_t<is_valid_simd_elem_type_v<T1>>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator= ( T1  RHS)
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 435 of file simd_view_impl.hpp.

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

◆ operator>>=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> &&is_simd_type_v<SimdT> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator>>= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 341 of file simd_view_impl.hpp.

◆ operator>>=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_SHIFT_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator>>= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 341 of file simd_view_impl.hpp.

◆ operator>>=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_SHIFT_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator>>= ( T1  RHS)
inline

Definition at line 341 of file simd_view_impl.hpp.

◆ operator[]() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator[] ( int  i)
inline

Return a writeable view of a single element in the target 1D region.

Parameters
iElement index.
Returns
A new 1D view of the element. Can be used to update it.

Definition at line 506 of file simd_view_impl.hpp.

◆ operator[]() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
element_type cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator[] ( int  i) const
inline

Read a single element from the target 1D region.

Parameters
iElement index.
Returns
Element value.

Definition at line 496 of file simd_view_impl.hpp.

◆ operator^=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator^= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 331 of file simd_view_impl.hpp.

◆ operator^=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator^= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 331 of file simd_view_impl.hpp.

◆ operator^=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator^= ( T1  RHS)
inline

Definition at line 331 of file simd_view_impl.hpp.

◆ operator|=() [1/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , int N1, class SimdT1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t<(is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&(N1 == length) && std::is_integral_v<T> &&std::is_integral_v<T1> >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator|= ( const simd_obj_impl< T1, N1, SimdT1 > &  RHS)
inline

Definition at line 332 of file simd_view_impl.hpp.

◆ operator|=() [2/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class SimdT1 , class RegionT1 , class T1 = typename sycl::ext::intel::esimd ::shape_type<RegionT1>::element_type, class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< (is_simd_type_v<SimdT> == is_simd_type_v<SimdT1>)&&( length == __ESIMD_NS::shape_type<RegionT1>::length) && __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator|= ( const simd_view_impl< SimdT1, RegionT1 > &  RHS)
inline

Definition at line 332 of file simd_view_impl.hpp.

◆ operator|=() [3/3]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<class T1 , class T = element_type, class SimdT = BaseTy, class = std::enable_if_t< __ESIMD_BITWISE_OP_FILTER >>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator|= ( T1  RHS)
inline

Definition at line 332 of file simd_view_impl.hpp.

◆ read()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
value_type cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::read ( ) const
inline

Reads the viewed region from the target w/o any conversion and returns as an object of the value_type type.

Returns
The viewed target region as a simd or simd_mask object.

Definition at line 154 of file simd_view_impl.hpp.

References cl::sycl::length().

Referenced by cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::operator=().

◆ replicate()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep>
get_simd_t<element_type, Rep> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate ( )
inline

Applies simd_obj_impl::replicate to the target region.

Definition at line 511 of file simd_view_impl.hpp.

◆ replicate_vs_w() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int VS, int W>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_vs_w ( uint16_t  OffsetX)
inline

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.

Definition at line 538 of file simd_view_impl.hpp.

◆ replicate_vs_w() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int VS, int W>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_vs_w ( uint16_t  OffsetY,
uint16_t  OffsetX 
)
inline

◆ replicate_vs_w_hs() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int VS, int W, int HS>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_vs_w_hs ( uint16_t  OffsetX)
inline

Applies simd_obj_impl::replicate_vs_w_hs<int Rep, int VS, int W, int HS> to the target region.

Definition at line 556 of file simd_view_impl.hpp.

◆ replicate_vs_w_hs() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int VS, int W, int HS>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_vs_w_hs ( uint16_t  OffsetY,
uint16_t  OffsetX 
)
inline

Applies simd_obj_impl::replicate_vs_w_hs<int Rep, int VS, int W, int HS> to the target region.

The offset is calculated as OffsetY * RowSize + OffsetX where RowSize is the size of the X dimension if this object is 2D or 0 otherwise.

Definition at line 565 of file simd_view_impl.hpp.

◆ replicate_w() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int W>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_w ( uint16_t  OffsetX)
inline

Shortcut to replicate_vs_w<int Rep, int Vs, int W>(uint16_t) with with Vs = 0.

Used to replicate the same elements chunk multiple times. Used for 1D views.

Definition at line 519 of file simd_view_impl.hpp.

◆ replicate_w() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Rep, int W>
get_simd_t<element_type, Rep * W> cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::replicate_w ( uint16_t  OffsetY,
uint16_t  OffsetX 
)
inline

Shortcut to replicate_vs_w<int Rep, int Vs, int W>(uint16_t, uint16_t) with Vs = 0.

Used to replicate the same elements chunk multiple times. Used for 2D views.

Definition at line 527 of file simd_view_impl.hpp.

◆ row()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::row ( int  i)
inline

Reference a row from a 2D region.

Available only if this object is 2D.

Parameters
iRow index.
Returns
A 2D view of a region representing i'th row of the target region.

Definition at line 476 of file simd_view_impl.hpp.

◆ select() [1/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int Size, int Stride, typename T = Derived, typename = sycl::detail::enable_if_t<T::is1D()>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::select ( uint16_t  Offset = 0)
inline

1D region select.

Selects a 1D subregion in the target region.

Template Parameters
SizeThe number of elements to be selected.
StrideDistance in elements between two consecutive elements.
Parameters
Offsetis the starting element offset.
Returns
simd_view representing the subregion.

Definition at line 233 of file simd_view_impl.hpp.

◆ select() [2/2]

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
template<int SizeY, int StrideY, int SizeX, int StrideX, typename T = Derived, typename = sycl::detail::enable_if_t<T::is2D()>>
auto cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::select ( uint16_t  OffsetY = 0,
uint16_t  OffsetX = 0 
)
inline

2D region select.

Selects a 2D subregion in the target region. The target region must be a 2D region, for example, a result of calling the 2D version of simd_obj_impl::bit_cast_view. Code snippet below shows example of naive implementation of matrix multiplication of two matrices:

  • tile_a, [Wm x Wk] elements selected from object a, with offsets off_m, off_k and strides Sm and Sk along the Y and X dimensions
  • tile_b, [Wk x Wn] elements selected from object b, with offsets off_k, off_n and strides Sk and Sn along the Y and X dimensions
    simd<T, M * N> c(mat_c);
    auto tile_a = a.template bit_cast_view<T, M, K>().template select<Wm, Sm, Wk, Sk>(off_m, off_k);
    auto tile_b = b.template bit_cast_view<T, K, N>().template select<Wk, Sk, Wn, Sn>(off_k, off_n);
    auto tile_c = c.template bit_cast_view<T, M, N>().template select<Wm, Sm, Wn, Sn>(off_m, off_n);
    for (int m = 0; m < Wm; m++) {
    for (int n = 0; n < Wn; n++) {
    tile_c.template select<1, 1, 1, 1>(m, n) +=
    reduce<T>(tile_a.row(m) * tile_b.column(n), std::plus<>{});
    }
    }
    c.copy_to(mat_c);
Template Parameters
SizeYThe number of elements to be selected in Y-dimension.
StrideYDistance in elements between two consecutive elements in Y-dimension.
SizeXThe number of elements to be selected in X-dimension.
StrideXDistance in elements between two consecutive elements in X-dimension.
Parameters
OffsetXStarting element offset in X-dimension.
OffsetYStarting element offset in Y-dimension.
Returns
2D simd_view of the subregion.

Definition at line 284 of file simd_view_impl.hpp.

◆ write()

template<typename BaseTy , typename RegionTy = region1d_t<typename BaseTy::element_type, BaseTy::length, 1>>
Derived& cl::__ESIMD_DNS::simd_view_impl< BaseTy, RegionTy >::write ( const value_type Val)
inline

Assigns a new value to the viewed target's region.

Parameters
ValThe new value to assign.
Returns
Reference to this object properly casted to the actual type subclassing the simd_view_impl.

Definition at line 167 of file simd_view_impl.hpp.


The documentation for this class was generated from the following file:
cl::sycl::ext::oneapi::experimental::matrix::matrix_use::b
@ b
cl::sycl::ext::oneapi::experimental::matrix::matrix_use::a
@ a
simd
Definition: simd.hpp:1027