DPC++ Runtime
Runtime libraries for oneAPI DPC++
Bit and mask manipulation APIs.
Collaboration diagram for Bit and mask manipulation APIs.:

Functions

template<int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<(N==8||N==16||N==32), uintcl::sycl::ext::intel::esimd::pack_mask (simd_mask< N > src0)
 Pack a simd_mask into a single unsigned 32-bit integer value. More...
 
template<int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<(N==8||N==16||N==32), simd_mask< N > > cl::sycl::ext::intel::esimd::unpack_mask (uint src0)
 Unpack an unsigned 32-bit integer value into a simd_mask. More...
 
template<typename T , int N>
__ESIMD_API std::enable_if_t< detail::is_type< T, ushort, uint >) &&(N > 0 &&N<=32), uintcl::sycl::ext::intel::esimd::ballot (simd< T, N > mask)
 Compare source vector elements against zero and return a bitfield combining the comparison result. More...
 
template<typename T , int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_integral< T >::value &&(sizeof(T)<=4), simd< uint32_t, N > > cl::sycl::ext::intel::esimd::cbit (simd< T, N > src)
 Count number of bits set in the source operand per element. More...
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&(sizeof(T)<=4), uint32_t > cl::sycl::ext::intel::esimd::cbit (T src)
 Scalar version of cbit - both input and output are scalars rather than vectors. More...
 
template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view< BaseTy, RegionTy >::element_type >::value &&(sizeof(typename simd_view< BaseTy, RegionTy >::element_type)<=4) &&(simd_view< BaseTy, RegionTy >::length==1), uint32_t > cl::sycl::ext::intel::esimd::cbit (simd_view< BaseTy, RegionTy > src)
 Scalar version of cbit, that takes simd_view object as an argument, e.g. More...
 
template<typename T , int N>
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&(sizeof(T)==4), simd< T, N > > cl::sycl::ext::intel::esimd::fbl (simd< T, N > src)
 Find the per element number of the first bit set in the source operand starting from the least significant bit. More...
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&(sizeof(T)==4), Tcl::sycl::ext::intel::esimd::fbl (T src)
 Scalar version of fbl - both input and output are scalars rather than vectors. More...
 
template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view< BaseTy, RegionTy >::element_type >::value &&(sizeof(typename simd_view< BaseTy, RegionTy >::element_type)==4) &&(simd_view< BaseTy, RegionTy >::length==1), typename simd_view< BaseTy, RegionTy >::element_type > cl::sycl::ext::intel::esimd::fbl (simd_view< BaseTy, RegionTy > src)
 Scalar version of fbl, that takes simd_view object as an argument, e.g. More...
 
template<typename T , int N>
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&std::is_signed< T >::value &&(sizeof(T)==4), simd< T, N > > cl::sycl::ext::intel::esimd::fbh (simd< T, N > src)
 Find the per element number of the first bit set in the source operand starting from the most significant bit (sign bit is skipped). More...
 
template<typename T >
__ESIMD_API std::enable_if_t< std::is_integral< T >::value &&(sizeof(T)==4), Tcl::sycl::ext::intel::esimd::fbh (T src)
 Scalar version of fbh - both input and output are scalars rather than vectors. More...
 
template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view< BaseTy, RegionTy >::element_type >::value &&(sizeof(typename simd_view< BaseTy, RegionTy >::element_type)==4) &&(simd_view< BaseTy, RegionTy >::length==1), typename simd_view< BaseTy, RegionTy >::element_type > cl::sycl::ext::intel::esimd::fbh (simd_view< BaseTy, RegionTy > src)
 Scalar version of fbh, that takes simd_view object as an argument, e.g. 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< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::shl (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Shift left operation (vector version) More...
 
template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::shl (T1 src0, T2 src1, Sat sat={})
 Shift left operation (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< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::shr (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Shift right operation (vector version) More...
 
template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::shr (T1 src0, T2 src1, Sat sat={})
 Shift right operation (scalar version) More...
 
template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::rol (sycl::ext::intel::esimd::simd< T1, SZ > src0, sycl::ext::intel::esimd::simd< T1, SZ > src1)
 Rotate left operation with two vector inputs. More...
 
template<typename T0 , typename T1 , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::rol (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1)
 Rotate left operation with a vector and a scalar inputs. More...
 
template<typename T0 , typename T1 , typename T2 >
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::rol (T1 src0, T2 src1)
 Rotate left operation with two scalar inputs. More...
 
template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::ror (sycl::ext::intel::esimd::simd< T1, SZ > src0, sycl::ext::intel::esimd::simd< T1, SZ > src1)
 Rotate right operation with two vector inputs. More...
 
template<typename T0 , typename T1 , int SZ, typename U >
__ESIMD_API std::enable_if_t< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::ror (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1)
 Rotate right operation with a vector and a scalar inputs. More...
 
template<typename T0 , typename T1 , typename T2 >
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::ror (T1 src0, T2 src1)
 Rotate right operation with two scalar inputs. 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< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::lsr (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Logical Shift Right (vector version) More...
 
template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::lsr (T1 src0, T2 src1, Sat sat={})
 Logical Shift Right (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< std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< U >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::asr (sycl::ext::intel::esimd::simd< T1, SZ > src0, U src1, Sat sat={})
 Arithmetical Shift Right (vector version) More...
 
template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value &&__ESIMD_DNS::is_esimd_scalar< T2 >::value &&std::is_integral< T0 >::value &&std::is_integral< T1 >::value &&std::is_integral< T2 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::asr (T1 src0, T2 src1, Sat sat={})
 Arithmetical Shift Right (scalar version) More...
 
template<typename T0 , typename T1 , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd< T0, SZ > cl::sycl::ext::intel::experimental::esimd::bf_reverse (sycl::ext::intel::esimd::simd< T1, SZ > src0)
 bf_reverse More...
 
template<typename T0 , typename T1 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T1 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::bf_reverse (T1 src0)
 bf_reverse More...
 
template<typename T0 , typename T1 , int SZ, typename U , typename V , typename W >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_integral< T1 >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::bf_insert (U src0, V src1, W src2, sycl::ext::intel::esimd::simd< T1, SZ > src3)
 bf_insert More...
 
template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T4 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::bf_insert (T1 src0, T2 src1, T3 src2, T4 src3)
 bf_insert More...
 
template<typename T0 , typename T1 , int SZ, typename U , typename V >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_integral< T1 >::value, sycl::ext::intel::esimd::simd< T0, SZ > > cl::sycl::ext::intel::experimental::esimd::bf_extract (U src0, V src1, sycl::ext::intel::esimd::simd< T1, SZ > src2)
 bf_extract More...
 
template<typename T0 , typename T1 , typename T2 , typename T3 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< __ESIMD_DNS::is_esimd_scalar< T0 >::value &&__ESIMD_DNS::is_esimd_scalar< T3 >::value, std::remove_const_t< T0 > > cl::sycl::ext::intel::experimental::esimd::bf_extract (T1 src0, T2 src1, T3 src2)
 bf_extract More...
 

Detailed Description

Function Documentation

◆ asr() [1/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<std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::asr ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Arithmetical Shift Right (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted elements.

Definition at line 344 of file math.hpp.

◆ asr() [2/2]

template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && __ESIMD_DNS::is_esimd_scalar<T2>::value && std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<T2>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::asr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Arithmetical Shift Right (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value src0. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted value.

Definition at line 376 of file math.hpp.

◆ ballot()

template<typename T , int N>
__ESIMD_API std::enable_if_t<detail::is_type<T, ushort, uint>) && (N > 0 && N <= 32), uint> cl::sycl::ext::intel::esimd::ballot ( simd< T, N >  mask)

Compare source vector elements against zero and return a bitfield combining the comparison result.

The representative bit in the result is set if corresponding source vector element is non-zero, and is unset otherwise.

Parameters
maskthe source operand to be compared with zero.
Returns
an uint, where each bit is set if the corresponding element of the source operand is non-zero and unset otherwise.

Definition at line 686 of file math.hpp.

◆ bf_extract() [1/2]

template<typename T0 , typename T1 , typename T2 , typename T3 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T3>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::bf_extract ( T1  src0,
T2  src1,
T3  src2 
)

bf_extract

Definition at line 1111 of file math.hpp.

◆ bf_extract() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , typename V >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<std::is_integral<T1>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::bf_extract ( src0,
src1,
sycl::ext::intel::esimd::simd< T1, SZ >  src2 
)

bf_extract

Definition at line 1094 of file math.hpp.

◆ bf_insert() [1/2]

template<typename T0 , typename T1 , typename T2 , typename T3 , typename T4 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T4>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::bf_insert ( T1  src0,
T2  src1,
T3  src2,
T4  src3 
)

bf_insert

Definition at line 1084 of file math.hpp.

◆ bf_insert() [2/2]

template<typename T0 , typename T1 , int SZ, typename U , typename V , typename W >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<std::is_integral<T1>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::bf_insert ( src0,
src1,
src2,
sycl::ext::intel::esimd::simd< T1, SZ >  src3 
)

bf_insert

Definition at line 1066 of file math.hpp.

◆ bf_reverse() [1/2]

template<typename T0 , typename T1 , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd<T0, SZ> cl::sycl::ext::intel::experimental::esimd::bf_reverse ( sycl::ext::intel::esimd::simd< T1, SZ >  src0)

bf_reverse

Definition at line 1045 of file math.hpp.

◆ bf_reverse() [2/2]

template<typename T0 , typename T1 >
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::bf_reverse ( T1  src0)

bf_reverse

Definition at line 1056 of file math.hpp.

◆ cbit() [1/3]

template<typename T , int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t< std::is_integral<T>::value && (sizeof(T) <= 4), simd<uint32_t, N> > cl::sycl::ext::intel::esimd::cbit ( simd< T, N >  src)

Count number of bits set in the source operand per element.

Parameters
src0the source operand to count bits in.
Returns
a vector of uint32_t, where each element is set to bit count of the corresponding element of the source operand.

Definition at line 705 of file math.hpp.

◆ cbit() [2/3]

template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view<BaseTy, RegionTy>::element_type>::value && (sizeof(typename simd_view<BaseTy, RegionTy>::element_type) <= 4) && (simd_view<BaseTy, RegionTy>::length == 1), uint32_t> cl::sycl::ext::intel::esimd::cbit ( simd_view< BaseTy, RegionTy >  src)

Scalar version of cbit, that takes simd_view object as an argument, e.g.

cbit(v[0]).

Parameters
src0input simd_view object of size 1.
Returns
scalar number of bits set.

Definition at line 731 of file math.hpp.

Referenced by cl::sycl::ext::intel::esimd::cbit().

◆ cbit() [3/3]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && (sizeof(T) <= 4), uint32_t> cl::sycl::ext::intel::esimd::cbit ( T  src)

Scalar version of cbit - both input and output are scalars rather than vectors.

Definition at line 714 of file math.hpp.

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

◆ fbh() [1/3]

template<typename T , int N>
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && std::is_signed<T>::value && (sizeof(T) == 4), simd<T, N> > cl::sycl::ext::intel::esimd::fbh ( simd< T, N >  src)

Find the per element number of the first bit set in the source operand starting from the most significant bit (sign bit is skipped).

Parameters
src0the source operand to count bits in.
Returns
a vector of the same type as the source operand, where each element is set to the number first bit set in corresponding element of the source operand. 0xFFFFffff is returned for an element equal to 0 or -1.

Definition at line 792 of file math.hpp.

◆ fbh() [2/3]

template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view<BaseTy, RegionTy>::element_type>::value && (sizeof(typename simd_view<BaseTy, RegionTy>::element_type) == 4) && (simd_view<BaseTy, RegionTy>::length == 1), typename simd_view<BaseTy, RegionTy>::element_type> cl::sycl::ext::intel::esimd::fbh ( simd_view< BaseTy, RegionTy >  src)

Scalar version of fbh, that takes simd_view object as an argument, e.g.

fbh(v[0]).

Parameters
src0input simd_view object of size 1.
Returns
scalar number of the first bit set starting from the most significant bit.

Definition at line 832 of file math.hpp.

Referenced by cl::sycl::ext::intel::esimd::fbh().

◆ fbh() [3/3]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && (sizeof(T) == 4), T> cl::sycl::ext::intel::esimd::fbh ( T  src)

Scalar version of fbh - both input and output are scalars rather than vectors.

Definition at line 814 of file math.hpp.

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

◆ fbl() [1/3]

template<typename T , int N>
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && (sizeof(T) == 4), simd<T, N> > cl::sycl::ext::intel::esimd::fbl ( simd< T, N >  src)

Find the per element number of the first bit set in the source operand starting from the least significant bit.

Parameters
src0the source operand to count bits in.
Returns
a vector of the same type as the source operand, where each element is set to the number first bit set in corresponding element of the source operand. 0xFFFFffff is returned for an element equal to 0. Find component-wise the first bit from LSB side

Definition at line 748 of file math.hpp.

◆ fbl() [2/3]

template<typename BaseTy , typename RegionTy >
__ESIMD_API std::enable_if_t< std::is_integral< typename simd_view<BaseTy, RegionTy>::element_type>::value && (sizeof(typename simd_view<BaseTy, RegionTy>::element_type) == 4) && (simd_view<BaseTy, RegionTy>::length == 1), typename simd_view<BaseTy, RegionTy>::element_type> cl::sycl::ext::intel::esimd::fbl ( simd_view< BaseTy, RegionTy >  src)

Scalar version of fbl, that takes simd_view object as an argument, e.g.

fbl(v[0]).

Parameters
src0input simd_view object of size 1.
Returns
scalar number of the first bit set starting from the least significant bit.

Definition at line 774 of file math.hpp.

Referenced by cl::sycl::ext::intel::esimd::fbl().

◆ fbl() [3/3]

template<typename T >
__ESIMD_API std::enable_if_t<std::is_integral<T>::value && (sizeof(T) == 4), T> cl::sycl::ext::intel::esimd::fbl ( T  src)

Scalar version of fbl - both input and output are scalars rather than vectors.

Definition at line 756 of file math.hpp.

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

◆ lsr() [1/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<std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::lsr ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Logical Shift Right (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted elements.

Definition at line 288 of file math.hpp.

◆ lsr() [2/2]

template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && __ESIMD_DNS::is_esimd_scalar<T2>::value && std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<T2>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::lsr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Logical Shift Right (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value src0. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted value.

Definition at line 320 of file math.hpp.

◆ pack_mask()

template<int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<(N == 8 || N == 16 || N == 32), uint> cl::sycl::ext::intel::esimd::pack_mask ( simd_mask< N >  src0)

Pack a simd_mask into a single unsigned 32-bit integer value.

i'th bit in the returned value is set to the result of comparison of the i'th element of the input argument to zero. "equals to zero" gives 0, "not equal to zero" gives 1. Remaining (if any) bits if the result are filled with 0.

Template Parameters
NSize of the input mask.
Parameters
src0The input mask.
Returns
The packed mask as an unsgined int 32-bit value.

Definition at line 648 of file math.hpp.

◆ rol() [1/3]

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

Rotate left operation with two vector inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the vector with number of bit positions by which the elements of the input vector src0 shall be rotated.
Returns
vector of rotated elements.

Definition at line 166 of file math.hpp.

◆ rol() [2/3]

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

Rotate left operation with a vector and a scalar inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be rotated.
Returns
vector of rotated elements.

Definition at line 183 of file math.hpp.

◆ rol() [3/3]

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

Rotate left operation with two scalar inputs.

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be rotated.
Returns
rotated left value.

Definition at line 205 of file math.hpp.

◆ ror() [1/3]

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

Rotate right operation with two vector inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Parameters
src0the input vector.
src1the vector with number of bit positions by which the elements of the input vector src0 shall be rotated.
Returns
vector of rotated elements.

Definition at line 225 of file math.hpp.

◆ ror() [2/3]

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

Rotate right operation with a vector and a scalar inputs.

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vectors.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be rotated.
Returns
vector of rotated elements.

Definition at line 242 of file math.hpp.

◆ ror() [3/3]

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

Rotate right operation with two scalar inputs.

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be rotated.
Returns
rotated right value.

Definition at line 264 of file math.hpp.

◆ shl() [1/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<std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::shl ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Shift left operation (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vector.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted left values.

Definition at line 40 of file math.hpp.

◆ shl() [2/2]

template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && __ESIMD_DNS::is_esimd_scalar<T2>::value && std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<T2>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::shl ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Shift left operation (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted left value.

Definition at line 90 of file math.hpp.

◆ shr() [1/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<std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<U>::value, sycl::ext::intel::esimd::simd<T0, SZ> > cl::sycl::ext::intel::experimental::esimd::shr ( sycl::ext::intel::esimd::simd< T1, SZ >  src0,
src1,
Sat  sat = {} 
)

Shift right operation (vector version)

Template Parameters
T0element type of the returned vector. Must be any integer type.
T1element type of the input vector. Must be any integer type.
SZsize of the input and returned vector.
Utype of scalar operand src1. Must be any integer type.
Parameters
src0the input vector.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
vector of shifted right values.

Definition at line 114 of file math.hpp.

◆ shr() [2/2]

template<typename T0 , typename T1 , typename T2 , class Sat = sycl::ext::intel::esimd::saturation_off_tag>
__ESIMD_API std::enable_if_t<__ESIMD_DNS::is_esimd_scalar<T0>::value && __ESIMD_DNS::is_esimd_scalar<T1>::value && __ESIMD_DNS::is_esimd_scalar<T2>::value && std::is_integral<T0>::value && std::is_integral<T1>::value && std::is_integral<T2>::value, std::remove_const_t<T0> > cl::sycl::ext::intel::experimental::esimd::shr ( T1  src0,
T2  src1,
Sat  sat = {} 
)

Shift right operation (scalar version)

Template Parameters
T0element type of the returned value. Must be any integer type.
T1element type of the input value. Must be any integer type.
T2type of scalar operand src1. Must be any integer type.
Parameters
src0the input value.
src1the number of bit positions the input vector shall be shifted.
satenables/disables the saturation (off by default). Possible values: saturation_on/saturation_off.
Returns
shifted right value.

Definition at line 146 of file math.hpp.

◆ unpack_mask()

template<int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<(N == 8 || N == 16 || N == 32), simd_mask<N> > cl::sycl::ext::intel::esimd::unpack_mask ( uint  src0)

Unpack an unsigned 32-bit integer value into a simd_mask.

Only N least significant bits are used, where N is the number of elements in the result mask. Each input bit is stored into the corresponding vector element of the output mask.

Template Parameters
NSize of the output mask.
Parameters
src0The input packed mask.
Returns
The unpacked mask as a simd_mask object.

Definition at line 662 of file math.hpp.