51 constexpr
int ensemble_size = 8;
57 scalar a = (scalar) 1.;
60 scalar b = (scalar) 2.;
63 std::cout << std::endl;
64 std::cout << a << std::endl;
65 std::cout << b << std::endl;
66 std::cout << m1 << std::endl;
71 for (
auto i=3; i<ensemble_size; ++i)
79 constexpr
int ensemble_size = 16;
85 scalar a = (scalar) 1.;
88 scalar b = (scalar) 2.;
91 std::cout << std::endl;
92 std::cout << a << std::endl;
93 std::cout << b << std::endl;
94 std::cout << m1 << std::endl;
99 for (
auto i=3; i<ensemble_size; ++i)
107 constexpr
int ensemble_size = 8;
113 scalar a = (scalar) 1.;
116 scalar b = (scalar) 2.;
120 std::cout << m1 << std::endl;
121 std::cout << m2 << std::endl;
122 for (
auto i=0; i<ensemble_size; ++i)
128 constexpr
int ensemble_size = 8;
134 scalar a = (scalar) 1.;
137 scalar b = (scalar) 2.;
145 std::cout << m1 << std::endl;
146 std::cout << mul << std::endl;
148 std::cout << mul2 << std::endl;
149 std::cout << mul3 << std::endl;
154 for (
auto i=3; i<ensemble_size; ++i)
162 constexpr
int ensemble_size = 16;
168 scalar a = (scalar) 1.;
171 scalar b = (scalar) 2.;
175 std::cout << m1 << std::endl;
176 std::cout << mul << std::endl;
181 for (
auto i=3; i<ensemble_size; ++i)
187 constexpr
int ensemble_size = 8;
193 scalar a = (scalar) 1.;
196 scalar b = (scalar) 2.;
199 scalar mul = m1*a + !m1*b;
200 scalar mul2 = a*m1 + !m1*b;
201 std::cout << m1 << std::endl;
202 std::cout << mul << std::endl;
203 std::cout << mul2 << std::endl;
208 for (
auto i=3; i<ensemble_size; ++i)
216 constexpr
int ensemble_size = 8;
222 using namespace MaskLogic;
224 scalar a = (scalar) 1.;
227 scalar b = (scalar) 2.;
230 auto m2 = a>(scalar) 0.;
233 std::cout << m1 << std::endl;
234 std::cout << m2 << std::endl;
235 std::cout << m3<< std::endl;
236 std::cout << m4<< std::endl;
260 constexpr
int ensemble_size = 8;
266 using namespace MaskLogic;
268 scalar a = (scalar) 1.;
271 scalar b = (scalar) 2.;
275 std::cout << m1 << std::endl;
276 std::cout << m2 << std::endl;
289 constexpr
int ensemble_size = 8;
295 using namespace MaskLogic;
297 scalar a = (scalar) 1.;
300 scalar b = (scalar) 2.;
304 std::cout << m1 << std::endl;
305 std::cout << m2 << std::endl;
318 constexpr
int ensemble_size = 8;
324 using namespace MaskLogic;
326 scalar a = (scalar) 1.;
328 scalar b = (scalar) 2.;
332 std::cout << m1 << std::endl;
333 std::cout << m2 << std::endl;
346 constexpr
int ensemble_size = 8;
352 scalar a = (scalar) 1.;
354 scalar b = (scalar) 2.;
359 std::cout << m1 << std::endl;
360 std::cout << m2 << std::endl;
388 constexpr
int ensemble_size = 8;
394 scalar a = (scalar) 1.;
396 scalar b = (scalar) 2.;
402 std::cout << m1 << std::endl;
403 std::cout << m2 << std::endl;
404 std::cout << m3 << std::endl;
410 constexpr
int ensemble_size = 8;
416 scalar a = (scalar) 1.;
418 scalar b = (scalar) 2.;
424 std::cout << m1 << std::endl;
425 std::cout << m2 << std::endl;
426 std::cout << m3 << std::endl;
432 constexpr
int ensemble_size = 8;
438 scalar a = (scalar) 1.;
440 scalar b = (scalar) 2.;
442 std::cout << a << std::endl;
443 std::cout << b << std::endl;
451 std::cout << m3 << std::endl;
457 constexpr
int ensemble_size = 8;
463 scalar a = (scalar) 1.;
465 scalar b = (scalar) 2.;
469 std::cout << m1 << std::endl;
470 std::cout << m2 << std::endl;
471 auto m3 = (a>0.) - (a>b);
472 std::cout << m3 << std::endl;
478 constexpr
int ensemble_size = 8;
485 scalar a = (scalar) 1.;
496 constexpr
int ensemble_size = 8;
502 scalar a = (scalar) 1.;
505 scalar b = (scalar) 2.;
509 std::cout << std::endl;
510 std::cout << a << std::endl;
511 std::cout << b << std::endl;
513 std::cout << a << std::endl;
514 std::cout << b << std::endl;
520 constexpr
int ensemble_size = 8;
526 scalar a = (scalar) 1.;
547 constexpr
int ensemble_size = 8;
553 scalar a = (scalar) 1.;
565 constexpr
int ensemble_size = 8;
572 std::cout << a2 << std::endl;
574 scalar a = (scalar) 1.;
576 auto m = (a>(scalar) 0.);
577 std::cout <<
"m is computed" << std::endl;
578 std::cout << m << std::endl;
580 std::cout <<
"m is computed" << std::endl;
581 std::cout << m << std::endl;
583 std::cout << a << std::endl;
584 std::cout << m << std::endl;
585 std::cout << (a>=(scalar) 0. )<< std::endl;
586 std::cout << (a> 0. )<< std::endl;
587 std::cout << (a>= 0.) << std::endl;
588 std::cout << (0.<a )<< std::endl;
589 std::cout << (0.<=a) << std::endl;
591 mask_assign<scalar>(m,a) /= {a, 2.,-1.};
603 mask_assign<scalar>(m,a) /= {4.,2.,-1.};
619 Kokkos::initialize();
KOKKOS_INLINE_FUNCTION Vector< S > copysign(const Vector< S > &a1, const Vector< S > &a2)
Stokhos::StandardStorage< int, double > storage_type
Statically allocated storage class.
Kokkos::DefaultExecutionSpace execution_space
KOKKOS_INLINE_FUNCTION bool OR(Mask< T > m)
KOKKOS_INLINE_FUNCTION MaskedAssign< scalar > mask_assign(bool b, scalar *s)
static int runUnitTestsFromMain(int argc, char *argv[])
int main(int argc, char **argv)
KOKKOS_INLINE_FUNCTION bool AND(Mask< T > m)
KOKKOS_INLINE_FUNCTION bool XOR(Mask< T > m)
#define TEST_EQUALITY(v1, v2)
KOKKOS_INLINE_FUNCTION Mask< Sacado::MP::Vector< S > > signbit_v(const Sacado::MP::Vector< S > &a1)