Ignore:
Timestamp:
Apr 28, 2017, 2:50:59 PM (2 years ago)
Author:
nmedfort
Message:

Refactored source kernels. icgrep from stdin should now be able to handle any file size.

File:
1 edited

Legend:

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

    r5425 r5429  
    1010#include <kernels/deletion.h>                      // for DeletionKernel
    1111#include <kernels/swizzle.h>                      // for DeletionKernel
    12 #include <kernels/mmap_kernel.h>                   // for MMapSourceKernel
     12#include <kernels/source_kernel.h>
    1313#include <kernels/p2s_kernel.h>                    // for P2S16KernelWithCom...
    1414#include <kernels/s2p_kernel.h>                    // for S2PKernel
     
    285285   
    286286    // File data from mmap
    287     StreamSetBuffer * ByteStream = pxDriver.addBuffer(make_unique<SourceFileBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
     287    StreamSetBuffer * ByteStream = pxDriver.addBuffer(make_unique<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
    288288   
    289289    KernelBuilder * mmapK = pxDriver.addKernelInstance(make_unique<MMapSourceKernel>(iBuilder, segmentSize));
     
    341341    StreamSetBuffer * U16out = nullptr;
    342342    if (mMapBuffering || memAlignBuffering) {
    343         U16out = pxDriver.addExternalBuffer(make_unique<ExternalFileBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16)), outputStream);
     343        U16out = pxDriver.addExternalBuffer(make_unique<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16), outputStream));
    344344    } else {
    345345        U16out = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16), segmentSize * bufferSegments));
     
    378378
    379379    // File data from mmap
    380     StreamSetBuffer * ByteStream = pxDriver.addBuffer(make_unique<SourceFileBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
     380    StreamSetBuffer * ByteStream = pxDriver.addBuffer(make_unique<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
    381381   
    382382    KernelBuilder * mmapK = pxDriver.addKernelInstance(make_unique<MMapSourceKernel>(iBuilder, segmentSize));
     
    414414    StreamSetBuffer * U16out = nullptr;
    415415    if (mMapBuffering || memAlignBuffering) {
    416         U16out = pxDriver.addExternalBuffer(make_unique<ExternalFileBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16)), outputStream);
     416        U16out = pxDriver.addExternalBuffer(make_unique<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16), outputStream));
    417417    } else {
    418418        U16out = pxDriver.addBuffer(make_unique<CircularCopybackBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 16), segmentSize * bufferSegments, 1 /*overflow block*/));
     
    427427    pxDriver.linkAndFinalize();
    428428}
    429 
    430 
    431429
    432430typedef void (*u8u16FunctionType)(uint32_t fd, char * output_data);
Note: See TracChangeset for help on using the changeset viewer.