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), uintsycl::_V1::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 > > sycl::_V1::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<(std::is_same_v< T, ushort >||std::is_same_v< T, uint >)&&(N > 0 &&N<=32), uintsycl::_V1::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 > > sycl::_V1::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 > sycl::_V1::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 > sycl::_V1::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 > > sycl::_V1::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), Tsycl::_V1::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 > sycl::_V1::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 > > sycl::_V1::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), Tsycl::_V1::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 > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::ext::intel::experimental::esimd::asr (T1 src0, T2 src1, Sat sat={})
 Arithmetical 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 > > sycl::_V1::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 > > sycl::_V1::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< sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), sycl::ext::intel::esimd::simd< T0, SZ > > sycl::_V1::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< sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< U, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), sycl::ext::intel::esimd::simd< T0, SZ > > sycl::_V1::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 &&sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T2, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), std::remove_const_t< T0 > > sycl::_V1::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< sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), sycl::ext::intel::esimd::simd< T0, SZ > > sycl::_V1::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< sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< U, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), sycl::ext::intel::esimd::simd< T0, SZ > > sycl::_V1::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 &&sycl::ext::intel::esimd::detail::is_type< T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >) &&sycl::ext::intel::esimd::detail::is_type< T2, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t >), std::remove_const_t< T0 > > sycl::_V1::ext::intel::experimental::esimd::ror (T1 src0, T2 src1)
 Rotate right operation with two scalar inputs. More...
 
template<typename T0 , typename T1 , int SZ>
__ESIMD_API sycl::ext::intel::esimd::simd< T0, SZ > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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 > > sycl::_V1::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> > sycl::_V1::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 184 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> > sycl::_V1::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 216 of file math.hpp.

◆ ballot()

template<typename T , int N>
__ESIMD_API std::enable_if_t<(std::is_same_v<T, ushort> || std::is_same_v<T, uint>)&&(N > 0 && N <= 32), uint> sycl::_V1::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 684 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> > sycl::_V1::ext::intel::experimental::esimd::bf_extract ( T1  src0,
T2  src1,
T3  src2 
)

bf_extract

Definition at line 1132 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> > sycl::_V1::ext::intel::experimental::esimd::bf_extract ( src0,
src1,
sycl::ext::intel::esimd::simd< T1, SZ >  src2 
)

bf_extract

Definition at line 1115 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> > sycl::_V1::ext::intel::experimental::esimd::bf_insert ( T1  src0,
T2  src1,
T3  src2,
T4  src3 
)

bf_insert

Definition at line 1105 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> > sycl::_V1::ext::intel::experimental::esimd::bf_insert ( src0,
src1,
src2,
sycl::ext::intel::esimd::simd< T1, SZ >  src3 
)

bf_insert

Definition at line 1087 of file math.hpp.

◆ bf_reverse() [1/2]

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

bf_reverse

Definition at line 1066 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> > sycl::_V1::ext::intel::experimental::esimd::bf_reverse ( T1  src0)

bf_reverse

Definition at line 1077 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> > sycl::_V1::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 703 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> sycl::_V1::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 729 of file math.hpp.

Referenced by sycl::_V1::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> sycl::_V1::ext::intel::esimd::cbit ( T  src)

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

Definition at line 712 of file math.hpp.

References sycl::_V1::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> > sycl::_V1::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 790 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> sycl::_V1::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 830 of file math.hpp.

Referenced by sycl::_V1::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> sycl::_V1::ext::intel::esimd::fbh ( T  src)

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

Definition at line 812 of file math.hpp.

References sycl::_V1::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> > sycl::_V1::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 746 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> sycl::_V1::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 772 of file math.hpp.

Referenced by sycl::_V1::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> sycl::_V1::ext::intel::esimd::fbl ( T  src)

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

Definition at line 754 of file math.hpp.

References sycl::_V1::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> > sycl::_V1::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 127 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> > sycl::_V1::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 160 of file math.hpp.

◆ pack_mask()

template<int N>
ESIMD_NODEBUG ESIMD_INLINE std::enable_if_t<(N == 8 || N == 16 || N == 32), uint> sycl::_V1::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 646 of file math.hpp.

◆ rol() [1/3]

template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t< sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), sycl::ext::intel::esimd::simd<T0, SZ> > sycl::_V1::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 287 of file math.hpp.

◆ rol() [2/3]

template<typename T0 , typename T1 , int SZ, typename U >
__ESIMD_API std::enable_if_t< sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<U, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), sycl::ext::intel::esimd::simd<T0, SZ> > sycl::_V1::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 308 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 && sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T2, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), std::remove_const_t<T0> > sycl::_V1::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 332 of file math.hpp.

◆ ror() [1/3]

template<typename T0 , typename T1 , int SZ>
__ESIMD_API std::enable_if_t< sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), sycl::ext::intel::esimd::simd<T0, SZ> > sycl::_V1::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 353 of file math.hpp.

◆ ror() [2/3]

template<typename T0 , typename T1 , int SZ, typename U >
__ESIMD_API std::enable_if_t< sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<U, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), sycl::ext::intel::esimd::simd<T0, SZ> > sycl::_V1::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 374 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 && sycl::ext::intel::esimd::detail::is_type<T0, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T1, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>) && sycl::ext::intel::esimd::detail::is_type<T2, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t>), std::remove_const_t<T0> > sycl::_V1::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 398 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> > sycl::_V1::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 43 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> > sycl::_V1::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 104 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> > sycl::_V1::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 239 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> > sycl::_V1::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 265 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> > sycl::_V1::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 660 of file math.hpp.