Ignore:
Timestamp:
Apr 6, 2017, 4:14:34 PM (2 years ago)
Author:
cameron
Message:

Uniquify kernel names with buffer types/sizes; update u8u16 to use ParabixDriver?

File:
1 edited

Legend:

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

    r5392 r5395  
    122122
    123123std::unique_ptr<Module> KernelBuilder::createKernelStub() {
    124     return make_unique<Module>(getName() + "_" + iBuilder->getBuilderUniqueName(), iBuilder->getContext());
     124    std::string cacheName = getName() + "_" + iBuilder->getBuilderUniqueName();
     125    for (auto & b: mStreamSetInputBuffers) {
     126        cacheName += ":" + b->getUniqueID();
     127    }
     128    for (auto & b: mStreamSetOutputBuffers) {
     129        cacheName += ":" + b->getUniqueID();
     130    }
     131    return make_unique<Module>(cacheName, iBuilder->getContext());
    125132}
    126133
     
    181188
    182189void KernelBuilder::generateKernel() {
     190    if (mIsGenerated) return;
    183191    auto savePoint = iBuilder->saveIP();
    184192    addKernelDeclarations(iBuilder->getModule());
     
    195203    }
    196204    iBuilder->restoreIP(savePoint);
     205    mIsGenerated = true;
    197206}
    198207
     
    523532    ConstantInt * stride = iBuilder->getSize(iBuilder->getStride());
    524533    Value * availablePos = producerPos[0];
    525     for (unsigned i = 1; i < mStreamSetInputs.size(); i++) {
    526         Value * p = producerPos[i];
    527         availablePos = iBuilder->CreateSelect(iBuilder->CreateICmpULT(availablePos, p), availablePos, p);
    528     }
    529 
    530534    Value * processed = getProcessedItemCount(mStreamSetInputs[0].name);
    531535    Value * itemsAvail = iBuilder->CreateSub(availablePos, processed);
     
    778782, mSelf(nullptr)
    779783, mCurrentMethod(nullptr)
    780 , mNoTerminateAttribute(false) {
     784, mNoTerminateAttribute(false)
     785, mIsGenerated(false) {
    781786
    782787}
Note: See TracChangeset for help on using the changeset viewer.