         if (LOGICAL_WARP_THREADS != 32)
             next_flag = CUB_MIN(next_flag, LOGICAL_WARP_THREADS);
 
+        #pragma unroll
         for (int STEP = 0; STEP < STEPS; STEP++)
         {
             const int OFFSET = 1 << STEP;

        int                 folded_items_per_warp,  ///< [in] Total number of valid items folded into each logical warp
        ReductionOp         reduction_op)           ///< [in] Reduction operator
    {
        for (int STEP = 0; STEP < STEPS; STEP++)
        {
            const int OFFSET = 1 << STEP;

            // Share input through buffer
            ThreadStore<STORE_VOLATILE>(&temp_storage[lane_id], input);

            // Update input if peer_addend is in range
            if ((ALL_LANES_VALID && IS_POW_OF_TWO) || ((lane_id + OFFSET) * FOLDED_ITEMS_PER_LANE < folded_items_per_warp))
            {
                T peer_addend = ThreadLoad<LOAD_VOLATILE>(&temp_storage[lane_id + OFFSET]);
                input = reduction_op(input, peer_addend);
            }
        }

        return input;
    }

    /**
     * Ballot-based segmented reduce


        SmemFlag flag_status = (flag) ? SET : UNSET;

        #pragma unroll
        for (int STEP = 0; STEP < STEPS; STEP++)
        {
            const int OFFSET = 1 << STEP;
