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.

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
2 edited

Legend:

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

    r5425 r5429  
    217217}
    218218
    219 ExternalFileBuffer * ParabixDriver::addExternalBuffer(std::unique_ptr<ExternalFileBuffer> b, Value * externalBuf) {
    220     mOwnedBuffers.push_back(std::move(b));
    221     ExternalFileBuffer * rawBuf = cast<ExternalFileBuffer>(mOwnedBuffers.back().get());
    222     rawBuf->setStreamSetBuffer(externalBuf);
    223     return rawBuf;
     219ExternalBuffer * ParabixDriver::addExternalBuffer(std::unique_ptr<ExternalBuffer> b) {
     220    mOwnedBuffers.emplace_back(std::move(b));
     221    return cast<ExternalBuffer>(mOwnedBuffers.back().get());
    224222}
    225223
    226224StreamSetBuffer * ParabixDriver::addBuffer(std::unique_ptr<StreamSetBuffer> b) {
    227225    b->allocateBuffer();
    228     mOwnedBuffers.push_back(std::move(b));
     226    mOwnedBuffers.emplace_back(std::move(b));
    229227    return mOwnedBuffers.back().get();
    230228}
    231229
    232230kernel::KernelBuilder * ParabixDriver::addKernelInstance(std::unique_ptr<kernel::KernelBuilder> kb) {
    233     mOwnedKernels.push_back(std::move(kb));
     231    mOwnedKernels.emplace_back(std::move(kb));
    234232    return mOwnedKernels.back().get();
    235233}
     
    237235void ParabixDriver::addKernelCall(kernel::KernelBuilder & kb, const std::vector<parabix::StreamSetBuffer *> & inputs, const std::vector<parabix::StreamSetBuffer *> & outputs) {
    238236    assert ("addKernelCall or makeKernelCall was already run on this kernel." && (kb.getModule() == nullptr));
    239     mPipeline.push_back(&kb);
     237    mPipeline.emplace_back(&kb);
    240238    kb.createKernelStub(inputs, outputs);
    241239}
     
    243241void ParabixDriver::makeKernelCall(kernel::KernelBuilder * kb, const std::vector<parabix::StreamSetBuffer *> & inputs, const std::vector<parabix::StreamSetBuffer *> & outputs) {
    244242    assert ("addKernelCall or makeKernelCall was already run on this kernel." && (kb->getModule() == nullptr));
    245     mPipeline.push_back(kb);
     243    mPipeline.emplace_back(kb);
    246244    kb->createKernelStub(inputs, outputs);
    247245}
     
    263261        k->addKernelDeclarations(mMainModule);
    264262    }
     263
    265264    for (const auto & k : mPipeline) {
    266265        k->createInstance();
    267266    }
     267
    268268    for (const auto & k : mPipeline) {
    269269        k->initializeInstance();
    270270    }
     271
    271272    if (codegen::pipelineParallel) {
    272273        generateParallelPipeline(iBuilder, mPipeline);
     
    277278        generatePipelineLoop(iBuilder, mPipeline);
    278279    }
     280
    279281    for (const auto & k : mPipeline) {
    280282        k->finalizeInstance();
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5425 r5429  
    6969    IDISA::IDISA_Builder * getIDISA_Builder() { return iBuilder.get(); }
    7070   
    71     parabix::ExternalFileBuffer * addExternalBuffer(std::unique_ptr<parabix::ExternalFileBuffer> b, llvm::Value * externalBuf);
     71    parabix::ExternalBuffer * addExternalBuffer(std::unique_ptr<parabix::ExternalBuffer> b);
    7272   
    7373    parabix::StreamSetBuffer * addBuffer(std::unique_ptr<parabix::StreamSetBuffer> b);
Note: See TracChangeset for help on using the changeset viewer.