Ignore:
Timestamp:
Jun 27, 2018, 3:48:18 AM (10 months ago)
Author:
xwa163
Message:

Implement bitstream decompression version of LZ4 Aio Kernel

File:
1 edited

Legend:

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

    r6112 r6118  
    551551}
    552552
     553void LZ4GrepGenerator::generateBitStreamAioPipeline(re::RE* regex) {
     554    auto & iBuilder = mPxDriver.getBuilder();
     555    this->generateCountOnlyMainFunc(iBuilder);
     556
     557    // GeneratePipeline
     558    this->generateLoadByteStreamAndBitStream(iBuilder);
     559    StreamSetBuffer * const decompressionBitStream = this->generateBitStreamAIODecompression(iBuilder);
     560
     561    StreamSetBuffer * LineBreakStream;
     562    StreamSetBuffer * Matches;
     563    std::vector<re::RE*> res = {regex};
     564    std::tie(LineBreakStream, Matches) = grepPipeline(res, decompressionBitStream);
     565
     566    /*
     567    StreamSetBuffer * const decompressionByteStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getDecompressedBufferBlocks(iBuilder));
     568    Kernel * p2sK = mPxDriver.addKernelInstance<P2SKernel>(iBuilder);
     569    mPxDriver.makeKernelCall(p2sK, {decompressionBitStream}, {decompressionByteStream});
     570
     571    Kernel * outK = mPxDriver.addKernelInstance<FileSink>(iBuilder, 8);
     572    outK->setInitialArguments({iBuilder->GetString("/Users/wxy325/developer/LZ4-sample-files/workspace/lz4d-normal/8k_.txt")});
     573    mPxDriver.makeKernelCall(outK, {decompressionByteStream}, {});
     574    */
     575    kernel::Kernel * matchCountK = mPxDriver.addKernelInstance<kernel::PopcountKernel>(iBuilder);
     576
     577    mPxDriver.makeKernelCall(matchCountK, {Matches}, {});
     578    mPxDriver.generatePipelineIR();
     579
     580    iBuilder->setKernel(matchCountK);
     581    Value * matchedLineCount = iBuilder->getAccumulator("countResult");
     582    matchedLineCount = iBuilder->CreateZExt(matchedLineCount, iBuilder->getInt64Ty());
     583    mPxDriver.deallocateBuffers();
     584
     585    iBuilder->CreateRet(matchedLineCount);
     586
     587    mPxDriver.finalizeObject();
     588}
     589
    553590void LZ4GrepGenerator::generateSwizzledAioPipeline(re::RE* regex) {
    554591    auto & iBuilder = mPxDriver.getBuilder();
Note: See TracChangeset for help on using the changeset viewer.