Ignore:
Timestamp:
Aug 11, 2018, 9:19:42 PM (3 months ago)
Author:
xwa163
Message:
  1. LZ4 Grep: complete utf8 character classes for multiplexing pipeline
  2. Implement multiple streams version of S2P and P2S
File:
1 edited

Legend:

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

    r6135 r6145  
    6767}
    6868
     69
     70void P2SMultipleStreamsKernel::generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> &b) {
     71    Value * p_bitblock[8];
     72
     73    unsigned iStreamIndex = 0;
     74    for (unsigned i = 0; i < mNumsOfStreams.size(); i++) {
     75        for (unsigned j = 0; j < mNumsOfStreams[i]; j++) {
     76            p_bitblock[iStreamIndex] = b->loadInputStreamBlock("basisBits_" + std::to_string(i), b->getInt32(j));
     77            iStreamIndex++;
     78        }
     79    }
     80    while (iStreamIndex < 8) {
     81        p_bitblock[iStreamIndex] = ConstantVector::getNullValue(b->getBitBlockType());
     82        iStreamIndex++;
     83    }
     84
     85    Value * s_bytepack[8];
     86    p2s(b, p_bitblock, s_bytepack, mBasisSetNumbering);
     87    for (unsigned j = 0; j < 8; ++j) {
     88        b->storeOutputStreamPack("byteStream", b->getInt32(0), b->getInt32(j), s_bytepack[j]);
     89    }
     90}
     91
     92
    6993inline Value * partial_sum_popcounts(const std::unique_ptr<KernelBuilder> & iBuilder, const unsigned fw, Value * popcounts) {
    7094    Value * summed_counts = popcounts;
     
    192216}
    193217
     218P2SMultipleStreamsKernel::P2SMultipleStreamsKernel(const std::unique_ptr<kernel::KernelBuilder> &b,
     219                                                   cc::BitNumbering basisNumbering,
     220                                                   std::vector<unsigned> numsOfStreams)
     221        : BlockOrientedKernel("p2sMultipleStreams" + cc::numberingSuffix(basisNumbering),
     222                              {/*Binding{b->getStreamSetTy(numOfStreams, 1), "basisBits"}*/},
     223                              {Binding{b->getStreamSetTy(1, 8), "byteStream"}},
     224                              {}, {}, {}),
     225          mBasisSetNumbering(basisNumbering),
     226          mNumsOfStreams(numsOfStreams) {
     227
     228    for (unsigned i = 0; i < numsOfStreams.size(); i++) {
     229        mStreamSetInputs.push_back(Binding{b->getStreamSetTy(numsOfStreams[i], 1), "basisBits_" + std::to_string(i)});
     230    }
     231}
     232
    194233P2SKernelWithCompressedOutput::P2SKernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering numbering)
    195234: BlockOrientedKernel("p2s_compress" + cc::numberingSuffix(numbering),
     
    219258}
    220259
    221 }
     260
     261}
Note: See TracChangeset for help on using the changeset viewer.