Ignore:
Timestamp:
Jan 12, 2017, 7:03:38 PM (3 years ago)
Author:
cameron
Message:

finalSegment kernel methods initial check-in

File:
1 edited

Legend:

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

    r5255 r5257  
    4141}
    4242
     43void MMapSourceKernel::generateFinalSegmentMethod() const {
     44    auto savePoint = iBuilder->saveIP();
     45    Module * m = iBuilder->getModule();
     46    Function * finalSegmentFunction = m->getFunction(mKernelName + finalSegment_suffix);
     47    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", finalSegmentFunction, 0));
     48       
     49    Function::arg_iterator args = finalSegmentFunction->arg_begin();
     50    Value * self = &*(args++);
     51    Value * blocksToDo = &*(args);
     52   
     53    createDoSegmentCall(self, blocksToDo);
     54
     55    iBuilder->CreateRetVoid();
     56    iBuilder->restoreIP(savePoint);
     57}
     58
     59
    4360// The doBlock method is deprecated.   But in case it is used, just call doSegment with
    4461// 1 as the number of blocks to do.
Note: See TracChangeset for help on using the changeset viewer.