Ignore:
Timestamp:
Dec 3, 2017, 12:40:40 PM (18 months ago)
Author:
nmedfort
Message:

Bug fixes and simplified MultiBlockKernel? logic

File:
1 edited

Legend:

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

    r5620 r5755  
    6565    const unsigned bufferSize = (4 * initSegSize * codegen::BufferSegments) / 3;
    6666
    67     StreamSetBuffer * ByteStream = pxDriver.addBuffer(make_unique<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
    68 
    69     Kernel * mmapK = pxDriver.addKernelInstance(make_unique<MMapSourceKernel>(iBuilder, initSegSize));
     67    StreamSetBuffer * ByteStream = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
     68
     69    Kernel * mmapK = pxDriver.addKernelInstance<MMapSourceKernel>(iBuilder, initSegSize);
    7070    mmapK->setInitialArguments({fileDescriptor});
    7171    pxDriver.makeKernelCall(mmapK, {}, {ByteStream});
    7272   
    73     StreamSetBuffer * Expanded3_4Out = pxDriver.addBuffer(make_unique<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize));
    74     Kernel * expandK = pxDriver.addKernelInstance(make_unique<expand3_4Kernel>(iBuilder));
     73    StreamSetBuffer * Expanded3_4Out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize);
     74    Kernel * expandK = pxDriver.addKernelInstance<expand3_4Kernel>(iBuilder);
    7575    pxDriver.makeKernelCall(expandK, {ByteStream}, {Expanded3_4Out});
    7676   
    77     StreamSetBuffer * Radix64out = pxDriver.addBuffer(make_unique<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize));
    78     Kernel * radix64K = pxDriver.addKernelInstance(make_unique<radix64Kernel>(iBuilder));
     77    StreamSetBuffer * Radix64out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize);
     78    Kernel * radix64K = pxDriver.addKernelInstance<radix64Kernel>(iBuilder);
    7979    pxDriver.makeKernelCall(radix64K, {Expanded3_4Out}, {Radix64out});
    8080   
    8181    if (memAlignBuffering){
    82         auto Base64out = pxDriver.addExternalBuffer(make_unique<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), outputStream));
    83         Kernel * base64K = pxDriver.addKernelInstance(make_unique<base64Kernel>(iBuilder));
     82        auto Base64out = pxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), outputStream);
     83        Kernel * base64K = pxDriver.addKernelInstance<base64Kernel>(iBuilder);
    8484        pxDriver.makeKernelCall(base64K, {Radix64out}, {Base64out});
    8585    }
    8686    else {
    87         StreamSetBuffer * Base64out = pxDriver.addBuffer(make_unique<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize));
    88         Kernel * base64K = pxDriver.addKernelInstance(make_unique<base64Kernel>(iBuilder));
     87        StreamSetBuffer * Base64out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize);
     88        Kernel * base64K = pxDriver.addKernelInstance<base64Kernel>(iBuilder);
    8989        pxDriver.makeKernelCall(base64K, {Radix64out}, {Base64out});
    9090       
    91         Kernel * outK = pxDriver.addKernelInstance(make_unique<StdOutKernel>(iBuilder, 8));
     91        Kernel * outK = pxDriver.addKernelInstance<StdOutKernel>(iBuilder, 8);
    9292        pxDriver.makeKernelCall(outK, {Base64out}, {});
    9393    }
Note: See TracChangeset for help on using the changeset viewer.