Ignore:
Timestamp:
Jun 4, 2018, 3:20:10 AM (13 months ago)
Author:
xwa163
Message:

Init checkin for LZ4ParallelByteStreamAioKernel and related pipeline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.cpp

    r6062 r6064  
    613613}
    614614
     615void LZ4GrepGenerator::generateParallelAioPipeline(re::RE* regex) {
     616    auto & iBuilder = mPxDriver.getBuilder();
     617    this->generateCountOnlyMainFunc(iBuilder);
     618
     619    this->generateLoadByteStreamAndBitStream(iBuilder);
     620    parabix::StreamSetBuffer * decompressedByteStream = this->generateParallelAIODecompression(iBuilder);
     621
     622
     623    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks());
     624    Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, /*aligned = */ true, "a");
     625//    Kernel * s2pk = mPxDriver.addKernelInstance<S2PByPextKernel>(iBuilder, "a");
     626    mPxDriver.makeKernelCall(s2pk, {decompressedByteStream}, {decompressionBitStream});
     627
     628
     629    StreamSetBuffer * LineBreakStream;
     630    StreamSetBuffer * Matches;
     631    std::vector<re::RE*> res = {regex};
     632    std::tie(LineBreakStream, Matches) = grepPipeline(res, decompressionBitStream);
     633
     634
     635//    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     636//    outK->setInitialArguments({iBuilder->GetString("/Users/wxy325/developer/LZ4-sample-files/workspace/lz4d-normal/8k_.txt")});
     637//    mPxDriver.makeKernelCall(outK, {decompressedStream}, {});
     638
     639    kernel::Kernel * matchCountK = mPxDriver.addKernelInstance<kernel::PopcountKernel>(iBuilder);
     640    mPxDriver.makeKernelCall(matchCountK, {Matches}, {});
     641    mPxDriver.generatePipelineIR();
     642
     643    iBuilder->setKernel(matchCountK);
     644    Value * matchedLineCount = iBuilder->getAccumulator("countResult");
     645    matchedLineCount = iBuilder->CreateZExt(matchedLineCount, iBuilder->getInt64Ty());
     646
     647    mPxDriver.deallocateBuffers();
     648
     649    iBuilder->CreateRet(matchedLineCount);
     650
     651    mPxDriver.finalizeObject();
     652}
     653
    615654void LZ4GrepGenerator::generateAioPipeline(re::RE *regex) {
    616655    auto & iBuilder = mPxDriver.getBuilder();
     
    618657
    619658    // GeneratePipeline
    620     this->generateLoadByteStreamAndBitStream(iBuilder);
     659//    this->generateLoadByteStreamAndBitStream(iBuilder);
     660    this->generateLoadByteStream(iBuilder);
    621661    parabix::StreamSetBuffer * decompressedByteStream = this->generateAIODecompression(iBuilder);
    622662
Note: See TracChangeset for help on using the changeset viewer.