Ignore:
Timestamp:
Jun 30, 2017, 2:07:34 PM (2 years ago)
Author:
cameron
Message:

Integrated AVX deletion kernel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5486 r5540  
    1212#include <kernels/p2s_kernel.h>                    // for P2S16KernelWithCom...
    1313#include <kernels/s2p_kernel.h>                    // for S2PKernel
    14 #include <kernels/stdout_kernel.h>                 // for StdOutKernel
     14#include <kernels/stdout_kernel.h>                 // for StdOutKernel_
    1515#include <llvm/ExecutionEngine/ExecutionEngine.h>  // for ExecutionEngine
    1616#include <llvm/IR/Function.h>                      // for Function, Function...
     
    310310    pxDriver.makeKernelCall(u8u16k, {BasisBits}, {U8u16Bits, DelMask, ErrorMask});
    311311   
    312     // Apply a deletion algorithm to discard all but the final position of the UTF-8
    313     // sequences for each UTF-16 code unit. Swizzle the results.
    314     StreamSetBuffer * SwizzleFields0 = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * bufferSegments));
    315     StreamSetBuffer * SwizzleFields1 = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * bufferSegments));
    316     StreamSetBuffer * SwizzleFields2 = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * bufferSegments));
    317     StreamSetBuffer * SwizzleFields3 = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * bufferSegments));
    318     StreamSetBuffer * DeletionCounts = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(), segmentSize * bufferSegments));
    319    
    320     Kernel * delK = pxDriver.addKernelInstance(make_unique<DeleteByPEXTkernel>(iBuilder, 64, 16, true));
    321     pxDriver.makeKernelCall(delK, {U8u16Bits, DelMask}, {SwizzleFields0, SwizzleFields1, SwizzleFields2, SwizzleFields3, DeletionCounts});
    322    
    323     //  Produce fully compressed swizzled UTF-16 bit streams
     312    // Allocate space for fully compressed swizzled UTF-16 bit streams
    324313    StreamSetBuffer * u16Swizzle0 = pxDriver.addBuffer(make_unique<SwizzledCopybackBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * (bufferSegments+2), 1));
    325314    StreamSetBuffer * u16Swizzle1 = pxDriver.addBuffer(make_unique<SwizzledCopybackBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * (bufferSegments+2), 1));
     
    327316    StreamSetBuffer * u16Swizzle3 = pxDriver.addBuffer(make_unique<SwizzledCopybackBuffer>(iBuilder, iBuilder->getStreamSetTy(4), segmentSize * (bufferSegments+2), 1));
    328317   
    329     Kernel * compressK = pxDriver.addKernelInstance(make_unique<SwizzledBitstreamCompressByCount>(iBuilder, 16));
    330     pxDriver.makeKernelCall(compressK, {DeletionCounts, SwizzleFields0, SwizzleFields1, SwizzleFields2, SwizzleFields3},
    331                            {u16Swizzle0, u16Swizzle1, u16Swizzle2, u16Swizzle3});
    332    
     318    // Apply a deletion algorithm to discard all but the final position of the UTF-8
     319    // sequences (bit streams) for each UTF-16 code unit. Also compresses and swizzles the result.
     320    Kernel * delK = pxDriver.addKernelInstance(make_unique<SwizzledDeleteByPEXTkernel>(iBuilder, 64, 16));
     321    pxDriver.makeKernelCall(delK, {U8u16Bits, DelMask}, {u16Swizzle0, u16Swizzle1, u16Swizzle2, u16Swizzle3});
     322
    333323    // Produce unswizzled UTF-16 bit streams
    334324    StreamSetBuffer * u16bits = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(16), segmentSize * bufferSegments));
     
    483473
    484474                       
     475
Note: See TracChangeset for help on using the changeset viewer.