Ignore:
Timestamp:
Feb 17, 2017, 1:31:45 PM (2 years ago)
Author:
cameron
Message:

Eliminate explicit storage of produced/processed counts for FixedRatio? streams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/radix64.cpp

    r5325 r5327  
    7878        expand_3_4_shuffle[j] = ConstantVector::get(Idxs);
    7979    }
    80     Constant * Const3 = iBuilder->getSize(3);
    81     Constant * Const4 = iBuilder->getSize(4);
    82     Constant * Const6 = iBuilder->getSize(6);
    83     Constant * Const5 = iBuilder->getSize(5);
    8480
    8581    Constant * tripleBlockSize = iBuilder->getSize(3 * iBuilder->getStride());
     
    159155    loopExitOutput_ptr->addIncoming(loopNextOutputPack, expand_3_4_loop);
    160156
    161     // Update the produced and processed items count based on the loopItemsToDo value.
     157    // Update the processed items count based on the loopItemsToDo value.
    162158    processed = iBuilder->CreateAdd(processed, loopItemsToDo);
    163159    setProcessedItemCount("sourceStream", processed);
    164160
    165     // We have produced 4 output bytes for every 3 input bytes.
    166     Value * totalProduced = iBuilder->CreateMul(iBuilder->CreateUDiv(processed, Const3), Const4);
    167     setProducedItemCount("expandedStream", totalProduced);
    168161
    169162    // Except for final segment processing, we are done.
     
    236229    setProcessedItemCount("sourceStream", processed);
    237230
    238     // We have produced 4 output bytes for every 3 input bytes.  For radix64 applications,
    239     // each output byte will have six significant bits.   If the number of bytes is not
    240     // a multiple of 3, then there will be 8 or 16 additional bits to encode.  This will
    241     // require 2 or 3 additional output bytes given that each output byte only encodes 6 bits.
    242    
    243     Value * totalBits = iBuilder->CreateShl(processed, Const3);
    244     totalProduced = iBuilder->CreateUDiv(iBuilder->CreateAdd(totalBits, Const5), Const6);
    245     setProducedItemCount("expandedStream", totalProduced);
    246231   
    247232    iBuilder->CreateBr(expand3_4_exit);
     
    486471: BlockOrientedKernel(iBuilder, "base64",
    487472            {Binding{iBuilder->getStreamSetTy(1, 8), "radix64stream"}},
    488             {Binding{iBuilder->getStreamSetTy(1, 8), "base64stream"}},
     473            {Binding{iBuilder->getStreamSetTy(1, 8), "base64stream", new ProcessingRate()}},
    489474            {}, {}, {}) {
    490475    setDoBlockUpdatesProducedItemCountsAttribute(true);
Note: See TracChangeset for help on using the changeset viewer.