DPC++ Runtime
Runtime libraries for oneAPI DPC++
ESIMD math operations.

Defines math operations on ESIMD vector data types. More...

Collaboration diagram for ESIMD math operations.:

Modules

 Hardware-accelerated math.
 This is a group of APIs implementing standard math operations which are also directly supported by the hardware.
 
 Sycl_esimd_logical
 

Functions

template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t<!detail::is_generic_floating_point_v< T0 >||std::is_same_v< T1, T0 >, simd< T0, SZ > > sycl::_V1::ext::intel::esimd::saturate (simd< T1, SZ > src)
 Conversion of input vector elements of type T1 into vector of elements of type T0 with saturation. More...
 
template<typename TRes , typename TArg , int SZ>
ESIMD_DETAIL __ESIMD_API std::enable_if_t< !std::is_same< std::remove_const_t< TRes >, std::remove_const_t< TArg > >::value, simd< TRes, SZ > > sycl::_V1::ext::intel::esimd::abs (simd< TArg, SZ > src0)
 Get absolute value (vector version) More...
 
template<typename TRes , typename TArg >
__ESIMD_API std::enable_if_t<!std::is_same< std::remove_const_t< TRes >, std::remove_const_t< TArg > >::value &&detail::is_esimd_scalar< TRes >::value &&detail::is_esimd_scalar< TArg >::value, std::remove_const_t< TRes > > sycl::_V1::ext::intel::esimd::abs (TArg src0)
 Get absolute value (scalar version) More...
 
template<typename T1 , int SZ>
__ESIMD_API simd< T1, SZsycl::_V1::ext::intel::esimd::abs (simd< T1, SZ > src0)
 Get absolute value (vector version). More...
 
template<typename T1 >
__ESIMD_API std::enable_if_t< detail::is_esimd_scalar< T1 >::value, std::remove_const_t< T1 > > sycl::_V1::ext::intel::esimd::abs (T1 src0)
 Get absolute value (scalar version). More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API sycl::_V1::ext::intel::esimd::simd< T, SZ > (max)(simd< T
 Selects component-wise the maximum of the two vectors. More...
 
__ESIMD_API SZ simd< T, SZ > Sat int class simd< T, SZ >() sycl::_V1::ext::intel::esimd::max (simd< T, SZ > src0, T src1, Sat sat={})
 
__ESIMD_API simd< T, SZ > Sat class T() sycl::_V1::ext::intel::esimd::max (T src0, T src1, Sat sat={})
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API sycl::_V1::ext::intel::esimd::simd< T, SZ > (min)(simd< T
 Selects component-wise the minimum of the two vectors. More...
 
__ESIMD_API SZ simd< T, SZ > Sat int class simd< T, SZ >() sycl::_V1::ext::intel::esimd::min (simd< T, SZ > src0, T src1, Sat sat={})
 
__ESIMD_API simd< T, SZ > Sat class T() sycl::_V1::ext::intel::esimd::min (T src0, T src1, Sat sat={})
 
template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE simd< T, SZsycl::_V1::ext::intel::esimd::log (simd< T, SZ > src0, Sat sat={})
 Computes the natural logarithm of the given argument. More...
 
template<class T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::log (T src0, Sat sat={})
 
template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE simd< T, SZsycl::_V1::ext::intel::esimd::exp (simd< T, SZ > src0, Sat sat={})
 Computes e raised to the power of the given argument. More...
 
template<class T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::exp (T src0, Sat sat={})
 
template<typename T1 , typename T2 , typename T3 , typename T4 , int N, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_dword_type< T1 >::value &&detail::is_dword_type< T2 >::value &&detail::is_dword_type< T3 >::value &&detail::is_dword_type< T4 >::value, simd< T1, N > > sycl::_V1::ext::intel::esimd::dp4a (simd< T2, N > src0, simd< T3, N > src1, simd< T4, N > src2, Sat sat={})
 DP4A. More...
 
template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::hmax (simd< T1, SZ > v)
 ESIMD_DETAIL. More...
 
template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::hmin (simd< T1, SZ > v)
 Performs 'minimum' operation reduction over elements of the input vector, that is, returns the minimal vector element. More...
 
template<typename T0 , typename T1 , int SZ, typename BinaryOperation >
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::reduce (simd< T1, SZ > v, BinaryOperation op)
 Performs reduction over elements of the input vector. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, sycl::ext::intel::esimd::simd< uint32_t, N > src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1)
 Performs add with carry of 2 unsigned 32-bit vectors. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, sycl::ext::intel::esimd::simd< uint32_t, N > src0, uint32_t src1)
 Performs add with carry of a unsigned 32-bit vector and scalar. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, uint32_t src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1)
 Performs add with carry of a unsigned 32-bit scalar and vector. More...
 
__ESIMD_API uint32_t sycl::_V1::ext::intel::esimd::addc (uint32_t &carry, uint32_t src0, uint32_t src1)
 Performs add with carry of a unsigned 32-bit scalars. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, sycl::ext::intel::esimd::simd< uint32_t, N > src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1)
 Performs substraction with borrow of 2 unsigned 32-bit vectors. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, sycl::ext::intel::esimd::simd< uint32_t, N > src0, uint32_t src1)
 Performs substraction with borrow of unsigned 32-bit vector and scalar. More...
 
template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, uint32_t src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1)
 Performs substraction with borrow of unsigned 32-bit scalar and vector. More...
 
__ESIMD_API uint32_t sycl::_V1::ext::intel::esimd::subb (uint32_t &borrow, uint32_t src0, uint32_t src1)
 Performs substraction with borrow of 2 unsigned 32-bit scalars. More...
 
__ESIMD_API uint64_t sycl::_V1::ext::intel::esimd::rdtsc ()
 rdtsc - get the value of timestamp counter. More...
 

Variables

__ESIMD_API SZ sycl::_V1::ext::intel::esimd::src0
 
__ESIMD_API SZ simd< T, SZsycl::_V1::ext::intel::esimd::src1
 
__ESIMD_API SZ simd< T, SZ > Sat sycl::_V1::ext::intel::esimd::sat
 
__ESIMD_API SZ simd< T, SZ > Sat int sycl::_V1::ext::intel::esimd::SZ
 
__ESIMD_API SZ simd< T, SZ > Sat int class sycl::_V1::ext::intel::esimd::Sat
 

Detailed Description

Defines math operations on ESIMD vector data types.

Function Documentation

◆ abs() [1/4]

template<typename T1 , int SZ>
__ESIMD_API simd<T1, SZ> sycl::_V1::ext::intel::esimd::abs ( simd< T1, SZ src0)

Get absolute value (vector version).

This is a specialization of a version with three template parameters, where the element types of the input and output vector are the same.

Template Parameters
T1element type of the input and output vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
Returns
vector of absolute values.

Definition at line 157 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0.

◆ abs() [2/4]

template<typename TRes , typename TArg , int SZ>
ESIMD_DETAIL __ESIMD_API std::enable_if_t< !std::is_same<std::remove_const_t<TRes>, std::remove_const_t<TArg> >::value, simd<TRes, SZ> > sycl::_V1::ext::intel::esimd::abs ( simd< TArg, SZ src0)

Get absolute value (vector version)

Template Parameters
TReselement type of the returned vector.
TArgelement type of the input vector.
SZsize of the input and returned vector.
Parameters
src0the input vector.
Returns
vector of absolute values.

Definition at line 131 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0.

◆ abs() [3/4]

template<typename T1 >
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T1>::value, std::remove_const_t<T1> > sycl::_V1::ext::intel::esimd::abs ( T1  src0)

Get absolute value (scalar version).

This is a specialization of a version with two template parameters, where the types of the input and output value are the same.

Template Parameters
T1element type of the input and output value.
Parameters
src0the source operand.
Returns
absolute value.

Definition at line 170 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0.

Referenced by syclcompat::cabs(), and syclcompat::abs::operator()().

◆ abs() [4/4]

template<typename TRes , typename TArg >
__ESIMD_API std::enable_if_t<!std::is_same<std::remove_const_t<TRes>, std::remove_const_t<TArg> >::value && detail::is_esimd_scalar<TRes>::value && detail::is_esimd_scalar<TArg>::value, std::remove_const_t<TRes> > sycl::_V1::ext::intel::esimd::abs ( TArg  src0)

Get absolute value (scalar version)

Template Parameters
T0element type of the returned value.
T1element type of the input value.
Parameters
src0the source operand.
Returns
absolute value.

Definition at line 146 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0.

◆ addc() [1/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::addc ( sycl::ext::intel::esimd::simd< uint32_t, N > &  carry,
sycl::ext::intel::esimd::simd< uint32_t, N >  src0,
sycl::ext::intel::esimd::simd< uint32_t, N >  src1 
)

Performs add with carry of 2 unsigned 32-bit vectors.

Template Parameters
Nsize of the vectors
Parameters
carryvector that is going to hold resulting carry flag
src0first term
src1second term
Returns
sum of 2 terms, carry flag is returned through carry parameter

Definition at line 1725 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.

Referenced by sycl::_V1::ext::intel::esimd::addc().

◆ addc() [2/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::addc ( sycl::ext::intel::esimd::simd< uint32_t, N > &  carry,
sycl::ext::intel::esimd::simd< uint32_t, N >  src0,
uint32_t  src1 
)

Performs add with carry of a unsigned 32-bit vector and scalar.

Template Parameters
Nsize of the vectors
Parameters
carryvector that is going to hold resulting carry flag
src0first term
src1second term
Returns
sum of 2 terms, carry flag is returned through carry parameter

Definition at line 1743 of file math.hpp.

References sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.

◆ addc() [3/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::addc ( sycl::ext::intel::esimd::simd< uint32_t, N > &  carry,
uint32_t  src0,
sycl::ext::intel::esimd::simd< uint32_t, N >  src1 
)

Performs add with carry of a unsigned 32-bit scalar and vector.

Template Parameters
Nsize of the vectors
Parameters
carryvector that is going to hold resulting carry flag
src0first term
src1second term
Returns
sum of 2 terms, carry flag is returned through carry parameter

Definition at line 1757 of file math.hpp.

References sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.

◆ addc() [4/4]

__ESIMD_API uint32_t sycl::_V1::ext::intel::esimd::addc ( uint32_t &  carry,
uint32_t  src0,
uint32_t  src1 
)

Performs add with carry of a unsigned 32-bit scalars.

Template Parameters
Nsize of the vectors
Parameters
carryscalar that is going to hold resulting carry flag
src0first term
src1second term
Returns
sum of 2 terms, carry flag is returned through carry parameter

Definition at line 1769 of file math.hpp.

◆ dp4a()

template<typename T1 , typename T2 , typename T3 , typename T4 , int N, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_dword_type<T1>::value && detail::is_dword_type<T2>::value && detail::is_dword_type<T3>::value && detail::is_dword_type<T4>::value, simd<T1, N> > sycl::_V1::ext::intel::esimd::dp4a ( simd< T2, N >  src0,
simd< T3, N >  src1,
simd< T4, N >  src2,
Sat  sat = {} 
)

DP4A.

Parameters
src0the first source operand of dp4a operation.
src1the second source operand of dp4a operation.
src2the third source operand of dp4a operation.
satsaturation flag, which has default value of saturation_off.

Returns simd vector of the dp4a operation result.

Definition at line 1399 of file math.hpp.

◆ exp() [1/2]

template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE simd<T, SZ> sycl::_V1::ext::intel::esimd::exp ( simd< T, SZ src0,
Sat  sat = {} 
)

Computes e raised to the power of the given argument.

This is an emulated version based on the H/W supported exp2.

Parameters
thesource operand to compute base-e exponential of.
Returns
e raised to the power of src0.

Definition at line 589 of file math.hpp.

◆ exp() [2/2]

template<class T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::exp ( src0,
Sat  sat = {} 
)

Definition at line 595 of file math.hpp.

◆ hmax()

template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::hmax ( simd< T1, SZ v)

ESIMD_DETAIL.

Performs 'maximum' operation reduction over elements of the input vector, that is, returns the maximal vector element.

Template Parameters
T0type of the return value.
T1element type of the input vector.
SZsize of the input vector.
Parameters
vthe vector to perfrom reduction on
Returns
result of the reduction

Definition at line 1572 of file math.hpp.

◆ hmin()

template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::hmin ( simd< T1, SZ v)

Performs 'minimum' operation reduction over elements of the input vector, that is, returns the minimal vector element.

Template Parameters
T0type of the return value.
T1element type of the input vector.
SZsize of the input vector.
Parameters
vthe vector to perfrom reduction on
Returns
result of the reduction

Definition at line 1585 of file math.hpp.

◆ log() [1/2]

template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE simd<T, SZ> sycl::_V1::ext::intel::esimd::log ( simd< T, SZ src0,
Sat  sat = {} 
)

Computes the natural logarithm of the given argument.

This is an emulated version based on the H/W supported log2.

Parameters
thesource operand to compute base-e logarithm of.
Returns
the base-e logarithm of src0.

Definition at line 568 of file math.hpp.

◆ log() [2/2]

template<class T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::log ( src0,
Sat  sat = {} 
)

Definition at line 580 of file math.hpp.

◆ max() [1/2]

__ESIMD_API SZ simd<T, SZ> Sat int class simd<T, SZ>() sycl::_V1::ext::intel::esimd::max ( simd< T, SZ src0,
src1,
Sat  sat = {} 
)

Definition at line 215 of file math.hpp.

◆ max() [2/2]

__ESIMD_API simd<T, SZ> Sat class T() sycl::_V1::ext::intel::esimd::max ( src0,
src1,
Sat  sat = {} 
)

Definition at line 251 of file math.hpp.

◆ min() [1/2]

__ESIMD_API SZ simd<T, SZ> Sat int class simd<T, SZ>() sycl::_V1::ext::intel::esimd::min ( simd< T, SZ src0,
src1,
Sat  sat = {} 
)

Definition at line 300 of file math.hpp.

◆ min() [2/2]

__ESIMD_API simd<T, SZ> Sat class T() sycl::_V1::ext::intel::esimd::min ( src0,
src1,
Sat  sat = {} 
)

Definition at line 336 of file math.hpp.

◆ rdtsc()

__ESIMD_API uint64_t sycl::_V1::ext::intel::esimd::rdtsc ( )

rdtsc - get the value of timestamp counter.

Returns
the current value of timestamp counter

Definition at line 1845 of file math.hpp.

◆ reduce()

template<typename T0 , typename T1 , int SZ, typename BinaryOperation >
ESIMD_INLINE ESIMD_NODEBUG T0 sycl::_V1::ext::intel::esimd::reduce ( simd< T1, SZ v,
BinaryOperation  op 
)

Performs reduction over elements of the input vector.

Template Parameters
T0type of the return value.
T1element type of the input vector.
SZsize of the input vector.
BinaryOperationtype representing the operation. Can be an instantion of one of the following types:
  • std::plus, performs addition operation
  • std::multiplies, performs multiplication operation
Parameters
vthe vector to perfrom reduction on
opreduction operation object, used to auto-deduce the BinaryOperation template parameter.
Returns
result of the reduction

Definition at line 1605 of file math.hpp.

◆ saturate()

template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t<!detail::is_generic_floating_point_v<T0> || std::is_same_v<T1, T0>, simd<T0, SZ> > sycl::_V1::ext::intel::esimd::saturate ( simd< T1, SZ src)

Conversion of input vector elements of type T1 into vector of elements of type T0 with saturation.

The following conversions are supported:

  • T0 and T1 is the same floating-point type (including half). In this case the result in the i'th lane is:

    • 0 if src[i] is less than 0
    • 1 if src[i] is greater than 1
    • src[i] otherwise

    I.e. it is always a value in the range [-1, 1].

  • T0 is an integral type, T1 is any valid element type. In this case the (per-element) result is the closest representable value. For example:
    • Too big (exceeding representable range of T0) positive integral or floating-point value src[i] of type T1 converted to T0 will result in std:numeric_limits<T0>::max().
    • Too big negative value will be converted to std:numeric_limits<T0>::min().
    • Negative integer or floating point value converted to unsigned T1 will yield 0.
      Template Parameters
      T0Element type of the returned vector.
      T1Element type of the input vector.
      SZSize of the input and returned vector.
      Parameters
      srcThe input vector.
      Returns
      Vector of src elements converted to T0 with saturation.

Definition at line 72 of file math.hpp.

References sycl::_V1::ext::intel::esimd::detail::simd_obj_impl< RawTy, N, Derived, SFINAE >::data().

◆ simd< T, SZ >() [1/2]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API sycl::_V1::ext::intel::esimd::simd< T, SZ > ( max  )

Selects component-wise the maximum of the two vectors.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

◆ simd< T, SZ >() [2/2]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API sycl::_V1::ext::intel::esimd::simd< T, SZ > ( min  )

Selects component-wise the minimum of the two vectors.

The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

◆ subb() [1/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::subb ( sycl::ext::intel::esimd::simd< uint32_t, N > &  borrow,
sycl::ext::intel::esimd::simd< uint32_t, N >  src0,
sycl::ext::intel::esimd::simd< uint32_t, N >  src1 
)

Performs substraction with borrow of 2 unsigned 32-bit vectors.

Template Parameters
Nsize of the vectors
Parameters
borrowvector that is going to hold resulting borrow flag
src0first term
src1second term
Returns
difference of 2 terms, borrow flag is returned through borrow parameter

Definition at line 1787 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.

Referenced by sycl::_V1::ext::intel::esimd::subb().

◆ subb() [2/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::subb ( sycl::ext::intel::esimd::simd< uint32_t, N > &  borrow,
sycl::ext::intel::esimd::simd< uint32_t, N >  src0,
uint32_t  src1 
)

Performs substraction with borrow of unsigned 32-bit vector and scalar.

Template Parameters
Nsize of the vectors
Parameters
borrowvector that is going to hold resulting borrow flag
src0first term
src1second term
Returns
difference of 2 terms, borrow flag is returned through borrow parameter

Definition at line 1806 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0, sycl::_V1::ext::intel::esimd::src1, and sycl::_V1::ext::intel::esimd::subb().

◆ subb() [3/4]

template<int N>
__ESIMD_API sycl::ext::intel::esimd::simd<uint32_t, N> sycl::_V1::ext::intel::esimd::subb ( sycl::ext::intel::esimd::simd< uint32_t, N > &  borrow,
uint32_t  src0,
sycl::ext::intel::esimd::simd< uint32_t, N >  src1 
)

Performs substraction with borrow of unsigned 32-bit scalar and vector.

Template Parameters
Nsize of the vectors
Parameters
borrowvector that is going to hold resulting borrow flag
src0first term
src1second term
Returns
difference of 2 terms, borrow flag is returned through borrow parameter

Definition at line 1821 of file math.hpp.

References sycl::_V1::ext::intel::esimd::src0, sycl::_V1::ext::intel::esimd::src1, and sycl::_V1::ext::intel::esimd::subb().

◆ subb() [4/4]

__ESIMD_API uint32_t sycl::_V1::ext::intel::esimd::subb ( uint32_t &  borrow,
uint32_t  src0,
uint32_t  src1 
)

Performs substraction with borrow of 2 unsigned 32-bit scalars.

Template Parameters
Nsize of the vectors
Parameters
borrowscalar that is going to hold resulting borrow flag
src0first term
src1second term
Returns
difference of 2 terms, borrow flag is returned through borrow parameter

Definition at line 1834 of file math.hpp.

Variable Documentation

◆ sat

__ESIMD_API simd< T, SZ > Sat sycl::_V1::ext::intel::esimd::sat
Initial value:
= {}) {
constexpr bool is_sat = std::is_same_v<Sat, saturation_on_tag>;
if constexpr (std::is_floating_point<T>::value) {
auto Result = __spirv_ocl_fmax<T, SZ>(src0.data(), src1.data());
if constexpr (is_sat)
Result = __esimd_sat<T, T, SZ>(Result);
return simd<T, SZ>(Result);
} else if constexpr (std::is_unsigned<T>::value) {
auto Result = __esimd_umax<T, SZ>(src0.data(), src1.data());
if constexpr (is_sat)
Result = __esimd_uutrunc_sat<T, T, SZ>(Result);
return simd<T, SZ>(Result);
} else {
auto Result = __esimd_smax<T, SZ>(src0.data(), src1.data());
if constexpr (is_sat)
Result = __esimd_sstrunc_sat<T, T, SZ>(Result);
return simd<T, SZ>(Result);
}
}
template <typename T
__ESIMD_API SZ simd< T, SZ > src1
Definition: math.hpp:184
__ESIMD_API simd< T, SZ >(min)(simd< T
Selects component-wise the minimum of the two vectors.
__ESIMD_API SZ src0
Definition: math.hpp:184

Definition at line 184 of file math.hpp.

◆ Sat

__ESIMD_API simd< T, SZ > Sat class sycl::_V1::ext::intel::esimd::Sat
Initial value:
= saturation_off_tag>
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T>::value

Definition at line 215 of file math.hpp.

◆ src0

◆ src1

◆ SZ

__ESIMD_API SZ simd< T, SZ > Sat int sycl::_V1::ext::intel::esimd::SZ