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...
 
template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API sycl::ext::intel::esimd::simd< T, N > sycl::_V1::ext::intel::experimental::esimd::imul_impl (sycl::ext::intel::esimd::simd< T, N > &rmd, sycl::ext::intel::esimd::simd< T0, N > src0, sycl::ext::intel::esimd::simd< T1, N > src1)
 Computes the 64-bit result of two 32-bit element vectors src0 and src1 multiplication. More...
 
template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API sycl::ext::intel::esimd::simd< T, N > sycl::_V1::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T, N > &rmd, sycl::ext::intel::esimd::simd< T0, N > src0, sycl::ext::intel::esimd::simd< T1, N > src1)
 Computes the 64-bit multiply result of two 32-bit integer vectors src0 and src1. More...
 
template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_dword_type< T1 >::value, sycl::ext::intel::esimd::simd< T, N > > sycl::_V1::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T, N > &rmd, sycl::ext::intel::esimd::simd< T0, N > src0, T1 src1)
 Computes the 64-bit multiply result of 32-bit integer vector src0 and 32-bit integer scalar src1. More...
 
template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_dword_type< T0 >::value, sycl::ext::intel::esimd::simd< T, N > > sycl::_V1::ext::intel::experimental::esimd::imul (sycl::ext::intel::esimd::simd< T, N > &rmd, T0 src0, sycl::ext::intel::esimd::simd< T1, N > src1)
 Computes the 64-bit multiply result of a scalar 32-bit integer src0 and 32-bit integer vector src1. More...
 
template<typename T , typename T0 , typename T1 >
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_dword_type< T >::value &&__ESIMD_DNS::is_dword_type< T0 >::value &&__ESIMD_DNS::is_dword_type< T1 >::value, T > sycl::_V1::ext::intel::experimental::esimd::imul (T &rmd, T0 src0, T1 src1)
 Computes the 64-bit multiply result of two scalar 32-bit integer values src0 and src1. More...
 
template<int N>
 sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ("Please use sycl::ext::intel::esimd::addc(carry, src0, src1);") __ESIMD_API sycl
 
 sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ("Please use sycl::ext::intel::esimd::addc(carry, src0, src1);") __ESIMD_API uint32_t addc(uint32_t &carry
 
template<int N>
 sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ("Please use sycl::ext::intel::esimd::subb(borrow, src0, src1);") __ESIMD_API sycl
 
 sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ("Please use sycl::ext::intel::esimd::subb(borrow, src0, src1);") __ESIMD_API uint32_t subb(uint32_t &borrow
 
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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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_API 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 > > sycl::_V1::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 > sycl::_V1::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 sycl::_V1::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 > sycl::_V1::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_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< RT >::value &&__ESIMD_DNS::is_esimd_scalar< T0 >::value, std::remove_const_t< RT > > sycl::_V1::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_API 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 > > sycl::_V1::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 > sycl::_V1::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_API sycl::ext::intel::esimd::simd< T, SZ > sycl::_V1::ext::intel::experimental::esimd::atan (sycl::ext::intel::esimd::simd< T, SZ > src0)
 
template<typename T >
__ESIMD_API T sycl::_V1::ext::intel::experimental::esimd::atan (T src0)
 
template<typename T , int SZ>
__ESIMD_API std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > sycl::_V1::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, T > sycl::_V1::ext::intel::experimental::esimd::acos (T src0)
 
template<typename T , int SZ>
__ESIMD_API std::enable_if_t< std::is_floating_point< T >::value, sycl::ext::intel::esimd::simd< T, SZ > > sycl::_V1::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, T > sycl::_V1::ext::intel::experimental::esimd::asin (T src0)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::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 sycl::_V1::ext::intel::experimental::esimd::atan2_fast (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::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 sycl::_V1::ext::intel::experimental::esimd::atan2 (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::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 sycl::_V1::ext::intel::experimental::esimd::fmod (T y, T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::ext::intel::experimental::esimd::sin_emu (sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float sycl::_V1::ext::intel::experimental::esimd::sin_emu (T x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::ext::intel::experimental::esimd::cos_emu (sycl::ext::intel::esimd::simd< float, N > x)
 
template<typename T >
float sycl::_V1::ext::intel::experimental::esimd::cos_emu (T x)
 
float sycl::_V1::ext::intel::experimental::esimd::tanh_cody_waite (float x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::ext::intel::experimental::esimd::tanh_cody_waite (sycl::ext::intel::esimd::simd< float, N > x)
 
float sycl::_V1::ext::intel::experimental::esimd::tanh (float x)
 
template<int N>
sycl::ext::intel::esimd::simd< float, N > sycl::_V1::ext::intel::experimental::esimd::tanh (sycl::ext::intel::esimd::simd< float, N > x)
 
template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::atan2_fast (float y, float x)
 
template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::atan2 (float y, float x)
 
template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::fmod (float y, float x)
 
template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::sin_emu (float x0)
 
template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::cos_emu (float x0)
 
template<typename T , int N>
sycl::ext::intel::esimd::simd< T, N > sycl::_V1::ext::intel::experimental::esimd::dp4 (sycl::ext::intel::esimd::simd< T, N > v1, sycl::ext::intel::esimd::simd< T, N > v2)
 
template<int N>
ESIMD_INLINE sycl::ext::intel::esimd::simd< sycl::half, N > sycl::_V1::ext::intel::experimental::esimd::srnd (sycl::ext::intel::esimd::simd< float, N > src0, sycl::ext::intel::esimd::simd< uint16_t, N > src1)
 srnd - perform stochastic rounding. 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
 
uint32_t sycl::_V1::ext::intel::experimental::esimd::src0
 
uint32_t uint32_t sycl::_V1::ext::intel::experimental::esimd::src1
 

Detailed Description

Defines math operations on ESIMD vector data types.

Function Documentation

◆ __SYCL_DEPRECATED() [1/4]

template<int N>
sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ( "Please use sycl::ext::intel::esimd::addc(carry, src0, src1);"  )

◆ __SYCL_DEPRECATED() [2/4]

sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ( "Please use sycl::ext::intel::esimd::addc(carry, src0, src1);"  ) &

◆ __SYCL_DEPRECATED() [3/4]

template<int N>
sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ( "Please use sycl::ext::intel::esimd::subb(borrow, src0, src1);"  )

◆ __SYCL_DEPRECATED() [4/4]

sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED ( "Please use sycl::ext::intel::esimd::subb(borrow, src0, src1);"  ) &

◆ 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 153 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 127 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 166 of file math.hpp.

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

Referenced by sycl::_V1::ext::intel::experimental::esimd::acos(), sycl::_V1::ext::intel::experimental::esimd::asin(), sycl::_V1::ext::intel::experimental::esimd::atan(), sycl::_V1::ext::intel::experimental::esimd::atan2(), sycl::_V1::ext::intel::experimental::esimd::atan2_fast(), syclcompat::cabs(), sycl::_V1::ext::intel::experimental::esimd::fmod(), 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 142 of file math.hpp.

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

◆ acos() [1/2]

template<typename T , int SZ>
__ESIMD_API std::enable_if_t<std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > sycl::_V1::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> sycl::_V1::ext::intel::experimental::esimd::acos ( 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 1187 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 1205 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 1219 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 1231 of file math.hpp.

Referenced by sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED().

◆ asin() [1/2]

template<typename T , int SZ>
__ESIMD_API std::enable_if_t<std::is_floating_point<T>::value, sycl::ext::intel::esimd::simd<T, SZ> > sycl::_V1::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> sycl::_V1::ext::intel::experimental::esimd::asin ( src0)

◆ atan() [1/2]

◆ atan() [2/2]

template<typename T >
__ESIMD_API T sycl::_V1::ext::intel::experimental::esimd::atan ( src0)

◆ atan2() [1/3]

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

Definition at line 1469 of file math.hpp.

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

◆ atan2() [2/3]

◆ atan2() [3/3]

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

◆ atan2_fast() [1/3]

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

◆ atan2_fast() [2/3]

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

◆ atan2_fast() [3/3]

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

◆ cos_emu() [1/3]

template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::cos_emu ( float  x0)

Definition at line 1552 of file math.hpp.

References sycl::_V1::ext::intel::experimental::esimd::cos_emu().

◆ cos_emu() [2/3]

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

◆ cos_emu() [3/3]

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

◆ div() [1/3]

template<typename RT , typename T0 , typename T1 >
__ESIMD_API 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> > sycl::_V1::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 683 of file math.hpp.

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

◆ 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> > sycl::_V1::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 642 of file math.hpp.

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

◆ 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> > sycl::_V1::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 662 of file math.hpp.

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

◆ dp2()

template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::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 876 of file math.hpp.

◆ dp3()

template<typename T0 , typename T1 , int SZ, typename U , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::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 910 of file math.hpp.

◆ dp4() [1/2]

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

Definition at line 1662 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_API 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> > sycl::_V1::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 945 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 861 of file math.hpp.

◆ dph()

template<typename T , typename U , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::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 981 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 491 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 497 of file math.hpp.

◆ fmod() [1/3]

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

Definition at line 1499 of file math.hpp.

References sycl::_V1::ext::intel::experimental::esimd::fmod().

◆ fmod() [2/3]

template<int N>
sycl::ext::intel::esimd::simd<float, N> sycl::_V1::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 sycl::_V1::ext::intel::experimental::esimd::fmod ( y,
x 
)

◆ frc() [1/2]

template<typename T , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd<T, SZ> sycl::_V1::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 1064 of file math.hpp.

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

◆ frc() [2/2]

template<typename T >
__ESIMD_API T sycl::_V1::ext::intel::experimental::esimd::frc ( 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 1074 of file math.hpp.

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

◆ 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 1034 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 1047 of file math.hpp.

◆ imul() [1/4]

template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API sycl::ext::intel::esimd::simd<T, N> sycl::_V1::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T, N > &  rmd,
sycl::ext::intel::esimd::simd< T0, N >  src0,
sycl::ext::intel::esimd::simd< T1, N >  src1 
)

Computes the 64-bit multiply result of two 32-bit integer vectors src0 and src1.

The result is returned in two separate 32-bit vectors. The low 32-bit parts of the result are written to the output parameter rmd and the upper parts of the result are returned from the function.

Definition at line 448 of file math.hpp.

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

◆ imul() [2/4]

template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_dword_type<T1>::value, sycl::ext::intel::esimd::simd<T, N> > sycl::_V1::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T, N > &  rmd,
sycl::ext::intel::esimd::simd< T0, N >  src0,
T1  src1 
)

Computes the 64-bit multiply result of 32-bit integer vector src0 and 32-bit integer scalar src1.

The result is returned in two separate 32-bit vectors. The low 32-bit parts of the result is written to the output parameter rmd and the upper part of the results is returned from the function.

Definition at line 462 of file math.hpp.

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

◆ imul() [3/4]

template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_dword_type<T0>::value, sycl::ext::intel::esimd::simd<T, N> > sycl::_V1::ext::intel::experimental::esimd::imul ( sycl::ext::intel::esimd::simd< T, N > &  rmd,
T0  src0,
sycl::ext::intel::esimd::simd< T1, N >  src1 
)

Computes the 64-bit multiply result of a scalar 32-bit integer src0 and 32-bit integer vector src1.

The result is returned in two separate 32-bit vectors. The low 32-bit parts of the result is written to the output parameter rmd and the upper part of the results is returned from the function.

Definition at line 475 of file math.hpp.

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

◆ imul() [4/4]

template<typename T , typename T0 , typename T1 >
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_dword_type<T>::value && __ESIMD_DNS::is_dword_type<T0>::value && __ESIMD_DNS::is_dword_type<T1>::value, T> sycl::_V1::ext::intel::experimental::esimd::imul ( T &  rmd,
T0  src0,
T1  src1 
)

Computes the 64-bit multiply result of two scalar 32-bit integer values src0 and src1.

The result is returned in two separate 32-bit scalars. The low 32-bit part of the result is written to the output parameter rmd and the upper part of the result is returned from the function.

Definition at line 489 of file math.hpp.

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

◆ imul_impl()

template<typename T , typename T0 , typename T1 , int N>
__ESIMD_API sycl::ext::intel::esimd::simd<T, N> sycl::_V1::ext::intel::experimental::esimd::imul_impl ( sycl::ext::intel::esimd::simd< T, N > &  rmd,
sycl::ext::intel::esimd::simd< T0, N >  src0,
sycl::ext::intel::esimd::simd< T1, N >  src1 
)

Computes the 64-bit result of two 32-bit element vectors src0 and src1 multiplication.

The result is returned in two separate 32-bit vectors. The low 32-bit parts of the results are written to the output parameter rmd and the upper parts of the results are returned from the function.

Definition at line 415 of file math.hpp.

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

◆ line() [1/2]

template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::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 1047 of file math.hpp.

◆ line() [2/2]

template<typename T , int SZ, class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::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 1013 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 470 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 482 of file math.hpp.

◆ lrp()

template<typename T , int SZ, typename U , typename V , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API 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> > sycl::_V1::ext::intel::experimental::esimd::lrp ( sycl::ext::intel::esimd::simd< T, SZ >  src0,
src1,
src2,
Sat  sat = {} 
)

Definition at line 1141 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> sycl::_V1::ext::intel::experimental::esimd::lzd ( sycl::ext::intel::esimd::simd< T0, SZ >  src0,
Sat  sat = {} 
)

Definition at line 1083 of file math.hpp.

◆ lzd() [2/2]

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

Definition at line 1094 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 211 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 247 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 296 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 332 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> > sycl::_V1::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 608 of file math.hpp.

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

◆ 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> > sycl::_V1::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 625 of file math.hpp.

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

◆ 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> > sycl::_V1::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 576 of file math.hpp.

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

◆ 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> > sycl::_V1::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 593 of file math.hpp.

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

◆ 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 1307 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 1067 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.

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

◆ sin_emu() [1/3]

template<>
ESIMD_INLINE float sycl::_V1::ext::intel::experimental::esimd::sin_emu ( float  x0)

Definition at line 1540 of file math.hpp.

References sycl::_V1::ext::intel::experimental::esimd::sin_emu().

◆ sin_emu() [2/3]

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

◆ sin_emu() [3/3]

template<typename T >
float sycl::_V1::ext::intel::experimental::esimd::sin_emu ( 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> sycl::_V1::ext::intel::experimental::esimd::sincos ( sycl::ext::intel::esimd::simd< float, SZ > &  dstcos,
src0,
Sat  sat = {} 
)

Definition at line 1240 of file math.hpp.

◆ srnd()

template<int N>
ESIMD_INLINE sycl::ext::intel::esimd::simd<sycl::half, N> sycl::_V1::ext::intel::experimental::esimd::srnd ( sycl::ext::intel::esimd::simd< float, N >  src0,
sycl::ext::intel::esimd::simd< uint16_t, N >  src1 
)

srnd - perform stochastic rounding.

Supported conversions: float -> half Available on PVC_XT+

Parameters
src0the operand to be rounded
src1random number used for rounding
Returns
the converted value

Definition at line 1677 of file math.hpp.

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

◆ 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 1249 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 1268 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 1283 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 1296 of file math.hpp.

Referenced by sycl::_V1::ext::intel::experimental::esimd::__SYCL_DEPRECATED().

◆ tanh() [1/2]

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

Definition at line 1652 of file math.hpp.

◆ tanh() [2/2]

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

Definition at line 1657 of file math.hpp.

◆ tanh_cody_waite() [1/2]

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

Definition at line 1640 of file math.hpp.

◆ tanh_cody_waite() [2/2]

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

Definition at line 1646 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 = __esimd_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 simd< T, SZ >(min)(simd< T
Selects component-wise the minimum of the two vectors.

Definition at line 180 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 211 of file math.hpp.

◆ src0 [1/2]

◆ src0 [2/2]

◆ src1 [1/2]

◆ src1 [2/2]

◆ SZ

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