Example #1
0
KOKKOS_MACRO_DEVICE_AND_HOST_FUNCTION
bool toBool(const Expr<T,KOKKOS_MACRO_DEVICE>& xx) {
    const typename Expr<T,KOKKOS_MACRO_DEVICE>::derived_type& x =
        xx.derived();
    bool is_zero = true;
    for (int i=0; i<x.size(); i++)
        is_zero = is_zero && (x.coeff(i) == 0.0);
    return !is_zero;
}
 KOKKOS_INLINE_FUNCTION
 bool toBool(const Expr<T>& xx) {
   const typename Expr<T>::derived_type& x =
     xx.derived();
   bool is_zero = true;
   for (int i=0; i<x.size(); i++)
     is_zero = is_zero && (x.coeff(i) == 0.0);
   return !is_zero;
 }
Example #3
0
KOKKOS_MACRO_DEVICE_AND_HOST_FUNCTION
inline bool operator ! (const Expr<T,KOKKOS_MACRO_DEVICE>& expr)
{
    return ! expr.derived().val();
}
 KOKKOS_INLINE_FUNCTION
 bool operator ! (const Expr<T>& expr)
 {
   return ! expr.derived().val();
 }