E.V.E
v2022.03.00

◆ none

eve::none = {}
inlineconstexpr

Computes a bool value which is true if and only if all elements of x are 0.

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template< eve::value T >
bool none(T x) noexcept; //1
template< eve::top_bits M >
bool none(M m) noexcept; //2
}
constexpr callable_none_ none
Computes a bool value which is true if and only if all elements of x are 0.
Definition: none.hpp:70
Definition: all_of.hpp:22
  • 1. A bool value which is true if and only if all elements of x are zero.
  • 2 A bool value which is true if and only if all top bits elements of x are zero.

Parameters

Return value

A bool value.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {-0.0f, 0.0f, -0.0f, -0.0f};
wide_it qi = {-1, 0, 30, -32768};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> none(pf != 0) = " << eve::none(pf != 0) << '\n'
<< "<- qi = " << qi << '\n'
<< "-> none(qi != 0) = " << eve::none(qi != 0) << '\n';
float xf = -0.0f;
float yf = -3.0f;
std::cout << "---- scalar" << '\n'
<< "<- xf = " << xf << '\n'
<< "-> none(xf) = " << eve::none(xf != 0) << '\n'
<< "<- yf = " << yf << '\n'
<< "-> none(yf) = " << eve::none(yf != 0) << '\n';
return 0;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65

Semantic Modifiers

  • Masked Call

    The call eve::none[mask](x) provides a masked version of none which is equivalent to : all not masked elements are zero.

    Example

    #include <eve/module/core.hpp>
    #include <eve/wide.hpp>
    #include <iostream>
    int main()
    {
    wide_it qi = {-3, 0, -30, -32768};
    std::cout << "---- simd" << '\n'
    << "<- qi = " << qi << '\n'
    << "-> none[ignore_first(1)](qi != 0) = " << eve::none[eve::ignore_first(1)](qi != 0) << '\n';
    return 0;
    }
    Conditional expression ignoring the k first lanes from a eve::simd_value.
    Definition: conditional.hpp:419