Ignore:
Timestamp:
Dec 8, 2017, 1:55:22 AM (22 months ago)
Author:
nmedfort
Message:

Cache signature is now written into .kernel bitcode file. Minor bug fix and revision of GrepEngine::DoGrepThreadMethod?

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
3 edited

Legend:

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

    r5757 r5761  
    973973        Value * const remaining = b->CreateSub(avail, processed);
    974974        Value * const remainingStrides = b->CreateUDiv(remaining, inputStrideSize[i]);
    975         hasMoreStrides = b->CreateAnd(hasMoreStrides, b->CreateICmpNE(remainingStrides, ZERO));
     975        Value * const hasRemainingStrides = b->CreateICmpNE(remainingStrides, ZERO);
     976        hasMoreStrides = b->CreateAnd(hasMoreStrides, hasRemainingStrides);
    976977    }
    977978    // even if we do not have enough input data for a full stride, if this is our final stride, allow it ...
     
    992993            Value * const remaining = b->CreateSub(capacity, unconsumed);
    993994            Value * const remainingStrides = b->CreateUDiv(remaining, outputStrideSize[i]);
    994             hasMoreStrides = b->CreateAnd(hasMoreStrides, b->CreateICmpNE(remainingStrides, ZERO));
     995            Value * const hasRemainingStrides = b->CreateICmpNE(remainingStrides, ZERO);
     996            hasMoreStrides = b->CreateAnd(hasMoreStrides, hasRemainingStrides);
    995997        }
    996998        // Do copybacks if necessary.
     
    9991001        }
    10001002    }
     1003
     1004    // b->CreateAssertZero(b->CreateOr(b->CreateNot(initiallyFinal), hasMoreStrides), getName() + " does not have enough output space for the final stride");
     1005
    10011006    b->CreateCondBr(hasMoreStrides, segmentLoop, segmentDone);
    10021007
  • icGREP/icgrep-devel/icgrep/kernels/source_kernel.cpp

    r5757 r5761  
    2828}
    2929
    30 void MMapSourceKernel::generateInitializeMethod(Function * const fileSizeMethod, const unsigned codeUnitWidth, const unsigned /* blocksRequiredPerSegment */, const std::unique_ptr<KernelBuilder> & kb) {
     30void MMapSourceKernel::generateInitializeMethod(Function * const fileSizeMethod, const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<KernelBuilder> & kb) {
    3131    BasicBlock * const emptyFile = kb->CreateBasicBlock("EmptyFile");
    3232    BasicBlock * const nonEmptyFile = kb->CreateBasicBlock("NonEmptyFile");
     
    4444    // we cannot mmap a 0 length file; just create a 1-page sized fake file buffer for simplicity
    4545    kb->SetInsertPoint(emptyFile);
    46     Constant * pageSize = kb->getSize(getpagesize());
    47     Value * fakeFileBuffer = kb->CreateAnonymousMMap(pageSize);
     46    Constant * const readSize = kb->getSize(segmentSize);
     47    Value * const fakeFileBuffer = kb->CreateAnonymousMMap(readSize);
    4848    kb->CreateBr(exit);
    4949
     
    5353
    5454    kb->SetInsertPoint(exit);
    55     PHINode * buffer = kb->CreatePHI(fileBackedBuffer->getType(), 2);
     55    PHINode * const buffer = kb->CreatePHI(fileBackedBuffer->getType(), 2);
    5656    buffer->addIncoming(fakeFileBuffer, emptyFile);
    5757    buffer->addIncoming(fileBackedBuffer, nonEmptyFile);
    58     PHINode * size = kb->CreatePHI(sizeTy, 2);
    59     size->addIncoming(pageSize, emptyFile);
    60     size->addIncoming(fileSize, nonEmptyFile);
     58    PHINode * const bufferSize = kb->CreatePHI(sizeTy, 2);
     59    bufferSize->addIncoming(readSize, emptyFile);
     60    bufferSize->addIncoming(fileSize, nonEmptyFile);
    6161
    6262    PointerType * const codeUnitPtrTy = kb->getIntNTy(codeUnitWidth)->getPointerTo();
    6363    Value * bufferPtr = kb->CreatePointerCast(buffer, codeUnitPtrTy);
     64    kb->setScalarField("buffer", bufferPtr);
     65    kb->setScalarField("fileSize", fileSize);
     66
    6467    kb->setBaseAddress("sourceBuffer", bufferPtr);
    65     kb->setBufferedSize("sourceBuffer", size);
    66     kb->setScalarField("readableBuffer", bufferPtr);
    67     kb->setScalarField("fileSize", fileSize);
     68    kb->setBufferedSize("sourceBuffer", bufferSize);
    6869    kb->setCapacity("sourceBuffer", fileSize);
    6970    kb->CreateMAdvise(buffer, fileSize, CBuilder::ADVICE_WILLNEED);
     
    7172}
    7273
    73 void MMapSourceKernel::generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<KernelBuilder> & kb) {
     74void MMapSourceKernel::generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<KernelBuilder> & kb) {
    7475
    7576    BasicBlock * dropPages = kb->CreateBasicBlock("dropPages");
     
    7879    BasicBlock * mmapSourceExit = kb->CreateBasicBlock("mmapSourceExit");
    7980
    80     Constant * const segmentSize = kb->getSize(blocksRequiredPerSegment * kb->getBitBlockWidth());
     81    Constant * const readSize = kb->getSize(segmentSize);
    8182    Constant * const pageSize = kb->getSize(getpagesize());
    8283
     
    8687
    8788    Value * const consumedBuffer = kb->getRawOutputPointer("sourceBuffer", consumed);
    88     Value * const readableBuffer = kb->getScalarField("readableBuffer");
     89    Value * const readableBuffer = kb->getScalarField("buffer");
    8990    Value * const unnecessaryBytes = kb->CreatePtrDiff(consumedBuffer, readableBuffer);
    9091
     
    9596    // instruct the OS that it can safely drop any fully consumed pages
    9697    kb->CreateMAdvise(readableBuffer, unnecessaryBytes, CBuilder::ADVICE_DONTNEED);
    97     kb->setScalarField("readableBuffer", kb->CreateGEP(readableBuffer, unnecessaryBytes));
     98    kb->setScalarField("buffer", kb->CreateGEP(readableBuffer, unnecessaryBytes));
    9899    kb->CreateBr(processSegment);
    99100
     
    101102    kb->SetInsertPoint(processSegment);
    102103    Value * const fileSize = kb->getScalarField("fileSize");
    103     Value * const produced = kb->CreateAdd(kb->getProducedItemCount("sourceBuffer"), segmentSize);
     104    Value * const produced = kb->CreateAdd(kb->getProducedItemCount("sourceBuffer"), readSize);
    104105    Value * const lessThanFullSegment = kb->CreateICmpULT(fileSize, produced);
    105106    kb->CreateUnlikelyCondBr(lessThanFullSegment, setTermination, mmapSourceExit);
     
    122123}
    123124
    124 MMapSourceKernel::MMapSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, unsigned blocksRequiredPerSegment, unsigned codeUnitWidth)
    125 : SegmentOrientedKernel("mmap_source" + std::to_string(blocksRequiredPerSegment) + "@" + std::to_string(codeUnitWidth),
     125MMapSourceKernel::MMapSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, const unsigned stridesPerSegment, const unsigned codeUnitWidth)
     126: SegmentOrientedKernel("mmap_source" + std::to_string(stridesPerSegment) + "@" + std::to_string(codeUnitWidth),
    126127{},
    127128{Binding{kb->getStreamSetTy(1, codeUnitWidth), "sourceBuffer", FixedRate(), Deferred()}},
    128129{Binding{kb->getInt32Ty(), "fileDescriptor"}},
    129 {Binding{kb->getSizeTy(), "fileSize"}}, {Binding{kb->getIntNTy(codeUnitWidth)->getPointerTo(), "readableBuffer"}})
    130 , mBlocksRequiredPerSegment(blocksRequiredPerSegment)
     130{Binding{kb->getSizeTy(), "fileSize"}}, {Binding{kb->getIntNTy(codeUnitWidth)->getPointerTo(), "buffer"}})
     131, mStridesPerSegment(stridesPerSegment)
    131132, mCodeUnitWidth(codeUnitWidth)
    132133, mFileSizeFunction(nullptr) {
     
    136137/// READ SOURCE KERNEL
    137138
    138 void ReadSourceKernel::generateInitializeMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<KernelBuilder> & b) {
     139void ReadSourceKernel::generateInitializeMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<KernelBuilder> & b) {
    139140    const unsigned pageSize = getpagesize();
    140     const unsigned segmentSize = blocksRequiredPerSegment * b->getBitBlockWidth();
    141141    const auto bufferSize = std::max(pageSize * 8, segmentSize * 4);
    142142    ConstantInt * const bufferItems = b->getSize(bufferSize);
     
    150150}
    151151
    152 void ReadSourceKernel::generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<KernelBuilder> & b) {
     152void ReadSourceKernel::generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<KernelBuilder> & b) {
    153153
    154154    const unsigned pageSize = getpagesize();
    155     const unsigned segmentSize = blocksRequiredPerSegment * b->getBitBlockWidth();
    156155    ConstantInt * const itemsToRead = b->getSize(std::max(pageSize, segmentSize * 2));
    157156    ConstantInt * const codeUnitBytes = b->getSize(codeUnitWidth / 8);
     
    166165    BasicBlock * const readExit = b->CreateBasicBlock("ReadExit");
    167166
    168     // Do we have enough unread data to support a segments worth of processing?
     167    // Do we have enough unread data to support one segment?
    169168    Value * const produced = b->getProducedItemCount("sourceBuffer");
    170169    Value * const buffered = b->getBufferedSize("sourceBuffer");
     
    213212    Value * const expandedBuffer = b->CreatePointerCast(b->CreateCacheAlignedMalloc(expandedBytes), unreadData->getType());
    214213    b->CreateMemCpy(expandedBuffer, unreadData, remainingBytes, blockSize);
    215     b->CreateFree(baseBuffer);
    216214    b->setScalarField("buffer", expandedBuffer);
    217215    b->setCapacity("sourceBuffer", expandedCapacity);
     216    b->CreateFree(baseBuffer);
    218217    b->CreateBr(prepareBuffer);
    219218
     
    258257}
    259258
    260 ReadSourceKernel::ReadSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & b, const unsigned blocksRequiredPerSegment, const unsigned codeUnitWidth)
    261 : SegmentOrientedKernel("read_source"  + std::to_string(blocksRequiredPerSegment) + "@" + std::to_string(codeUnitWidth)
     259ReadSourceKernel::ReadSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & b, const unsigned stridesPerSegment, const unsigned codeUnitWidth)
     260: SegmentOrientedKernel("read_source"  + std::to_string(stridesPerSegment) + "@" + std::to_string(codeUnitWidth)
    262261, {}
    263262, {Binding{b->getStreamSetTy(1, codeUnitWidth), "sourceBuffer", FixedRate(), Deferred()}}
     
    265264, {}
    266265, {Binding{b->getIntNTy(codeUnitWidth)->getPointerTo(), "buffer"}})
    267 , mBlocksRequiredPerSegment(blocksRequiredPerSegment)
     266, mStridesPerSegment(stridesPerSegment)
    268267, mCodeUnitWidth(codeUnitWidth) {
    269268
     
    298297    kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(STDIN_FILENO)), initializeRead, initializeMMap);
    299298    kb->SetInsertPoint(initializeRead);
    300     ReadSourceKernel::generateInitializeMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, kb);
     299    ReadSourceKernel::generateInitializeMethod(mCodeUnitWidth, mStride * mStridesPerSegment, kb);
    301300    kb->CreateBr(initializeDone);
    302301    kb->SetInsertPoint(initializeMMap);
    303     MMapSourceKernel::generateInitializeMethod(mFileSizeFunction, mCodeUnitWidth, mBlocksRequiredPerSegment, kb);
     302    MMapSourceKernel::generateInitializeMethod(mFileSizeFunction, mCodeUnitWidth, mStride * mStridesPerSegment, kb);
    304303    kb->CreateBr(initializeDone);
    305304    kb->SetInsertPoint(initializeDone);
     
    313312    kb->CreateCondBr(kb->CreateICmpEQ(kb->getScalarField("fileDescriptor"), kb->getInt32(STDIN_FILENO)), DoSegmentRead, DoSegmentMMap);
    314313    kb->SetInsertPoint(DoSegmentRead);
    315     ReadSourceKernel::generateDoSegmentMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, kb);
     314    ReadSourceKernel::generateDoSegmentMethod(mCodeUnitWidth, mStride * mStridesPerSegment, kb);
    316315    kb->CreateBr(DoSegmentDone);
    317316    kb->SetInsertPoint(DoSegmentMMap);
    318     MMapSourceKernel::generateDoSegmentMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, kb);
     317    MMapSourceKernel::generateDoSegmentMethod(mCodeUnitWidth, mStride * mStridesPerSegment, kb);
    319318    kb->CreateBr(DoSegmentDone);
    320319    kb->SetInsertPoint(DoSegmentDone);
    321320}
    322321
    323 FDSourceKernel::FDSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, const unsigned blocksRequiredPerSegment, const unsigned codeUnitWidth)
    324 : SegmentOrientedKernel("FD_source" + std::to_string(blocksRequiredPerSegment) + "@" + std::to_string(codeUnitWidth)
     322FDSourceKernel::FDSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, const unsigned stridesPerSegment, const unsigned codeUnitWidth)
     323: SegmentOrientedKernel("FD_source" + std::to_string(stridesPerSegment) + "@" + std::to_string(codeUnitWidth)
    325324, {}
    326 , {Binding{kb->getStreamSetTy(1, codeUnitWidth), "sourceBuffer"}}
     325, {Binding{kb->getStreamSetTy(1, codeUnitWidth), "sourceBuffer", FixedRate(), Deferred()}}
    327326, {Binding{kb->getInt32Ty(), "fileDescriptor"}}
    328327, {}
    329 , {Binding{kb->getIntNTy(codeUnitWidth)->getPointerTo(), "buffer"},
    330     Binding{kb->getSizeTy(), "fileSize"}, Binding{kb->getInt8PtrTy(), "readableBuffer"}})
    331 , mBlocksRequiredPerSegment(blocksRequiredPerSegment)
     328, {Binding{kb->getIntNTy(codeUnitWidth)->getPointerTo(), "buffer"}, Binding{kb->getSizeTy(), "fileSize"}})
     329, mStridesPerSegment(stridesPerSegment)
    332330, mCodeUnitWidth(codeUnitWidth)
    333331, mFileSizeFunction(nullptr) {
     
    341339    kb->setBaseAddress("sourceBuffer", fileSource);
    342340    Value * const fileSize = kb->getScalarField("fileSize");
    343     kb->setBufferedSize("sourceBuffer", fileSize);
    344     kb->setCapacity("sourceBuffer", fileSize);
     341    Value * const fileItems = kb->CreateUDiv(fileSize, kb->getSize(mCodeUnitWidth / 8));
     342    kb->setBufferedSize("sourceBuffer", fileItems);
     343    kb->setCapacity("sourceBuffer", fileItems);
    345344}
    346345
     
    350349    BasicBlock * setTermination = kb->CreateBasicBlock("setTermination");
    351350    BasicBlock * mmapSourceExit = kb->CreateBasicBlock("sourceExit");
    352     ConstantInt * segmentItems = kb->getSize(mBlocksRequiredPerSegment * kb->getBitBlockWidth());
    353     Value * fileItems = kb->getScalarField("fileSize");
    354     if (mCodeUnitWidth > 8) {
    355         fileItems = kb->CreateUDiv(fileItems, kb->getSize(mCodeUnitWidth / 8));
    356     }
    357     Value * produced = kb->getProducedItemCount("sourceBuffer");
    358     produced = kb->CreateAdd(produced, segmentItems);
    359     Value * lessThanFullSegment = kb->CreateICmpULT(fileItems, produced);
    360     kb->CreateCondBr(lessThanFullSegment, setTermination, mmapSourceExit);
     351
     352    ConstantInt * const segmentItems = kb->getSize(mStride * mStridesPerSegment);
     353    Value * const fileItems = kb->getBufferedSize("sourceBuffer");
     354    Value * const produced = kb->CreateAdd(kb->getProducedItemCount("sourceBuffer"), segmentItems);
     355
     356    kb->CreateUnlikelyCondBr(kb->CreateICmpULT(fileItems, produced), setTermination, mmapSourceExit);
     357
    361358    kb->SetInsertPoint(setTermination);
    362359    kb->setTerminationSignal();
     
    364361
    365362    kb->SetInsertPoint(mmapSourceExit);
    366 
    367363    PHINode * itemsRead = kb->CreatePHI(produced->getType(), 2);
    368364    itemsRead->addIncoming(produced, entryBlock);
     
    371367}
    372368
    373 MemorySourceKernel::MemorySourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, Type * const type, const unsigned blocksRequiredPerSegment, const unsigned codeUnitWidth)
     369MemorySourceKernel::MemorySourceKernel(const std::unique_ptr<kernel::KernelBuilder> & kb, Type * const type, const unsigned stridesPerSegment, const unsigned codeUnitWidth)
    374370: SegmentOrientedKernel("memory_source",
    375371    {},
    376372    {Binding{kb->getStreamSetTy(1, codeUnitWidth), "sourceBuffer"}},
    377373    {Binding{cast<PointerType>(type), "fileSource"}, Binding{kb->getSizeTy(), "fileSize"}}, {}, {})
    378 , mBlocksRequiredPerSegment(blocksRequiredPerSegment)
     374, mStridesPerSegment(stridesPerSegment)
    379375, mCodeUnitWidth(codeUnitWidth) {
    380376
  • icGREP/icgrep-devel/icgrep/kernels/source_kernel.h

    r5757 r5761  
    1414    friend class FDSourceKernel;
    1515public:
    16     MMapSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned blocksRequiredPerSegment = 1, const unsigned codeUnitWidth = 8);
     16    MMapSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned stridesPerSegment = 1, const unsigned codeUnitWidth = 8);
    1717    bool isCachable() const override { return true; }
    1818    bool hasSignature() const override { return false; }
     
    2121    }
    2222    void generateInitializeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
    23         generateInitializeMethod(mFileSizeFunction, mCodeUnitWidth, mBlocksRequiredPerSegment, iBuilder);
     23        generateInitializeMethod(mFileSizeFunction, mCodeUnitWidth, mStride * mStridesPerSegment, iBuilder);
    2424    }
    2525    void generateDoSegmentMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
    26         generateDoSegmentMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, iBuilder);
     26        generateDoSegmentMethod(mCodeUnitWidth, mStride * mStridesPerSegment, iBuilder);
    2727    }
    2828    void generateFinalizeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
     
    3131protected:
    3232    static llvm::Function * linkFileSizeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    33     static void generateInitializeMethod(llvm::Function * fileSize, const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    34     static void generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     33    static void generateInitializeMethod(llvm::Function * fileSize, const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     34    static void generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    3535    static void unmapSourceBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    3636protected:
    37     const unsigned   mBlocksRequiredPerSegment;
    38     const unsigned   mCodeUnitWidth;
     37    const unsigned mStridesPerSegment;
     38    const unsigned mCodeUnitWidth;
    3939    llvm::Function * mFileSizeFunction;
    4040};
     
    4343    friend class FDSourceKernel;
    4444public:
    45     ReadSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned blocksRequiredPerSegment = 1, const unsigned codeUnitWidth = 8);
     45    ReadSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned stridesPerSegment = 1, const unsigned codeUnitWidth = 8);
    4646    bool isCachable() const override { return true; }
    4747    bool hasSignature() const override { return false; }
    4848    void generateInitializeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
    49         generateInitializeMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, iBuilder);
     49        generateInitializeMethod(mCodeUnitWidth, mStride * mStridesPerSegment, iBuilder);
    5050    }
    5151    void generateDoSegmentMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
    52         generateDoSegmentMethod(mCodeUnitWidth, mBlocksRequiredPerSegment, iBuilder);
     52        generateDoSegmentMethod(mCodeUnitWidth, mStride * mStridesPerSegment, iBuilder);
    5353    }
    5454    void generateFinalizeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override {
     
    5656    }
    5757protected:
    58     static void generateInitializeMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    59     static void generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned blocksRequiredPerSegment, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     58    static void generateInitializeMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
     59    static void generateDoSegmentMethod(const unsigned codeUnitWidth, const unsigned segmentSize, const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    6060    static void freeBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    6161private:
    62     const unsigned mBlocksRequiredPerSegment;
     62    const unsigned mStridesPerSegment;
    6363    const unsigned mCodeUnitWidth;
    6464};
     
    6666class FDSourceKernel final : public SegmentOrientedKernel {
    6767public:
    68     FDSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned blocksRequiredPerSegment = 1, const unsigned codeUnitWidth = 8);
     68    FDSourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const unsigned stridesPerSegment = 1, const unsigned codeUnitWidth = 8);
    6969    bool isCachable() const override { return true; }
    7070    bool hasSignature() const override { return false; }
     
    7474    void generateFinalizeMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    7575protected:
    76     const unsigned mBlocksRequiredPerSegment;
     76    const unsigned mStridesPerSegment;
    7777    const unsigned mCodeUnitWidth;
    7878    llvm::Function * mFileSizeFunction;
     
    8181class MemorySourceKernel final : public SegmentOrientedKernel {
    8282public:
    83     MemorySourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, llvm::Type * const type, const unsigned blocksRequiredPerSegment = 1, const unsigned codeUnitWidth = 8);
     83    MemorySourceKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, llvm::Type * const type, const unsigned stridesPerSegment = 1, const unsigned codeUnitWidth = 8);
    8484    bool hasSignature() const override { return false; }
    8585protected:
     
    8787    void generateDoSegmentMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    8888private:
    89     const unsigned mBlocksRequiredPerSegment;
     89    const unsigned mStridesPerSegment;
    9090    const unsigned mCodeUnitWidth;
    9191};
Note: See TracChangeset for help on using the changeset viewer.