Defines math operations on ESIMD vector data types. More...
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, SZ > | sycl::_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, SZ > | sycl::_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, SZ > | sycl::_V1::ext::intel::esimd::exp (simd< T, SZ > src0, Sat sat={}) |
Computes e raised to the power of the given argument. More... | |
template<class T , class Sat = saturation_off_tag> | |
ESIMD_NODEBUG ESIMD_INLINE T | sycl::_V1::ext::intel::esimd::exp (T src0, Sat sat={}) |
template<typename T1 , typename T2 , typename T3 , typename T4 , int N, class Sat = saturation_off_tag> | |
__ESIMD_API std::enable_if_t< detail::is_dword_type< T1 >::value &&detail::is_dword_type< T2 >::value &&detail::is_dword_type< T3 >::value &&detail::is_dword_type< T4 >::value, simd< T1, N > > | sycl::_V1::ext::intel::esimd::dp4a (simd< T2, N > src0, simd< T3, N > src1, simd< T4, N > src2, Sat sat={}) |
DP4A. More... | |
template<typename T0 , typename T1 , int SZ> | |
ESIMD_INLINE ESIMD_NODEBUG T0 | sycl::_V1::ext::intel::esimd::hmax (simd< T1, SZ > v) |
ESIMD_DETAIL. More... | |
template<typename T0 , typename T1 , int SZ> | |
ESIMD_INLINE ESIMD_NODEBUG T0 | sycl::_V1::ext::intel::esimd::hmin (simd< T1, SZ > v) |
Performs 'minimum' operation reduction over elements of the input vector, that is, returns the minimal vector element. More... | |
template<typename T0 , typename T1 , int SZ, typename BinaryOperation > | |
ESIMD_INLINE ESIMD_NODEBUG T0 | sycl::_V1::ext::intel::esimd::reduce (simd< T1, SZ > v, BinaryOperation op) |
Performs reduction over elements of the input vector. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, sycl::ext::intel::esimd::simd< uint32_t, N > src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1) |
Performs add with carry of 2 unsigned 32-bit vectors. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, sycl::ext::intel::esimd::simd< uint32_t, N > src0, uint32_t src1) |
Performs add with carry of a unsigned 32-bit vector and scalar. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::addc (sycl::ext::intel::esimd::simd< uint32_t, N > &carry, uint32_t src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1) |
Performs add with carry of a unsigned 32-bit scalar and vector. More... | |
__ESIMD_API uint32_t | sycl::_V1::ext::intel::esimd::addc (uint32_t &carry, uint32_t src0, uint32_t src1) |
Performs add with carry of a unsigned 32-bit scalars. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, sycl::ext::intel::esimd::simd< uint32_t, N > src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1) |
Performs substraction with borrow of 2 unsigned 32-bit vectors. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, sycl::ext::intel::esimd::simd< uint32_t, N > src0, uint32_t src1) |
Performs substraction with borrow of unsigned 32-bit vector and scalar. More... | |
template<int N> | |
__ESIMD_API sycl::ext::intel::esimd::simd< uint32_t, N > | sycl::_V1::ext::intel::esimd::subb (sycl::ext::intel::esimd::simd< uint32_t, N > &borrow, uint32_t src0, sycl::ext::intel::esimd::simd< uint32_t, N > src1) |
Performs substraction with borrow of unsigned 32-bit scalar and vector. More... | |
__ESIMD_API uint32_t | sycl::_V1::ext::intel::esimd::subb (uint32_t &borrow, uint32_t src0, uint32_t src1) |
Performs substraction with borrow of 2 unsigned 32-bit scalars. More... | |
__ESIMD_API uint64_t | sycl::_V1::ext::intel::esimd::rdtsc () |
rdtsc - get the value of timestamp counter. More... | |
Variables | |
__ESIMD_API SZ | sycl::_V1::ext::intel::esimd::src0 |
__ESIMD_API SZ simd< T, SZ > | sycl::_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 |
Defines math operations on ESIMD vector data types.
__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.
T1 | element type of the input and output vectors. |
SZ | size of the input and returned vectors. |
src0 | the input vector. |
Definition at line 157 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0.
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)
TRes | element type of the returned vector. |
TArg | element type of the input vector. |
SZ | size of the input and returned vector. |
src0 | the input vector. |
Definition at line 131 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0.
__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.
T1 | element type of the input and output value. |
src0 | the source operand. |
Definition at line 170 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0.
Referenced by syclcompat::cabs(), and syclcompat::abs::operator()().
__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)
T0 | element type of the returned value. |
T1 | element type of the input value. |
src0 | the source operand. |
Definition at line 146 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0.
__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.
N | size of the vectors |
carry | vector that is going to hold resulting carry flag |
src0 | first term |
src1 | second term |
carry
parameter Definition at line 1725 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.
Referenced by sycl::_V1::ext::intel::esimd::addc().
__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.
N | size of the vectors |
carry | vector that is going to hold resulting carry flag |
src0 | first term |
src1 | second term |
carry
parameter Definition at line 1743 of file math.hpp.
References sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.
__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.
N | size of the vectors |
carry | vector that is going to hold resulting carry flag |
src0 | first term |
src1 | second term |
carry
parameter Definition at line 1757 of file math.hpp.
References sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.
__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.
N | size of the vectors |
carry | scalar that is going to hold resulting carry flag |
src0 | first term |
src1 | second term |
carry
parameter __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.
src0 | the first source operand of dp4a operation. |
src1 | the second source operand of dp4a operation. |
src2 | the third source operand of dp4a operation. |
sat | saturation flag, which has default value of saturation_off. |
Returns simd vector of the dp4a operation result.
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::exp | ( | T | src0, |
Sat | sat = {} |
||
) |
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.
T0 | type of the return value. |
T1 | element type of the input vector. |
SZ | size of the input vector. |
v | the vector to perfrom reduction on |
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.
T0 | type of the return value. |
T1 | element type of the input vector. |
SZ | size of the input vector. |
v | the vector to perfrom reduction on |
ESIMD_NODEBUG ESIMD_INLINE T sycl::_V1::ext::intel::esimd::log | ( | T | src0, |
Sat | sat = {} |
||
) |
__ESIMD_API uint64_t sycl::_V1::ext::intel::esimd::rdtsc | ( | ) |
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.
T0 | type of the return value. |
T1 | element type of the input vector. |
SZ | size of the input vector. |
BinaryOperation | type representing the operation. Can be an instantion of one of the following types:
|
v | the vector to perfrom reduction on |
op | reduction operation object, used to auto-deduce the BinaryOperation template parameter. |
__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
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:T0
) positive integral or floating-point value src[i] of type T1
converted to T0
will result in std:numeric_limits<T0>::max()
.std:numeric_limits<T0>::min()
.T1
will yield 0
. T0 | Element type of the returned vector. |
T1 | Element type of the input vector. |
SZ | Size of the input and returned vector. |
src | The input vector. |
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().
__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.
T | element type of the input and return vectors. |
SZ | size of the input and returned vectors. |
src0 | the input vector. |
src1 | the input vector. |
sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
__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.
T | element type of the input and return vectors. |
SZ | size of the input and returned vectors. |
src0 | the input vector. |
src1 | the input vector. |
sat | enables/disables the saturation (off by default). Possible values: saturation_on/saturation_off. |
__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.
N | size of the vectors |
borrow | vector that is going to hold resulting borrow flag |
src0 | first term |
src1 | second term |
borrow
parameter Definition at line 1787 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0, and sycl::_V1::ext::intel::esimd::src1.
Referenced by sycl::_V1::ext::intel::esimd::subb().
__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.
N | size of the vectors |
borrow | vector that is going to hold resulting borrow flag |
src0 | first term |
src1 | second term |
borrow
parameter Definition at line 1806 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0, sycl::_V1::ext::intel::esimd::src1, and sycl::_V1::ext::intel::esimd::subb().
__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.
N | size of the vectors |
borrow | vector that is going to hold resulting borrow flag |
src0 | first term |
src1 | second term |
borrow
parameter Definition at line 1821 of file math.hpp.
References sycl::_V1::ext::intel::esimd::src0, sycl::_V1::ext::intel::esimd::src1, and sycl::_V1::ext::intel::esimd::subb().
__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.
N | size of the vectors |
borrow | scalar that is going to hold resulting borrow flag |
src0 | first term |
src1 | second term |
borrow
parameter __ESIMD_API SZ sycl::_V1::ext::intel::esimd::src0 |
Definition at line 184 of file math.hpp.
Referenced by sycl::_V1::ext::intel::esimd::abs(), sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::atomic_update(), sycl::_V1::ext::intel::esimd::detail::atomic_update_impl(), sycl::_V1::ext::intel::esimd::bfn(), sycl::_V1::ext::intel::experimental::esimd::lsc_atomic_update(), sycl::_V1::ext::intel::experimental::esimd::lsc_slm_atomic_update(), sycl::_V1::ext::intel::esimd::pack_mask(), sycl::_V1::ext::intel::esimd::rol(), sycl::_V1::ext::intel::esimd::ror(), sycl::_V1::ext::intel::esimd::slm_atomic_update(), sycl::_V1::ext::intel::esimd::detail::slm_atomic_update_impl(), sycl::_V1::ext::intel::esimd::subb(), and sycl::_V1::ext::intel::esimd::unpack_mask().
Definition at line 184 of file math.hpp.
Referenced by sycl::_V1::ext::intel::esimd::addc(), sycl::_V1::ext::intel::esimd::atomic_update(), sycl::_V1::ext::intel::esimd::detail::atomic_update_impl(), sycl::_V1::ext::intel::esimd::bfn(), sycl::_V1::ext::intel::experimental::esimd::lsc_atomic_update(), sycl::_V1::ext::intel::experimental::esimd::lsc_slm_atomic_update(), sycl::_V1::ext::intel::esimd::rol(), sycl::_V1::ext::intel::esimd::ror(), sycl::_V1::ext::intel::esimd::slm_atomic_update(), sycl::_V1::ext::intel::esimd::detail::slm_atomic_update_impl(), and sycl::_V1::ext::intel::esimd::subb().
Definition at line 215 of file math.hpp.
Referenced by sycl::_V1::ext::intel::esimd::detail::reduce(), and sycl::_V1::ext::intel::esimd::detail::reduce_single().