MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TYPED_TEST

Function TYPED_TEST

test/reduce.cpp:625–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625TYPED_TEST(ReduceByKey, MultiBlockReduceSingleval) {
626 SUPPORTED_TYPE_CHECK(TypeParam);
627 array keys = constant(0, 1024 * 1024, s32);
628 array vals = constant(1, 1024 * 1024,
629 (af_dtype)af::dtype_traits<TypeParam>::af_type);
630
631 array keyResGold = constant(0, 1);
632 using promoted_t = typename promote_type<TypeParam, af_sum>::type;
633 array valsReducedGold = constant(
634 1024 * 1024, 1, (af_dtype)af::dtype_traits<promoted_t>::af_type);
635
636 array keyRes, valsReduced;
637 sumByKey(keyRes, valsReduced, keys, vals);
638
639 ASSERT_TRUE(allTrue<bool>(keyResGold == keyRes));
640 ASSERT_ARRAYS_NEAR(valsReducedGold, valsReduced, 1e-5);
641}
642
643void reduce_by_key_test(std::string test_fn) {
644 vector<dim4> numDims;

Callers

nothing calls this directly

Calls 15

constantFunction · 0.85
sumByKeyFunction · 0.85
productByKeyFunction · 0.85
minByKeyFunction · 0.85
maxByKeyFunction · 0.85
allTrueByKeyFunction · 0.85
anyTrueByKeyFunction · 0.85
countByKeyFunction · 0.85
typed_assert_eqFunction · 0.85
hostMethod · 0.80
tileFunction · 0.50
dim4Class · 0.50

Tested by

no test coverage detected