Ignore:
Timestamp:
Aug 26, 2016, 9:33:51 AM (3 years ago)
Author:
cameron
Message:

Defer binding of buffers to stream sets until kernel generation

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.cpp

    r5121 r5133  
    1616                         std::string kernelName,
    1717                         PabloFunction * function,
    18                          StreamSetBuffer & inputBuffer,
    19                          StreamSetBuffer & outputBuffer,
    2018                         std::vector<std::string> accumulators) :
    2119    KernelBuilder(builder, kernelName,
    22                     {StreamSetBinding{inputBuffer, "inputs"}},
    23                     {StreamSetBinding{outputBuffer, "outputs"}},
    24                     {},
    25                     {},
    26                     {ScalarBinding{builder->getBitBlockType(), "EOFbit"}, ScalarBinding{builder->getBitBlockType(), "EOFmask"}}),
    27     mPabloFunction(function) {
    28     unsigned output_streams = function->getNumOfResults();
    29     assert (output_streams > 0);
    30     mScalarOutputs = accumBindings(accumulators);
    31     pablo_compiler = new PabloCompiler(builder, this, function);
    32 }
    33 
    34 PabloKernel::PabloKernel(IDISA::IDISA_Builder * builder,
    35                          std::string kernelName,
    36                          PabloFunction * function,
    37                          StreamSetBuffer & inputBuffer,
    38                          std::vector<std::string> accumulators) :
    39     KernelBuilder(builder, kernelName,
    40                     {StreamSetBinding{inputBuffer, "inputs"}},
     20                    {StreamSetBinding{StreamSetType(function->getNumOfParameters(), 1), "inputs"}},
    4121                    {},
    4222                    {},
     
    4525    mPabloFunction(function) {
    4626    unsigned output_streams = function->getNumOfResults();
    47     assert (output_streams == 0);
     27    if (output_streams > 0) {
     28        mStreamSetOutputs.push_back(StreamSetBinding{StreamSetType(output_streams, 1), "outputs"});
     29    }
    4830    mScalarOutputs = accumBindings(accumulators);
    4931    pablo_compiler = new PabloCompiler(builder, this, function);
    5032}
    51 
    5233
    5334std::vector<ScalarBinding> PabloKernel::accumBindings(std::vector<std::string> accum_names) {
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h

    r5102 r5133  
    2121                    std::string kernelName,
    2222                    PabloFunction * function,
    23                     parabix::StreamSetBuffer & inputBuffer,
    24                     parabix::StreamSetBuffer & outputBuffer,
    25                     std::vector<std::string> accumulators);
    26     // At present only population count accumulator are supported,
    27     // using the pablo.Count operation.
    28    
    29     PabloKernel(IDISA::IDISA_Builder * builder,
    30                     std::string kernelName,
    31                     PabloFunction * function,
    32                     parabix::StreamSetBuffer & inputBuffer,
    3323                    std::vector<std::string> accumulators);
    3424    // At present only population count accumulator are supported,
Note: See TracChangeset for help on using the changeset viewer.