E.V.E
v2022.03.00

◆ all

eve::all = {}
inlineconstexpr

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

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

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

Parameters

Return value

A bool value.

Example

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

Semantic Modifiers

  • Masked Call

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

    Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
int main()
{
wide_ft pf = {0.0f, 1.0f, 3.0f, 32768.0f};
std::cout << "---- simd" << '\n'
<< "<- pf = " << pf << '\n'
<< "-> all[ignore_first(1)](pf > 0.5f) = " << eve::all[eve::ignore_first(1)](pf > 0.5) << '\n';
return 0;
}
Conditional expression ignoring the k first lanes from a eve::simd_value.
Definition: conditional.hpp:419