Changeset 5126 for icGREP/icgrep-devel


Ignore:
Timestamp:
Aug 11, 2016, 1:27:17 PM (3 years ago)
Author:
cameron
Message:

Add getStride to IDISA builders; allows Stride > BlockSize? on GPU

Location:
icGREP/icgrep-devel/icgrep
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r5121 r5126  
    2727    , mBitBlockType(bitBlockType)
    2828    , mBitBlockWidth(bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth())
     29    , mStride(mBitBlockWidth)
    2930    , mZeroInitializer(Constant::getNullValue(bitBlockType))
    3031    , mOneInitializer(Constant::getAllOnesValue(bitBlockType))
     
    4748    unsigned getBitBlockWidth() const {
    4849        return mBitBlockWidth;
     50    }
     51
     52    unsigned getStride() const {
     53        return mStride;
    4954    }
    5055
     
    139144    Type * mBitBlockType;
    140145    unsigned mBitBlockWidth;
     146    unsigned mStride;
    141147    Constant * mZeroInitializer;
    142148    Constant * mOneInitializer;
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5111 r5126  
    5252        blockNo->addIncoming(ConstantInt::get(size_ty, 0), entryBlock);
    5353       
    54         Constant * const step = ConstantInt::get(size_ty, iBuilder->getBitBlockWidth() * segmentSize);
     54        Constant * const step = ConstantInt::get(size_ty, iBuilder->getStride() * segmentSize);
    5555        Value * segmentCondTest = iBuilder->CreateICmpULT(remainingBytes, step);
    5656        iBuilder->CreateCondBr(segmentCondTest, fullCondBlock, segmentBodyBlock);
     
    8181    blockNo->addIncoming(initialBlockNo, initialBlock);
    8282   
    83     Constant * const step = ConstantInt::get(size_ty, iBuilder->getBitBlockWidth());
     83    Constant * const step = ConstantInt::get(size_ty, iBuilder->getStride());
    8484    Value * fullCondTest = iBuilder->CreateICmpULT(remainingBytes, step);
    8585    iBuilder->CreateCondBr(fullCondTest, finalBlock, fullBodyBlock);
     
    9696   
    9797    iBuilder->SetInsertPoint(finalBlock);
    98     rslt = kernels[0]-> createFinalBlockCall(instances[0], remainingBytes);
    99     for (unsigned i = 1; i < kernels.size(); i++) {
    100         kernels[i]->createFinalBlockCall(instances[i], rslt->getType()->isVoidTy() ? remainingBytes : rslt);
     98    for (unsigned i = 0; i < kernels.size(); i++) {
     99        kernels[i]->createFinalBlockCall(instances[i], remainingBytes);
    101100    }
    102101}
Note: See TracChangeset for help on using the changeset viewer.