     Initialize(entropy_reduction, h_keys_in, num_items, max_segment);
     int num_segments = Solve(h_keys_in, h_keys_reference, h_values_in, h_values_reference, equality_op, reduction_op, num_items);
 
-    printf("\nPointer %s cub::DeviceReduce::ReduceByKey %d items, %d segments (avg run length %d), {%s,%s} key value pairs, entropy_reduction %d\n",
+    printf("\nIterator %s cub::DeviceReduce::ReduceByKey %s reduction of %d items, %d segments (avg run length %d), {%s,%s} key value pairs, max_segment %d, entropy_reduction %d\n",
         (BACKEND == CDP) ? "CDP CUB" : (BACKEND == THRUST) ? "Thrust" : "CUB",
+        (Equals<ReductionOp, Sum>::VALUE) ? "Sum" : "Max",
         num_items, num_segments, num_items / num_segments,
         key_type_string, value_type_string,
-        entropy_reduction);
+        max_segment, entropy_reduction);
     fflush(stdout);
 
     // Allocate problem device arrays

    Initialize(entropy_reduction, h_keys_in, num_items, max_segment);
    int num_segments = Solve(h_keys_in, h_keys_reference, h_values_in, h_values_reference, equality_op, reduction_op, num_items);

    printf("\nPointer %s cub::DeviceReduce::ReduceByKey %d items, %d segments (avg run length %d), {%s,%s} key value pairs, entropy_reduction %d\n",
        (BACKEND == CDP) ? "CDP CUB" : (BACKEND == THRUST) ? "Thrust" : "CUB",
        num_items, num_segments, num_items / num_segments,
        key_type_string, value_type_string,
        entropy_reduction);
    fflush(stdout);

    // Allocate problem device arrays

    if (d_keys_in) CubDebugExit(g_allocator.DeviceFree(d_keys_in));
}

/**
 * Test DeviceSelect on iterator type
 */
template <
    Backend         BACKEND,
    typename        Key,
    typename        Value,
    typename        ReductionOp>
void TestIterator(
    int             num_items,
    int             entropy_reduction,
    int             max_segment,
    ReductionOp     reduction_op,
    char*           key_type_string,
    char*           value_type_string,
    Int2Type<false> is_primitive)
{}


/**
 * Test different gen modes
 */
template <
    Backend         BACKEND,
    typename        Key,
    typename        Value,
    typename        ReductionOp>
void Test(
    int             num_items,
    ReductionOp     reduction_op,
    char*           key_type_string,
    char*           value_type_string)
{
    // Evaluate different max-segment lengths
    for (int max_segment = 1; max_segment < CUB_MIN(num_items, (unsigned short) -1); max_segment *= 11)
    {
        // 0 key-bit entropy reduction rounds
        TestPointer<BACKEND, Key, Value>(num_items, 0, max_segment, reduction_op, key_type_string, value_type_string);
        TestIterator<BACKEND, Key, Value>(num_items, 0, max_segment, reduction_op, key_type_string, value_type_string, Int2Type<Traits<Value>::PRIMITIVE>());

        if (max_segment > 1)
        {
            // 2 key-bit entropy reduction rounds
            TestPointer<BACKEND, Key, Value>(num_items, 2, max_segment, reduction_op, key_type_string, value_type_string);
            TestIterator<BACKEND, Key, Value>(num_items, 2, max_segment, reduction_op, key_type_string, value_type_string, Int2Type<Traits<Value>::PRIMITIVE>());

            // 7 key-bit entropy reduction rounds
            TestPointer<BACKEND, Key, Value>(num_items, 7, max_segment, reduction_op, key_type_string, value_type_string);
            TestIterator<BACKEND, Key, Value>(num_items, 7, max_segment, reduction_op, key_type_string, value_type_string, Int2Type<Traits<Value>::PRIMITIVE>());
        }
    }
}


/**
 * Test different dispatch
 */
template <
    typename        Key,
    typename        Value,
    typename        ReductionOp>
void TestDispatch(
    int             num_items,
    ReductionOp     reduction_op,
    char*           key_type_string,
    char*           value_type_string)
{
    Test<CUB, Key, Value>(num_items, reduction_op, key_type_string, value_type_string);
#ifdef CUB_CDP
    Test<CDP, Key, Value>(num_items, reduction_op, key_type_string, value_type_string);
#endif
}


/**
 * Test different input sizes
 */
template <
    typename        Key,
    typename        Value,
    typename        ReductionOp>
void TestSize(
    int             num_items,
    ReductionOp     reduction_op,
    char*           key_type_string,
    char*           value_type_string)
{
    if (num_items < 0)
    {
        TestDispatch<Key, Value>(1,        reduction_op, key_type_string, value_type_string);
        TestDispatch<Key, Value>(100,      reduction_op, key_type_string, value_type_string);
        TestDispatch<Key, Value>(10000,    reduction_op, key_type_string, value_type_string);
        TestDispatch<Key, Value>(1000000,  reduction_op, key_type_string, value_type_string);
    }
    else
    {
        TestDispatch<Key, Value>(num_items, reduction_op, key_type_string, value_type_string);
    }

}


template <
    typename        Key,
    typename        Value>
