Ignore:
Timestamp:
Jan 28, 2017, 3:12:03 PM (2 years ago)
Author:
nmedfort
Message:

Start of work to simplify kernel writing. Removed generateDoBlockLogic method.

File:
1 edited

Legend:

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

    r5267 r5285  
    2323        throw std::runtime_error("Kernel interface " + mKernelName + " not yet finalized.");
    2424    }
    25     Type * selfType = PointerType::getUnqual(mKernelStateType);
     25    PointerType * selfType = PointerType::getUnqual(mKernelStateType);
    2626
    2727    // Create the accumulator get function prototypes
     
    109109}
    110110
    111 Value * KernelInterface::createDoBlockCall(Value * self) const {
    112     Module * m = iBuilder->getModule();
    113     std::string doBlockName = mKernelName + doBlock_suffix;
    114     Function * doBlockMethod = m->getFunction(doBlockName);
    115     if (!doBlockMethod) {
    116         throw std::runtime_error("Cannot find " + doBlockName);
    117     }
    118     std::vector<Value *> args = {self};
    119     return iBuilder->CreateCall(doBlockMethod, args);
    120 }
    121 
    122 Value * KernelInterface::createFinalBlockCall(Value * self, Value * remainingBytes) const {
    123     Module * m = iBuilder->getModule();
    124     std::string finalBlockName = mKernelName + finalBlock_suffix;
    125     Function * finalBlockMethod = m->getFunction(finalBlockName);
    126     if (!finalBlockMethod) {
    127         throw std::runtime_error("Cannot find " + finalBlockName);
    128     }
    129     std::vector<Value *> args = {self, remainingBytes};
    130     return iBuilder->CreateCall(finalBlockMethod, args);
    131 }
    132 
    133 
    134111Value * KernelInterface::createDoSegmentCall(std::vector<Value *> args) const {
    135112    Module * m = iBuilder->getModule();
     
    152129}
    153130
    154 
     131Function * KernelInterface::getDoSegmentFunction() const {
     132    return iBuilder->getModule()->getFunction(mKernelName + doSegment_suffix);
     133}
Note: See TracChangeset for help on using the changeset viewer.