Ignore:
Timestamp:
Nov 12, 2018, 5:19:32 PM (6 months ago)
Author:
cameron
Message:

Fix FieldCompress? kernels to have user settable field width; update to use extraction method

File:
1 edited

Legend:

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

    r6189 r6199  
    169169    Value * lo_bytes[8];
    170170    p2s(b, lo_input, lo_bytes, mBasisSetNumbering);
    171 
    172     Value * const fieldCounts = b->loadInputStreamBlock("fieldCounts", b->getInt32(0));
     171    Value * const extractionMask = b->loadInputStreamBlock("extractionMask", b->getInt32(0));
     172    Value * const fieldCounts = b->simd_popcount(unitsPerRegister, extractionMask);
    173173    Value * unitCounts = partial_sum_popcounts(b, unitsPerRegister, fieldCounts);
    174    
    175174    Value * outputPtr = b->getOutputStreamBlockPtr("i16Stream", b->getInt32(0));
    176175    outputPtr = b->CreatePointerCast(outputPtr, int16PtrTy);
     
    228227P2SKernelWithCompressedOutput::P2SKernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering numbering)
    229228: BlockOrientedKernel("p2s_compress" + cc::numberingSuffix(numbering),
    230 {Binding{b->getStreamSetTy(8, 1), "basisBits"}, Binding{b->getStreamSetTy(1, 1), "fieldCounts"}},
     229{Binding{b->getStreamSetTy(8, 1), "basisBits"}, Binding{b->getStreamSetTy(1, 1), "extractionMask"}},
    231230{Binding{b->getStreamSetTy(1, 8), "byteStream", BoundedRate(0, 1)}},
    232231{}, {}, {}),
     
    245244
    246245P2S16KernelWithCompressedOutput::P2S16KernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> &,
    247                                                                  StreamSet * basisBits, StreamSet * fieldCounts, StreamSet * i16Stream,
     246                                                                 StreamSet * basisBits, StreamSet * extractionMask, StreamSet * i16Stream,
    248247                                                                 cc::BitNumbering numbering)
    249248: BlockOrientedKernel("p2s_16_compress" + cc::numberingSuffix(numbering),
    250249{Binding{"basisBits", basisBits},
    251 Binding{"fieldCounts", fieldCounts}},
     250Binding{"extractionMask", extractionMask}},
    252251{Binding{"i16Stream", i16Stream, BoundedRate(0, 1)}},
    253252{}, {}, {}),
Note: See TracChangeset for help on using the changeset viewer.