Changeset 5506 for icGREP


Ignore:
Timestamp:
Jun 13, 2017, 9:23:11 PM (23 months ago)
Author:
cameron
Message:

:getStreamSetBlockType

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

Legend:

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

    r5505 r5506  
    800800    for (unsigned i = 0; i < totalSetCount; i++) {
    801801        unsigned blocks = maxBlocksToCopy[i];
    802         Type * bufType = i < inputSetCount ? mStreamSetInputBuffers[i]->getType() : mStreamSetOutputBuffers[i -inputSetCount]->getType();
     802        Type * bufType = i < inputSetCount ? mStreamSetInputBuffers[i]->getStreamSetBlockType() : mStreamSetOutputBuffers[i -inputSetCount]->getStreamSetBlockType();
    803803        if (blocks > 1) {
    804804            tempBuffers[i] = ArrayType::get(bufType, blocks);
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5503 r5506  
    1717using namespace llvm;
    1818using namespace IDISA;
     19
     20
     21Type * StreamSetBuffer::getStreamSetBlockType() const { return mType;}
    1922
    2023ArrayType * resolveStreamSetType(const std::unique_ptr<kernel::KernelBuilder> & b, Type * type);
     
    179182        Value * copyBits = iBuilder->CreateMul(itemsToCopy, iBuilder->getSize(fieldWidth));
    180183        Value * copyBytes = iBuilder->CreateLShr(iBuilder->CreateAdd(copyBits, iBuilder->getSize(7)), iBuilder->getSize(3));
    181        
    182184        iBuilder->CreateMemMove(iBuilder->CreateBitCast(targetBlockPtr, int8PtrTy), iBuilder->CreateBitCast(sourceBlockPtr, int8PtrTy), copyBytes, alignment);
    183185    } else {
     
    201203
    202204// Source File Buffer
     205
     206Type * SourceBuffer::getStreamSetBlockType() const {
     207    return cast<PointerType>(mType->getStructElementType(int(SourceBuffer::Field::BaseAddress)))->getElementType();
     208}
     209
     210
    203211Value * SourceBuffer::getBufferedSize(IDISA::IDISA_Builder * const iBuilder, Value * self) const {
    204212    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::BufferedSize))});
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5503 r5506  
    4040        return mType;
    4141    }
    42 
     42   
    4343    llvm::Type * getBaseType() const {
    4444        return mBaseType;
     
    5757    }
    5858
     59    virtual llvm::Type * getStreamSetBlockType() const;
     60   
    5961    virtual void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    6062
     
    159161    llvm::Value * getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromBlock) const override;
    160162
     163    virtual llvm::Type * getStreamSetBlockType() const override;
    161164
    162165protected:
Note: See TracChangeset for help on using the changeset viewer.