Ignore:
Timestamp:
Dec 30, 2017, 4:43:19 PM (13 months ago)
Author:
cameron
Message:

Parsing of byte CCs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5755 r5814  
    9292WordCountKernel::WordCountKernel (const std::unique_ptr<kernel::KernelBuilder> & b)
    9393: PabloKernel(b, "wc",
    94     {Binding{b->getStreamSetTy(8, 1), "u8bit"}},
    95     {},
     94    {Binding{b->getStreamSetTy(8, 1), "u8bit"}, Binding{b->getStreamSetTy(1, 8), "u8byte"}},
     95    {Binding{b->getStreamSetTy(1, 8), "dblbyte"}},
    9696    {},
    9797    {Binding{b->getSizeTy(), "lineCount"}, Binding{b->getSizeTy(), "wordCount"}, Binding{b->getSizeTy(), "charCount"}}) {
     
    103103    //  input: 8 basis bit streams
    104104    const auto u8bitSet = getInputStreamVar("u8bit");
     105    const auto u8byteSet = getInputStreamVar("u8byte");
     106    const auto dblbyteSet = getOutputStreamVar("dblbyte");
    105107    //  output: 3 counters
    106108
     
    109111    PabloBuilder & pb = ccc.getBuilder();
    110112
     113    PabloAST * bytes = pb.createExtract(u8byteSet, pb.getInteger(0));
     114    PabloAST * dbl = pb.createAdd(bytes, bytes);
     115    pb.createAssign(pb.createExtract(dblbyteSet, pb.getInteger(0)), dbl);
     116   
    111117    Var * lc = getOutputScalarVar("lineCount");
    112118    Var * wc = getOutputScalarVar("wordCount");
     
    164170
    165171    StreamSetBuffer * const ByteStream = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
     172    StreamSetBuffer * const ByteOut = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), segmentSize * bufferSegments);
    166173
    167174    StreamSetBuffer * const BasisBits = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), segmentSize * bufferSegments);
     
    175182   
    176183    Kernel * wck = pxDriver.addKernelInstance<WordCountKernel>(iBuilder);
    177     pxDriver.makeKernelCall(wck, {BasisBits}, {});
     184    pxDriver.makeKernelCall(wck, {BasisBits,ByteStream}, {ByteOut});
    178185
    179186    pxDriver.generatePipelineIR();
Note: See TracChangeset for help on using the changeset viewer.