Ignore:
Timestamp:
Apr 8, 2016, 2:40:24 PM (3 years ago)
Author:
cameron
Message:

u8u16 progress

File:
1 edited

Legend:

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

    r5004 r5007  
    3838}
    3939
     40Value * partial_sum_popcount(IDISA::IDISA_Builder * iBuilder, unsigned fw, Value * mask) {
     41    Value * per_field = iBuilder->simd_popcount(fw, mask);
     42    for (unsigned move = 1; move < iBuilder->getBitBlockWidth()/fw; move *= 2) {
     43        per_field = iBuilder->simd_add(fw, per_field, iBuilder->mvmd_slli(fw, per_field, move));
     44    }
     45    return per_field;
     46}
     47
    4048// Apply deletion to a set of stream_count input streams to produce a set of output streams.
    4149// Kernel inputs: stream_count data streams plus one del_mask stream
     50// Outputs: the deleted streams, plus a partial sum popcount
    4251void generateDeletionKernel(Module * m, IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned stream_count, KernelBuilder * kBuilder) {
    4352   
     
    4756    }
    4857    kBuilder->addInputStream(1, "del_mask");
     58    kBuilder->addOutputStream(1);  // partial_sum popcount
    4959    kBuilder->prepareFunction();
    5060   
     
    5767        iBuilder->CreateBlockAlignedStore(output, kBuilder->getOutputStream(j));
    5868    }
     69    Value * counts = partial_sum_popcount(iBuilder, fw, del_mask);
     70   
     71    iBuilder->CreateBlockAlignedStore(iBuilder->bitCast(counts), kBuilder->getOutputStream(stream_count));
     72
    5973    kBuilder->finalize();
    6074}
    6175}
     76
Note: See TracChangeset for help on using the changeset viewer.