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. Usually the hardware support is a specific message to the "extended math" GPU "shared function" unit, sent via the math instruction. Most of the operations do not conform to OpenCL requirements for accuracy, so should be used with care.
 

Namespaces

 cl::sycl::ext::intel::esimd::detail
 

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 > > cl::sycl::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 T0 , typename T1 , int SZ>
ESIMD_DETAIL __ESIMD_API std::enable_if_t< !std::is_same< std::remove_const_t< T0 >, std::remove_const_t< T1 > >::value, simd< T0, SZ > > cl::sycl::ext::intel::esimd::abs (simd< T1, SZ > src0)
 Get absolute value (vector version) More...
 
template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t< !std::is_same< std::remove_const_t< T0 >, std::remove_const_t< T1 > >::value &&detail::is_esimd_scalar< T0 >::value &&detail::is_esimd_scalar< T1 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::esimd::abs (T1 src0)
 Get absolute value (scalar version) More...
 
template<typename T1 , int SZ>
__ESIMD_API simd< T1, SZ > cl::sycl::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 > > cl::sycl::ext::intel::esimd::abs (T1 src0)
 Get absolute value (scalar version). More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API simd< T, SZ > cl::sycl::ext::intel::esimd::max (simd< T, SZ > src0, simd< T, SZ > src1, Sat sat={})
 Selects component-wise the maximum of the two vectors. More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_esimd_scalar< T >::value, simd< T, SZ > > cl::sycl::ext::intel::esimd::max (simd< T, SZ > src0, T src1, Sat sat={})
 Selects maximums for each element of the input vector and a scalar. More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_esimd_scalar< T >::value, simd< T, SZ > > cl::sycl::ext::intel::esimd::max (T src0, simd< T, SZ > src1, Sat sat={})
 Selects maximums for each element of the input scalar and a vector. More...
 
template<typename T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< detail::is_esimd_scalar< T >::value, Tcl::sycl::ext::intel::esimd::max (T src0, T src1, Sat sat={})
 Selects maximum between two scalar values. More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API simd< T, SZ > cl::sycl::ext::intel::esimd::min (simd< T, SZ > src0, simd< T, SZ > src1, Sat sat={})
 Selects component-wise the minimum of the two vectors. More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_esimd_scalar< T >::value, simd< T, SZ > > cl::sycl::ext::intel::esimd::min (simd< T, SZ > src0, T src1, Sat sat={})
 Selects minimums for each element of the input vector and a scalar. More...
 
template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t< detail::is_esimd_scalar< T >::value, simd< T, SZ > > cl::sycl::ext::intel::esimd::min (T src0, simd< T, SZ > src1, Sat sat={})
 Selects minimums for each element of the input scalar and a vector. More...
 
template<typename T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< detail::is_esimd_scalar< T >::value, Tcl::sycl::ext::intel::esimd::min (T src0, T src1, Sat sat={})
 Selects minimum between two scalar values. More...
 
template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE simd< T, SZ > cl::sycl::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 cl::sycl::ext::intel::esimd::log (T src0, Sat sat={})
 
template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE simd< T, SZ > cl::sycl::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 cl::sycl::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 > > cl::sycl::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 cl::sycl::ext::intel::esimd::hmax (simd< T1, SZ > v)
 ESIMD_DETAIL. More...
 
template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 cl::sycl::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 cl::sycl::ext::intel::esimd::reduce (simd< T1, SZ > v, BinaryOperation op)
 Performs reduction over elements of the input vector. More...
 
template<typename T0 , typename T1 , typename U , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_dword_type< T0 >::value &&__ESIMD_DNS::is_dword_type< T1 >::value &&__ESIMD_DNS::is_dword_type< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T0, SZ > &rmd, sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1)
 
template<typename T0 , typename T1 , typename U , int SZ>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T0, SZ > &rmd, U src0, sycl::ext::intel::esimd::simd< T1, SZ > src1)
 
template<typename T0 , typename T , typename U >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T >::value &&__ESIMD_DNS::is_esimd_scalar< U >::value &&__ESIMD_DNS::is_esimd_scalar< T0 >::value, T0 > cl::sycl::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T0, 1 > &rmd, T src0, U src1)
 
template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::quot (sycl::ext::intel::esimd::simd< T, SZ > src0, U src1)
 Integral quotient (vector version) More...
 
template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::quot (T0 src0, T1 src1)
 Integral quotient (scalar version) More...
 
template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::mod (sycl::ext::intel::esimd::simd< T, SZ > src0, U src1)
 Modulo (vector version) More...
 
template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::mod (T0 src0, T1 src1)
 Modulo (scalar version) More...
 
template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::div (sycl::ext::intel::esimd::simd< T, SZ > &remainder, sycl::ext::intel::esimd::simd< T, SZ > src0, U src1)
 Integral division with a vector dividend and a scalar divisor. More...
 
template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&std::is_integral< U >::value &&__ESIMD_DNS::is_esimd_scalar< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::div (sycl::ext::intel::esimd::simd< T, SZ > &remainder, U src0, sycl::ext::intel::esimd::simd< T, SZ > src1)
 Integral division with a scalar dividend and a vector divisor. More...
 
template<typename RT , typename T0 , typename T1 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< RT >::value &&__ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value, std::remove_const_t< RT > > cl::sycl::ext::intel::experimental::esimd::div (sycl::ext::intel::esimd::simd< std::remove_const_t< RT >, 1 > &remainder, T0 src0, T1 src1)
 Integral division (scalar version). More...
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T1 >::value &&std::is_floating_point< T1 >::value &&__ESIMD_DNS::is_fp_or_dword_type< U >::value &&std::is_floating_point< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::dp2 (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Dot product on groups of 4 elements. More...
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T1 >::value &&std::is_floating_point< T1 >::value &&__ESIMD_DNS::is_fp_or_dword_type< U >::value &&std::is_floating_point< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::dp3 (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Dot product on groups of 4 elements. More...
 
template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T1 >::value &&std::is_floating_point< T1 >::value &&__ESIMD_DNS::is_fp_or_dword_type< U >::value &&std::is_floating_point< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::dp4 (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Dot product on groups of 4 elements. More...
 
template<typename T , typename U , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T >::value &&std::is_floating_point< T >::value &&__ESIMD_DNS::is_fp_or_dword_type< U >::value &&std::is_floating_point< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::dph (sycl::ext::intel::esimd::simd< T, SZ > src0, U src1, Sat sat={})
 Dot product on groups of 4 elements. More...
 
template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T >::value &&std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::line (sycl::ext::intel::esimd::simd< T, 4 > src0, sycl::ext::intel::esimd::simd< T, SZ > src1, Sat sat={})
 Linear equation. More...
 
template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T >::value &&std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::line (float P, float Q, sycl::ext::intel::esimd::simd< T, SZ > src1, Sat sat={})
 Linear equation. More...
 
template<typename T , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd< T, SZ > cl::sycl::ext::intel::experimental::esimd::frc (sycl::ext::intel::esimd::simd< T, SZ > src0)
 Performs component-wise truncate-to-minus-infinity fraction operation of src0. More...
 
template<typename T >
__ESIMD_API T cl::sycl::ext::intel::experimental::esimd::frc (T src0)
 Performs truncate-to-minus-infinity fraction operation of src0. More...
 
template<typename RT , typename T0 , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API sycl::ext::intel::esimd::simd< RT, SZ > cl::sycl::ext::intel::experimental::esimd::lzd (sycl::ext::intel::esimd::simd< T0, SZ > src0, Sat sat={})
 
template<typename RT , typename T0 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< RT >::value &&__ESIMD_DNS::is_esimd_scalar< T0 >::value, std::remove_const_t< RT > > cl::sycl::ext::intel::experimental::esimd::lzd (T0 src0, Sat sat={})
 
template<typename T , int SZ, typename U , typename V , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_fp_or_dword_type< T >::value &&std::is_floating_point< T >::value &&__ESIMD_DNS::is_fp_or_dword_type< U >::value &&std::is_floating_point< U >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::lrp (sycl::ext::intel::esimd::simd< T, SZ > src0, U src1, V src2, Sat sat={})
 
template<int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API sycl::ext::intel::esimd::simd< float, SZ > cl::sycl::ext::intel::experimental::esimd::sincos (sycl::ext::intel::esimd::simd< float, SZ > &dstcos, U src0, Sat sat={})
 
template<typename T , int SZ>
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::atan (sycl::ext::intel::esimd::simd< T, SZ > src0)
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_floating_point< T >::value, Tcl::sycl::ext::intel::experimental::esimd::atan (T src0)
 
template<typename T , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::acos (sycl::ext::intel::esimd::simd< T, SZ > src0)
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_floating_point< T >::value, Tcl::sycl::ext::intel::experimental::esimd::acos (T src0)
 
template<typename T , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > cl::sycl::ext::intel::experimental::esimd::asin (sycl::ext::intel::esimd::simd< T, SZ > src0)
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_floating_point< T >::value, Tcl::sycl::ext::intel::experimental::esimd::asin (T src0)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::atan2_fast (sycl::ext::intel::esimd::simd< float, N > y, sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float cl::sycl::ext::intel::experimental::esimd::atan2_fast (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::atan2 (sycl::ext::intel::esimd::simd< float, N > y, sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float cl::sycl::ext::intel::experimental::esimd::atan2 (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::fmod (sycl::ext::intel::esimd::simd< float, N > y, sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float cl::sycl::ext::intel::experimental::esimd::fmod (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::sin_emu (sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float cl::sycl::ext::intel::experimental::esimd::sin_emu (T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::cos_emu (sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float cl::sycl::ext::intel::experimental::esimd::cos_emu (T x)
 
float cl::sycl::ext::intel::experimental::esimd::tanh_cody_waite (float x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::tanh_cody_waite (sycl::ext::intel::esimd::simd< float, N > x)
 
float cl::sycl::ext::intel::experimental::esimd::tanh (float x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > cl::sycl::ext::intel::experimental::esimd::tanh (sycl::ext::intel::esimd::simd< float, N > x)
 
template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::atan2_fast (float y, float x)
 
template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::atan2 (float y, float x)
 
template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::fmod (float y, float x)
 
template<typename T , int N>
sycl::ext::intel::esimd::simd< T, N > cl::sycl::ext::intel::experimental::esimd::dp4 (sycl::ext::intel::esimd::simd< T, N > v1, sycl::ext::intel::esimd::simd< T, N > v2)
 

Detailed Description

Defines math operations on ESIMD vector data types.

Function Documentation

◆ abs() [1/4]

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

Get absolute value (vector version)

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

Definition at line 129 of file math.hpp.

◆ abs() [2/4]

template<typename T1 , int SZ>
__ESIMD_API simd<T1, SZ> cl::sycl::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 155 of file math.hpp.

◆ abs() [3/4]

template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t< !std::is_same<std::remove_const_t<T0>, std::remove_const_t<T1> >::value && detail::is_esimd_scalar<T0>::value && detail::is_esimd_scalar<T1>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::esimd::abs ( T1  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 144 of file math.hpp.

◆ abs() [4/4]

template<typename T1 >
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T1>::value, std::remove_const_t<T1> > cl::sycl::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 168 of file math.hpp.

Referenced by cl::sycl::ext::intel::experimental::esimd::acos(), cl::sycl::ext::intel::experimental::esimd::asin(), cl::sycl::ext::intel::experimental::esimd::atan(), and cl::sycl::ext::intel::experimental::esimd::fmod().

◆ acos() [1/2]

template<typename T , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::acos ( sycl::ext::intel::esimd::simd< T, SZ >  src0)

◆ acos() [2/2]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_floating_point<T>::value, T> cl::sycl::ext::intel::experimental::esimd::acos ( T  src0)

Definition at line 1205 of file math.hpp.

Referenced by cl::sycl::ext::intel::experimental::esimd::asin().

◆ asin() [1/2]

template<typename T , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::asin ( sycl::ext::intel::esimd::simd< T, SZ >  src0)

◆ asin() [2/2]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_floating_point<T>::value, T> cl::sycl::ext::intel::experimental::esimd::asin ( T  src0)

Definition at line 1227 of file math.hpp.

◆ atan() [1/2]

template<typename T , int SZ>
ESIMD_DETAIL ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::atan ( sycl::ext::intel::esimd::simd< T, SZ >  src0)

◆ atan() [2/2]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_floating_point<T>::value, T> cl::sycl::ext::intel::experimental::esimd::atan ( T  src0)

Definition at line 1167 of file math.hpp.

Referenced by cl::sycl::ext::intel::experimental::esimd::atan2().

◆ atan2() [1/3]

template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::atan2 ( float  y,
float  x 
)

◆ atan2() [2/3]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::atan2 ( sycl::ext::intel::esimd::simd< float, N >  y,
sycl::ext::intel::esimd::simd< float, N >  x 
)

◆ atan2() [3/3]

template<typename T >
float cl::sycl::ext::intel::experimental::esimd::atan2 ( T  y,
T  x 
)

Definition at line 80 of file builtins.hpp.

◆ atan2_fast() [1/3]

template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::atan2_fast ( float  y,
float  x 
)

Definition at line 1329 of file math.hpp.

References cl::sycl::ext::intel::experimental::esimd::atan2().

◆ atan2_fast() [2/3]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::atan2_fast ( sycl::ext::intel::esimd::simd< float, N >  y,
sycl::ext::intel::esimd::simd< float, N >  x 
)

Definition at line 1303 of file math.hpp.

References cl::sycl::ext::intel::experimental::esimd::atan2().

◆ atan2_fast() [3/3]

template<typename T >
float cl::sycl::ext::intel::experimental::esimd::atan2_fast ( T  y,
T  x 
)

◆ cos_emu() [1/2]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::cos_emu ( sycl::ext::intel::esimd::simd< float, N >  x)

◆ cos_emu() [2/2]

template<typename T >
float cl::sycl::ext::intel::experimental::esimd::cos_emu ( T  x)

◆ div() [1/3]

template<typename RT , typename T0 , typename T1 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<RT>::value && __ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value, std::remove_const_t<RT> > cl::sycl::ext::intel::experimental::esimd::div ( sycl::ext::intel::esimd::simd< std::remove_const_t< RT >, 1 > &  remainder,
T0  src0,
T1  src1 
)

Integral division (scalar version).

Computes quotient and remainder of division.

Template Parameters
RTelement type of the output remainder vector.
T0element type of the dividend src0.
T1element type of the divisor src1.
Parameters
[out]remainderthe vector of size 1 with a remainder from division.
src0the dividend scalar value.
src1the divisor scalar value.
Returns
scalar quotient value.

Definition at line 582 of file math.hpp.

References cl::sycl::remainder().

◆ div() [2/3]

template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::div ( sycl::ext::intel::esimd::simd< T, SZ > &  remainder,
sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1 
)

Integral division with a vector dividend and a scalar divisor.

Computes quotient and remainder of division.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Utype of scalar operand src1.
Parameters
[out]remainderthe vector of remainders from a division operation.
src0the dividend input vector.
src1the divisor scalar value.
Returns
vector of quotient elements.

Definition at line 541 of file math.hpp.

References cl::sycl::remainder().

◆ div() [3/3]

template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && std::is_integral<U>::value && __ESIMD_DNS::is_esimd_scalar<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::div ( sycl::ext::intel::esimd::simd< T, SZ > &  remainder,
src0,
sycl::ext::intel::esimd::simd< T, SZ >  src1 
)

Integral division with a scalar dividend and a vector divisor.

Computes quotient and remainder of division.

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Utype of scalar operand src1.
Parameters
[out]remainderthe vector of remainders from a division operation.
src0the dividend scalar value.
src1the divisor input vector.
Returns
vector of quotient elements.

Definition at line 561 of file math.hpp.

References cl::sycl::remainder().

◆ dp2()

template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T1>::value && std::is_floating_point<T1>::value && __ESIMD_DNS::is_fp_or_dword_type<U>::value && std::is_floating_point<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::dp2 ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Dot product on groups of 4 elements.

Template Parameters
T0element type of the returned vector.
T1element type of the input vector. Must be a float type.
SZsize of the input and returned vectors. Must be a multiple of 4.
Utype of scalar operand src1. Must be a float type.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of elements.

Definition at line 767 of file math.hpp.

◆ dp3()

template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T1>::value && std::is_floating_point<T1>::value && __ESIMD_DNS::is_fp_or_dword_type<U>::value && std::is_floating_point<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::dp3 ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Dot product on groups of 4 elements.

Template Parameters
T0element type of the returned vector.
T1element type of the input vector. Must be a float type.
SZsize of the input and returned vectors. Must be a multiple of 4.
Utype of scalar operand src1. Must be a float type.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of elements.

Definition at line 800 of file math.hpp.

◆ dp4() [1/2]

template<typename T , int N>
sycl::ext::intel::esimd::simd<T, N> cl::sycl::ext::intel::experimental::esimd::dp4 ( sycl::ext::intel::esimd::simd< T, N >  v1,
sycl::ext::intel::esimd::simd< T, N >  v2 
)

Definition at line 1641 of file math.hpp.

◆ dp4() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T1>::value && std::is_floating_point<T1>::value && __ESIMD_DNS::is_fp_or_dword_type<U>::value && std::is_floating_point<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::dp4 ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Dot product on groups of 4 elements.

Template Parameters
T0element type of the returned vector.
T1element type of the input vector. Must be a float type.
SZsize of the input and returned vectors. Must be a multiple of 4.
Utype of scalar operand src1. Must be a float type.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of elements.

Definition at line 834 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> > cl::sycl::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 862 of file math.hpp.

◆ dph()

template<typename T , typename U , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T>::value && std::is_floating_point<T>::value && __ESIMD_DNS::is_fp_or_dword_type<U>::value && std::is_floating_point<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::dph ( sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1,
Sat  sat = {} 
)

Dot product on groups of 4 elements.

Template Parameters
T0element type of the returned vector.
T1element type of the input vector. Must be a float type.
SZsize of the input and returned vectors. Must be a multiple of 4.
Utype of scalar operand src1. Must be a float type.
Parameters
src0the input vector.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of elements.

Definition at line 869 of file math.hpp.

◆ exp() [1/2]

template<class T , int SZ, class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE simd<T, SZ> cl::sycl::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 493 of file math.hpp.

◆ exp() [2/2]

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

Definition at line 499 of file math.hpp.

◆ fmod() [1/3]

template<>
ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::fmod ( float  y,
float  x 
)

◆ fmod() [2/3]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::fmod ( sycl::ext::intel::esimd::simd< float, N >  y,
sycl::ext::intel::esimd::simd< float, N >  x 
)

◆ fmod() [3/3]

template<typename T >
float cl::sycl::ext::intel::experimental::esimd::fmod ( T  y,
T  x 
)

Definition at line 229 of file builtins.hpp.

◆ frc() [1/2]

template<typename T , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd<T, SZ> cl::sycl::ext::intel::experimental::esimd::frc ( sycl::ext::intel::esimd::simd< T, SZ >  src0)

Performs component-wise truncate-to-minus-infinity fraction operation of src0.

(vector version)

Template Parameters
Telement type of the input vector src0 and returned vector.
SZsize of the second input vector and returned vectors.
Parameters
src0the input vector.
Returns
vector of elements after fraction operation.

Definition at line 948 of file math.hpp.

◆ frc() [2/2]

template<typename T >
__ESIMD_API T cl::sycl::ext::intel::experimental::esimd::frc ( T  src0)

Performs truncate-to-minus-infinity fraction operation of src0.

(scalar version)

Template Parameters
Telement type of the input src0 and returned value.
Parameters
src0the input scalar value.
Returns
result of a fraction operation.

Definition at line 958 of file math.hpp.

◆ hmax()

template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 cl::sycl::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 1043 of file math.hpp.

◆ hmin()

template<typename T0 , typename T1 , int SZ>
ESIMD_INLINE ESIMD_NODEBUG T0 cl::sycl::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 1056 of file math.hpp.

◆ imul() [1/3]

template<typename T0 , typename T , typename U >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T>::value && __ESIMD_DNS::is_esimd_scalar<U>::value && __ESIMD_DNS::is_esimd_scalar<T0>::value, T0> cl::sycl::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T0, 1 > &  rmd,
T  src0,
src1 
)

Definition at line 458 of file math.hpp.

Referenced by cl::sycl::ext::intel::experimental::esimd::imul().

◆ imul() [2/3]

template<typename T0 , typename T1 , typename U , int SZ>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_dword_type<T0>::value && __ESIMD_DNS::is_dword_type<T1>::value && __ESIMD_DNS::is_dword_type<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T0, SZ > &  rmd,
sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1 
)

Definition at line 397 of file math.hpp.

◆ imul() [3/3]

template<typename T0 , typename T1 , typename U , int SZ>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T0, SZ > &  rmd,
src0,
sycl::ext::intel::esimd::simd< T1, SZ >  src1 
)

Definition at line 447 of file math.hpp.

References cl::sycl::ext::intel::experimental::esimd::imul().

◆ line() [1/2]

template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T>::value && std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::line ( float  P,
float  Q,
sycl::ext::intel::esimd::simd< T, SZ >  src1,
Sat  sat = {} 
)

Linear equation.

Template Parameters
Telement type of the first input vector src0. Must be a float type.
SZsize of the second input vector and returned vectors. Must be a multiple of 4.
Parameters
Pthe first input value.
Qthe second input value.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
resulting vector from linear equation operation.

Definition at line 933 of file math.hpp.

◆ line() [2/2]

template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T>::value && std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::line ( sycl::ext::intel::esimd::simd< T, 4 >  src0,
sycl::ext::intel::esimd::simd< T, SZ >  src1,
Sat  sat = {} 
)

Linear equation.

Template Parameters
Telement type of the second input vector src1 and returned vector. Must be a float type.
SZsize of the second input vector and returned vectors. Must be a multiple of 4.
Parameters
src0the first input vector of size 4.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
resulting vector from linear equation operation.

Definition at line 900 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> cl::sycl::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 472 of file math.hpp.

◆ log() [2/2]

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

Definition at line 484 of file math.hpp.

◆ lrp()

template<typename T , int SZ, typename U , typename V , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_fp_or_dword_type<T>::value && std::is_floating_point<T>::value && __ESIMD_DNS::is_fp_or_dword_type<U>::value && std::is_floating_point<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::lrp ( sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1,
src2,
Sat  sat = {} 
)

Definition at line 1025 of file math.hpp.

◆ lzd() [1/2]

template<typename RT , typename T0 , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API sycl::ext::intel::esimd::simd<RT, SZ> cl::sycl::ext::intel::experimental::esimd::lzd ( sycl::ext::intel::esimd::simd< T0, SZ >  src0,
Sat  sat = {} 
)

Definition at line 967 of file math.hpp.

◆ lzd() [2/2]

template<typename RT , typename T0 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<RT>::value && __ESIMD_DNS::is_esimd_scalar<T0>::value, std::remove_const_t<RT> > cl::sycl::ext::intel::experimental::esimd::lzd ( T0  src0,
Sat  sat = {} 
)

Definition at line 979 of file math.hpp.

◆ max() [1/4]

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

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.

Definition at line 182 of file math.hpp.

◆ max() [2/4]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T>::value, simd<T, SZ> > cl::sycl::ext::intel::esimd::max ( simd< T, SZ >  src0,
T  src1,
Sat  sat = {} 
)

Selects maximums for each element of the input vector and a scalar.

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 scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

Definition at line 215 of file math.hpp.

◆ max() [3/4]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T>::value, simd<T, SZ> > cl::sycl::ext::intel::esimd::max ( T  src0,
simd< T, SZ >  src1,
Sat  sat = {} 
)

Selects maximums for each element of the input scalar and a vector.

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 scalar value.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise maximum elements.

Definition at line 233 of file math.hpp.

◆ max() [4/4]

template<typename T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<detail::is_esimd_scalar<T>::value, T> cl::sycl::ext::intel::esimd::max ( T  src0,
T  src1,
Sat  sat = {} 
)

Selects maximum between two scalar values.

(scalar version) The source operands must be both of integer or both of floating-point type.

Template Parameters
Telement type of the input and return vectors.
Parameters
src0the scalar value.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
maximum value between the two inputs.

Definition at line 250 of file math.hpp.

◆ min() [1/4]

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

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.

Definition at line 267 of file math.hpp.

◆ min() [2/4]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T>::value, simd<T, SZ> > cl::sycl::ext::intel::esimd::min ( simd< T, SZ >  src0,
T  src1,
Sat  sat = {} 
)

Selects minimums for each element of the input vector and a scalar.

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 scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

Definition at line 300 of file math.hpp.

◆ min() [3/4]

template<typename T , int SZ, class Sat = saturation_off_tag>
__ESIMD_API std::enable_if_t<detail::is_esimd_scalar<T>::value, simd<T, SZ> > cl::sycl::ext::intel::esimd::min ( T  src0,
simd< T, SZ >  src1,
Sat  sat = {} 
)

Selects minimums for each element of the input scalar and a vector.

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 scalar value.
src1the input vector.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of component-wise minimum elements.

Definition at line 318 of file math.hpp.

◆ min() [4/4]

template<typename T , class Sat = saturation_off_tag>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<detail::is_esimd_scalar<T>::value, T> cl::sycl::ext::intel::esimd::min ( T  src0,
T  src1,
Sat  sat = {} 
)

Selects minimum between two scalar values.

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

Template Parameters
Telement type of the input and return vectors.
Parameters
src0the scalar value.
src1the scalar value.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
minimum value between the two inputs.

Definition at line 335 of file math.hpp.

◆ mod() [1/2]

template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::mod ( sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1 
)

Modulo (vector version)

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Utype of scalar operand src1.
Parameters
src0the dividend input vector.
src1the divisor scalar value.
Returns
vector of elements after applying modulo operation.

Definition at line 508 of file math.hpp.

◆ mod() [2/2]

template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && std::is_integral<T0>::value && std::is_integral<T1>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::mod ( T0  src0,
T1  src1 
)

Modulo (scalar version)

Template Parameters
T0element type of the dividend src0 and returned value.
T1element type of the divisor src1.
Parameters
src0the dividend.
src1the divisor.
Returns
Modulo value.

Definition at line 524 of file math.hpp.

◆ quot() [1/2]

template<typename T , int SZ, typename U >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T, SZ> > cl::sycl::ext::intel::experimental::esimd::quot ( sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1 
)

Integral quotient (vector version)

Template Parameters
Telement type of the input and return vectors.
SZsize of the input and returned vectors.
Utype of scalar operand src1.
Parameters
src0the dividend input vector.
src1the divisor scalar value.
Returns
vector of quotient elements.

Definition at line 477 of file math.hpp.

◆ quot() [2/2]

template<typename T0 , typename T1 >
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && std::is_integral<T0>::value && std::is_integral<T1>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::quot ( T0  src0,
T1  src1 
)

Integral quotient (scalar version)

Template Parameters
T0element type of the dividend src0 and returned value.
T1element type of the divisor src1.
Parameters
src0the dividend.
src1the divisor.
Returns
quotient value.

Definition at line 493 of file math.hpp.

◆ reduce()

template<typename T0 , typename T1 , int SZ, typename BinaryOperation >
ESIMD_INLINE ESIMD_NODEBUG T0 cl::sycl::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 1076 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> > cl::sycl::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:

    • -1 if src[i] is less than -1
    • 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 71 of file math.hpp.

◆ sin_emu() [1/2]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::sin_emu ( sycl::ext::intel::esimd::simd< float, N >  x)

◆ sin_emu() [2/2]

template<typename T >
float cl::sycl::ext::intel::experimental::esimd::sin_emu ( T  x)

◆ sincos()

template<int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API sycl::ext::intel::esimd::simd<float, SZ> cl::sycl::ext::intel::experimental::esimd::sincos ( sycl::ext::intel::esimd::simd< float, SZ > &  dstcos,
src0,
Sat  sat = {} 
)

Definition at line 1125 of file math.hpp.

◆ tanh() [1/2]

ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::tanh ( float  x)

Definition at line 1631 of file math.hpp.

◆ tanh() [2/2]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::tanh ( sycl::ext::intel::esimd::simd< float, N >  x)

Definition at line 1636 of file math.hpp.

◆ tanh_cody_waite() [1/2]

ESIMD_DETAIL ESIMD_INLINE float cl::sycl::ext::intel::experimental::esimd::tanh_cody_waite ( float  x)

Definition at line 1619 of file math.hpp.

◆ tanh_cody_waite() [2/2]

template<int N>
sycl::ext::intel::esimd::simd<float, N> cl::sycl::ext::intel::experimental::esimd::tanh_cody_waite ( sycl::ext::intel::esimd::simd< float, N >  x)

Definition at line 1625 of file math.hpp.