Ignore:
Timestamp:
Jan 5, 2017, 3:54:40 PM (2 years ago)
Author:
nmedfort
Message:

Code clean up to enforce proper calling order of KernelBuilder? methods

File:
1 edited

Legend:

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

    r5238 r5246  
    5050namespace kernel {
    5151
    52 void DeletionKernel::generateDoBlockMethod() {
     52void DeletionKernel::generateDoBlockMethod() const {
    5353    auto savePoint = iBuilder->saveIP();
    5454    Module * m = iBuilder->getModule();
     
    8484     * has not yet changed.   */
    8585    Value * produced = getProducedItemCount(self);
    86     produced = iBuilder->CreateAdd(produced, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getStride()));
     86    produced = iBuilder->CreateAdd(produced, iBuilder->getSize(iBuilder->getStride()));
    8787    setProducedItemCount(self, produced);
    8888    iBuilder->CreateRetVoid();
     
    9090}
    9191
    92 void DeletionKernel::generateFinalBlockMethod() {
     92void DeletionKernel::generateFinalBlockMethod() const {
    9393    auto savePoint = iBuilder->saveIP();
    9494    Module * m = iBuilder->getModule();
     
    111111    /* Adjust the produced item count */
    112112    Value * produced = getProducedItemCount(self);
    113     produced = iBuilder->CreateSub(produced, ConstantInt::get(iBuilder->getSizeTy(), iBuilder->getStride()));
     113    produced = iBuilder->CreateSub(produced, iBuilder->getSize(iBuilder->getStride()));
    114114    setProducedItemCount(self, iBuilder->CreateAdd(produced, remainingBytes));
    115115
Note: See TracChangeset for help on using the changeset viewer.