![]() |
AI Engine API User Guide (AIE) 2023.1
|
#include <mask.hpp>
Public Member Functions | |
__aie_inline constexpr | mask (bool initial_set=false) |
template<typename... T> | |
constexpr | mask (unsigned w, T &&... words) |
__aie_inline constexpr void | clear (unsigned i) |
__aie_inline constexpr unsigned | clz () const |
__aie_inline constexpr unsigned | count () const |
__aie_inline constexpr const std::array< unsigned, num_words > & | data () const |
__aie_inline constexpr bool | empty () const |
__aie_inline constexpr bool | full () const |
template<unsigned ElemsOut> | |
__aie_inline constexpr mask< ElemsOut > | get_submask (unsigned i) const |
__aie_inline constexpr mask | operator& (const mask &a) const |
__aie_inline constexpr mask & | operator&= (const mask &a) |
__aie_inline constexpr mask | operator<< (unsigned shift) const |
constexpr mask & | operator<<= (unsigned shift) |
__aie_inline constexpr bool | operator== (const mask &a) const |
__aie_inline constexpr mask | operator>> (unsigned shift) const |
constexpr mask & | operator>>= (unsigned shift) |
__aie_inline constexpr mask | operator| (const mask &a) const |
__aie_inline constexpr mask & | operator|= (const mask &a) |
__aie_inline constexpr mask | operator~ () const |
__aie_inline constexpr void | set (unsigned i) |
__aie_inline constexpr bool | test (unsigned i) const |
template<unsigned Elems2 = Elems> requires (Elems2 <= 32) | |
__aie_inline constexpr unsigned | to_uint32 () const |
__aie_inline constexpr unsigned | to_uint32 (unsigned i) const |
template<unsigned Elems2 = Elems> requires (Elems2 == 64) | |
__aie_inline constexpr uint64_t | to_uint64 () const |
__aie_inline constexpr uint64_t | to_uint64 (unsigned i) const |
Static Public Member Functions | |
template<unsigned Elems2, typename... T> | |
__aie_inline static constexpr mask< Elems > | from_masks (const mask< Elems2 > &m, T &&... masks) |
template<typename... T> | |
__aie_inline static constexpr mask< Elems > | from_uint32 (unsigned w, T &&... words) |
template<typename... T> | |
__aie_inline static constexpr mask< Elems > | from_uint64 (uint64_t w, T &&... words) |
static constexpr unsigned | size () |
Friends | |
template<unsigned Elems2> | |
class | mask |
|
inlineexplicitconstexpr |
Creates a mask
initial_set | If true, the mask is initialized with 1s, otherise it is initialized with 0s. |
|
inlineexplicitconstexpr |
Construct from unsigned (32b) words. Each bit in the input words is used to initialize one of the elements in the mask.
w | First word used to initialize the mask. |
words | Rest of words used to initialize the mask. |
|
inlineconstexpr |
Sets the value of the element in the given index to 0.
i | Element index. |
|
inlineconstexpr |
Returns the count of consecutive elements, starting at the high part of the mask, whose value is 0.
|
inlineconstexpr |
Returns the count of elements whose value is 1.
|
inlineconstexpr |
|
inlineconstexpr |
Returns a bool that says whether the value of all the elements in the mask is 0.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Construct from unsigned (32b) words. Each bit in the input words is used to initialize one of the elements in the mask.
w | First word used to initialize the mask. |
words | Rest of words used to initialize the mask. |
|
inlinestaticconstexpr |
Construct from unsigned (64b) words. Each bit in the input words is used to initialize one of the elements in the mask.
w | First word used to initialize the mask. |
words | Rest of words used to initialize the mask. |
|
inlineconstexpr |
Returns a bool that says whether the value of all the elements in the mask is 1.
|
inlineconstexpr |
|
inlineconstexpr |
Returns the result of merging the current and the given masks using the AND operation.
a | Mask to merge with. |
|
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.
a | Mask to merge with. |
|
inlineconstexpr |
Returns the result of a binary left shift of the mask.
shift | Number of positions to shift the mask. |
|
inlineconstexpr |
Returns the result of a binary left shift of the mask. Returns a reference to the updated mask.
shift | Number of positions to shift the mask. |
|
inlineconstexpr |
Compares whether two masks are equal.
a | Mask to compare against. |
|
inlineconstexpr |
Returns the result of a binary right shift of the mask.
shift | Number of positions to shift the mask. |
|
inlineconstexpr |
Returns the result of a binary right shift of the mask. Returns a reference to the updated mask.
shift | Number of positions to shift the mask. |
|
inlineconstexpr |
Returns the result of merging the current and the given masks using the OR operation.
a | Mask to merge with. |
|
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.
a | Mask to merge with. |
|
inlineconstexpr |
Returns a mask that contains the negation of the values of all the elements in the mask (0->1, 1->0).
|
inlineconstexpr |
Sets the value of the element in the given index to 1.
i | Element index. |
|
inlinestaticconstexpr |
Returns the number of elements in the mask
|
inlineconstexpr |
Returns the value of the element in the given index.
i | Element index. |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Type for vector element masks. The documentation of this class and its members can be found at detail::mask.
This type is returned by logical operations and used as input in selection operations.
Elems | Number of elements represented in the mask. |