Ignore:
Timestamp:
Apr 16, 2017, 9:44:17 AM (2 years ago)
Author:
cameron
Message:

Parabix driver can take ownership and allocate buffers

File:
1 edited

Legend:

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

    r5408 r5409  
    3535
    3636using namespace llvm;
     37using namespace parabix;
    3738
    3839namespace codegen {
     
    210211    }
    211212}
     213
     214ExternalFileBuffer * ParabixDriver::addExternalBuffer(std::unique_ptr<ExternalFileBuffer> b, Value * externalBuf) {
     215    ExternalFileBuffer * rawBuf = b.get();
     216    mOwnedBuffers.push_back(std::move(b));
     217    rawBuf->setStreamSetBuffer(externalBuf);
     218    return rawBuf;
     219}
     220
     221StreamSetBuffer * ParabixDriver::addBuffer(std::unique_ptr<StreamSetBuffer> b) {
     222    b->allocateBuffer();
     223    mOwnedBuffers.push_back(std::move(b));
     224    return mOwnedBuffers.back().get();
     225}
     226
    212227
    213228void ParabixDriver::addKernelCall(kernel::KernelBuilder & kb, const std::vector<parabix::StreamSetBuffer *> & inputs, const std::vector<parabix::StreamSetBuffer *> & outputs) {
Note: See TracChangeset for help on using the changeset viewer.