E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ true_

auto eve::true_ = functor<true_t>
inlineconstexpr

Defined in Header

#include <eve/module/core.hpp>

Callable Signatures

namespace eve
{
template<typename T> constexpr as_logical<T> true_(as<T> x);
}
constexpr auto true_
Computes the logical true_ value.
Definition true.hpp:67
EVE Main Namespace.
Definition abi.hpp:18
Lightweight type-wrapper.
Definition as.hpp:29

Parameters

  • x : Type wrapper instance embedding the type of the constant.

Return value

The call eve::true_(as<T>()) returns elementwise, the true logical value.

Example

#include <eve/module/core.hpp>
#include <eve/wide.hpp>
#include <iostream>
using wide_ft = eve::wide<float>;
using wide_it = eve::wide<std::int16_t>;
template<typename T>
consteval auto constexpr_true_() { return eve::true_(eve::as<T>{}); }
int main()
{
wide_ft wxf;
wide_it wxi;
std::cout << "---- simd" << std::endl
<< "-> true(as<wide_ft>()) = " << eve::true_(eve::as<wide_ft>()) << std::endl
<< "-> true_(as<wide_it>()) = " << eve::true_(eve::as<wide_it>()) << std::endl
<< "-> true_(as(wxf)) = " << eve::true_(eve::as(wxf)) << std::endl
<< "-> true_(as(wxi)) = " << eve::true_(eve::as(wxi)) << std::endl;
double xf;
std::int16_t xi;
std::cout << "---- scalar" << std::endl
<< "-> true_(as<float>()) = " << eve::true_(eve::as(float())) << std::endl
<< "-> true_(as<std::int16_t>()) = " << eve::true_(eve::as(std::int16_t())) << std::endl
<< "-> true_(as<xf)) = " << eve::true_(eve::as(xf)) << std::endl
<< "-> true_(as<xi)) = " << eve::true_(eve::as(xi)) << std::endl;
std::cout << "-> constexpr true_ = " << constexpr_true_<float>() << std::endl;
return 0;
}
Wrapper for SIMD registers.
Definition wide.hpp:70