AI Engine API User Guide (AIE) 2022.2
aie::detail::mask< Elems > Class Template Reference

#include <mask.hpp>

Public Member Functions

constexpr mask (bool initial_set=false)
  More...
 
template<typename... T>
constexpr mask (unsigned w, T &&... words)
  More...
 
constexpr void clear (unsigned i)
  More...
 
constexpr unsigned clz () const
  More...
 
constexpr unsigned count () const
  More...
 
constexpr const std::array< unsigned, num_words > & data () const
 
constexpr bool empty () const
  More...
 
constexpr bool full () const
  More...
 
constexpr mask operator& (const mask &a) const
  More...
 
constexpr maskoperator&= (const mask &a)
  More...
 
constexpr mask operator<< (unsigned shift) const
  More...
 
constexpr maskoperator<<= (unsigned shift)
  More...
 
constexpr bool operator== (const mask &a) const
  More...
 
constexpr mask operator>> (unsigned shift) const
  More...
 
constexpr maskoperator>>= (unsigned shift)
  More...
 
constexpr mask operator| (const mask &a) const
  More...
 
constexpr maskoperator|= (const mask &a)
  More...
 
constexpr mask operator~ () const
  More...
 
constexpr void set (unsigned i)
  More...
 
constexpr bool test (unsigned i) const
  More...
 

Static Public Member Functions

static constexpr unsigned size ()
  More...
 

Constructor & Destructor Documentation

◆ mask() [1/2]

template<unsigned Elems>
constexpr aie::detail::mask< Elems >::mask ( bool  initial_set = false)
inlineexplicitconstexpr

Creates a mask

Parameters
initial_setIf true, the mask is initialized with 1s, otherise it is initialized with 0s.

◆ mask() [2/2]

template<unsigned Elems>
template<typename... T>
constexpr aie::detail::mask< Elems >::mask ( unsigned  w,
T &&...  words 
)
inlineexplicitconstexpr

Construct from unsigned (32b) words. Each bit in the input words is used to initialize one of the elements in the mask.

Parameters
wFirst word used to initialize the mask.
wordsRest of words used to initialize the mask.

Member Function Documentation

◆ clear()

template<unsigned Elems>
constexpr void aie::detail::mask< Elems >::clear ( unsigned  i)
inlineconstexpr

Sets the value of the element in the given index to 0.

Parameters
iElement index.

◆ clz()

template<unsigned Elems>
constexpr unsigned aie::detail::mask< Elems >::clz ( ) const
inlineconstexpr

Returns the count of consecutive elements, starting at the high part of the mask, whose value is 0.

◆ count()

template<unsigned Elems>
constexpr unsigned aie::detail::mask< Elems >::count ( ) const
inlineconstexpr

Returns the count of elements whose value is 1.

◆ empty()

template<unsigned Elems>
constexpr bool aie::detail::mask< Elems >::empty ( ) const
inlineconstexpr

Returns a bool that says whether the value of all the elements in the mask is 0.

◆ full()

template<unsigned Elems>
constexpr bool aie::detail::mask< Elems >::full ( ) const
inlineconstexpr

Returns a bool that says whether the value of all the elements in the mask is 1.

◆ operator&()

template<unsigned Elems>
constexpr mask aie::detail::mask< Elems >::operator& ( const mask< Elems > &  a) const
inlineconstexpr

Returns the result of merging the current and the given masks using the AND operation.

Parameters
aMask to merge with.

◆ operator&=()

template<unsigned Elems>
constexpr mask& aie::detail::mask< Elems >::operator&= ( const mask< Elems > &  a)
inlineconstexpr

Updates the mask with the result of merging the current with the given masks using the AND operation. Returns a reference to the updated mask.

Parameters
aMask to merge with.

◆ operator<<()

template<unsigned Elems>
constexpr mask aie::detail::mask< Elems >::operator<< ( unsigned  shift) const
inlineconstexpr

Returns the result of a binary left shift of the mask.

Parameters
shiftNumber of positions to shift the mask.

◆ operator<<=()

template<unsigned Elems>
constexpr mask& aie::detail::mask< Elems >::operator<<= ( unsigned  shift)
inlineconstexpr

Returns the result of a binary left shift of the mask. Returns a reference to the updated mask.

Parameters
shiftNumber of positions to shift the mask.

◆ operator==()

template<unsigned Elems>
constexpr bool aie::detail::mask< Elems >::operator== ( const mask< Elems > &  a) const
inlineconstexpr

Compares whether two masks are equal.

Parameters
aMask to compare against.

◆ operator>>()

template<unsigned Elems>
constexpr mask aie::detail::mask< Elems >::operator>> ( unsigned  shift) const
inlineconstexpr

Returns the result of a binary right shift of the mask.

Parameters
shiftNumber of positions to shift the mask.

◆ operator>>=()

template<unsigned Elems>
constexpr mask& aie::detail::mask< Elems >::operator>>= ( unsigned  shift)
inlineconstexpr

Returns the result of a binary right shift of the mask. Returns a reference to the updated mask.

Parameters
shiftNumber of positions to shift the mask.

◆ operator|()

template<unsigned Elems>
constexpr mask aie::detail::mask< Elems >::operator| ( const mask< Elems > &  a) const
inlineconstexpr

Returns the result of merging the current and the given masks using the OR operation.

Parameters
aMask to merge with.

◆ operator|=()

template<unsigned Elems>
constexpr mask& aie::detail::mask< Elems >::operator|= ( const mask< Elems > &  a)
inlineconstexpr

Updates the mask with the result of merging the current and the given masks using the OR operation. Returns a reference to the updated mask.

Parameters
aMask to merge with.

◆ operator~()

template<unsigned Elems>
constexpr mask aie::detail::mask< Elems >::operator~ ( ) const
inlineconstexpr

Returns a mask that contains the negation of the values of all the elements in the mask (0->1, 1->0).

◆ set()

template<unsigned Elems>
constexpr void aie::detail::mask< Elems >::set ( unsigned  i)
inlineconstexpr

Sets the value of the element in the given index to 1.

Parameters
iElement index.

◆ size()

template<unsigned Elems>
static constexpr unsigned aie::detail::mask< Elems >::size ( )
inlinestaticconstexpr

Returns the number of elements in the mask

◆ test()

template<unsigned Elems>
constexpr bool aie::detail::mask< Elems >::test ( unsigned  i) const
inlineconstexpr

Returns the value of the element in the given index.

Parameters
iElement index.

The documentation for this class was generated from the following file: