Ignore:
Timestamp:
May 6, 2017, 4:05:05 PM (2 years ago)
Author:
nmedfort
Message:

Continued refactoring work.

File:
1 edited

Legend:

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

    r5431 r5435  
    1414namespace kernel {
    1515
    16 inline std::vector<Value *> parallel_prefix_deletion_masks(IDISA::IDISA_Builder * iBuilder, const unsigned fw, Value * del_mask) {
     16inline std::vector<Value *> parallel_prefix_deletion_masks(IDISA::IDISA_Builder * const iBuilder, const unsigned fw, Value * del_mask) {
    1717    Value * m = iBuilder->simd_not(del_mask);
    1818    Value * mk = iBuilder->simd_slli(fw, del_mask, 1);
     
    3131}
    3232
    33 inline Value * apply_parallel_prefix_deletion(IDISA::IDISA_Builder * iBuilder, const unsigned fw, Value * del_mask, const std::vector<Value *> & mv, Value * strm) {
     33inline Value * apply_parallel_prefix_deletion(IDISA::IDISA_Builder * const iBuilder, const unsigned fw, Value * del_mask, const std::vector<Value *> & mv, Value * strm) {
    3434    Value * s = iBuilder->simd_and(strm, iBuilder->simd_not(del_mask));
    3535    for (unsigned i = 0; i < mv.size(); i++) {
     
    4141}
    4242
    43 inline Value * partial_sum_popcount(IDISA::IDISA_Builder * iBuilder, const unsigned fw, Value * mask) {
     43inline Value * partial_sum_popcount(IDISA::IDISA_Builder * const iBuilder, const unsigned fw, Value * mask) {
    4444    Value * field = iBuilder->simd_popcount(fw, mask);
    4545    const auto count = iBuilder->getBitBlockWidth() / fw;
     
    8181}
    8282
    83 DeletionKernel::DeletionKernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount)
    84 : BlockOrientedKernel(iBuilder, "del" + std::to_string(fw) + "_" + std::to_string(streamCount),
     83DeletionKernel::DeletionKernel(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder, unsigned fw, unsigned streamCount)
     84: BlockOrientedKernel("del" + std::to_string(fw) + "_" + std::to_string(streamCount),
    8585              {Binding{iBuilder->getStreamSetTy(streamCount), "inputStreamSet"},
    8686               Binding{iBuilder->getStreamSetTy(), "delMaskSet"}},
     
    9494const unsigned PEXT_width = 64;
    9595
    96 inline std::vector<Value *> get_PEXT_masks(IDISA::IDISA_Builder * iBuilder, Value * del_mask) {
     96inline std::vector<Value *> get_PEXT_masks(IDISA::IDISA_Builder * const iBuilder, Value * del_mask) {
    9797    Value * m = iBuilder->fwCast(PEXT_width, iBuilder->simd_not(del_mask));
    9898    std::vector<Value *> masks;
     
    105105// Apply PEXT deletion to a collection of blocks and swizzle the result.
    106106// strms contains the blocks to process
    107 inline std::vector<Value *> apply_PEXT_deletion_with_swizzle(IDISA::IDISA_Builder * iBuilder, const std::vector<Value *> & masks, std::vector<Value *> strms) {   
     107inline std::vector<Value *> apply_PEXT_deletion_with_swizzle(IDISA::IDISA_Builder * const iBuilder, const std::vector<Value *> & masks, std::vector<Value *> strms) {
    108108    Value * PEXT_func = nullptr;
    109109    if (PEXT_width == 64) {
     
    148148}
    149149
    150 inline Value * apply_PEXT_deletion(IDISA::IDISA_Builder * iBuilder, const std::vector<Value *> & masks, Value * strm) { 
     150inline Value * apply_PEXT_deletion(IDISA::IDISA_Builder * const iBuilder, const std::vector<Value *> & masks, Value * strm) {
    151151    Value * PEXT_func = nullptr;
    152152    if (PEXT_width == 64) {
     
    224224}
    225225
    226 DeleteByPEXTkernel::DeleteByPEXTkernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount, bool shouldSwizzle)
    227     : BlockOrientedKernel(iBuilder, "PEXTdel" + std::to_string(fw) + "_" + std::to_string(streamCount) + (shouldSwizzle ? "swiz" : "noswiz"),
    228                       {Binding{iBuilder->getStreamSetTy(streamCount), "inputStreamSet"},
    229                           Binding{iBuilder->getStreamSetTy(), "delMaskSet"}},
    230                       {}, {}, {}, {})
     226DeleteByPEXTkernel::DeleteByPEXTkernel(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder, unsigned fw, unsigned streamCount, bool shouldSwizzle)
     227: BlockOrientedKernel("PEXTdel" + std::to_string(fw) + "_" + std::to_string(streamCount) + (shouldSwizzle ? "swiz" : "noswiz"),
     228                  {Binding{iBuilder->getStreamSetTy(streamCount), "inputStreamSet"},
     229                      Binding{iBuilder->getStreamSetTy(), "delMaskSet"}},
     230                  {}, {}, {}, {})
    231231, mDelCountFieldWidth(fw)
    232232, mStreamCount(streamCount)
     
    262262//
    263263
    264    
    265 
    266 SwizzledBitstreamCompressByCount::SwizzledBitstreamCompressByCount(IDISA::IDISA_Builder * iBuilder, unsigned bitStreamCount, unsigned fieldWidth)
    267     : BlockOrientedKernel(iBuilder, "swizzled_compress" + std::to_string(fieldWidth) + "_" + std::to_string(bitStreamCount),
    268                          {Binding{iBuilder->getStreamSetTy(), "countsPerStride"}}, {}, {}, {}, {})
     264SwizzledBitstreamCompressByCount::SwizzledBitstreamCompressByCount(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder, unsigned bitStreamCount, unsigned fieldWidth)
     265: BlockOrientedKernel("swizzled_compress" + std::to_string(fieldWidth) + "_" + std::to_string(bitStreamCount),
     266                     {Binding{iBuilder->getStreamSetTy(), "countsPerStride"}}, {}, {}, {}, {})
    269267, mBitStreamCount(bitStreamCount)
    270268    , mFieldWidth(fieldWidth)
     
    283281        addScalar(iBuilder->getSizeTy(), "pendingOffset");
    284282}
    285 
    286283   
    287284void SwizzledBitstreamCompressByCount::generateDoBlockMethod() {
Note: See TracChangeset for help on using the changeset viewer.