Ignore:
Timestamp:
Oct 5, 2016, 11:11:51 AM (3 years ago)
Author:
cameron
Message:

Kernels compute and check produced item counts

File:
1 edited

Legend:

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

    r5141 r5183  
    5151    IDISA::IDISA_Builder::InsertPoint savePoint = iBuilder->saveIP();
    5252    Module * m = iBuilder->getModule();
    53     pablo_compiler->compile(m->getFunction(mKernelName + doBlock_suffix));
     53    Function * doBlockFunction = m->getFunction(mKernelName + doBlock_suffix);
     54    pablo_compiler->compile(doBlockFunction);
     55    Function::arg_iterator args = doBlockFunction->arg_begin();
     56    Value * self = &*(args);
     57    Value * produced = getProducedItemCount(self);
     58    produced = iBuilder->CreateAdd(produced, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getStride()));
     59    setProducedItemCount(self, produced);
     60    iBuilder->CreateRetVoid();
    5461    iBuilder->restoreIP(savePoint);
    5562}
     
    7481    setScalarField(self, "EOFmask", iBuilder->bitblock_mask_from(remaining));
    7582    iBuilder->CreateCall(doBlockFunction, doBlockArgs);
     83    /* Adjust the produced item count */
     84    Value * produced = getProducedItemCount(self);
     85    produced = iBuilder->CreateSub(produced, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getStride()));
     86    setProducedItemCount(self, iBuilder->CreateAdd(produced, remaining));
    7687    iBuilder->CreateRetVoid();
    7788    iBuilder->restoreIP(savePoint);
Note: See TracChangeset for help on using the changeset viewer.