Ignore:
Timestamp:
Feb 14, 2017, 12:45:42 PM (3 years ago)
Author:
cameron
Message:

Simplify stream set access; better naming of access functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5316 r5317  
    4444        return mStreamSetBufferPtr;
    4545    }
    46 
     46   
    4747    virtual void allocateBuffer();
    4848
    49     virtual llvm::Value * getStream(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex) const;
     49    virtual llvm::Value * getStreamBlockPtr(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex) const;
    5050
    51     virtual llvm::Value * getStream(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, llvm::Value * packIndex) const;
     51    virtual llvm::Value * getStreamPackPtr(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, llvm::Value * packIndex) const;
    5252   
    5353    llvm::Value * getRawItemPointer(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * absolutePosition) const;
     
    5858protected:
    5959
    60     StreamSetBuffer(BufferKind k, IDISA::IDISA_Builder * b, llvm::Type * baseType, llvm::Type * resolvedType, unsigned blocks, unsigned AddressSpace);
     60    StreamSetBuffer(BufferKind k, IDISA::IDISA_Builder * b, llvm::Type * type, unsigned blocks, unsigned AddressSpace);
    6161
    6262    // Get the buffer pointer for a given block of the stream.
    63     virtual llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockNo) const = 0;
     63    virtual llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockNo) const = 0;
    6464
    6565protected:
     
    8282
    8383protected:
    84     llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockNo) const override;
     84    llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockNo) const override;
    8585};
    8686
     
    103103   
    104104protected:
    105     llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockNo) const override;
     105    llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockNo) const override;
    106106};
    107107   
     
    115115
    116116protected:
    117     llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
     117    llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
    118118};
    119119   
     
    139139   
    140140protected:
    141     llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
     141    llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
    142142private:
    143143    size_t mOverflowBlocks;
     
    154154    ExpandableBuffer(IDISA::IDISA_Builder * b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
    155155
    156     llvm::Value * getStream(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex) const override;
     156    llvm::Value * getStreamBlockPtr(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex) const override;
    157157
    158     llvm::Value * getStream(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, llvm::Value * packIndex) const override;
     158    llvm::Value * getStreamPackPtr(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, llvm::Value * packIndex) const override;
    159159
    160160    llvm::Value * getLinearlyAccessibleItems(llvm::Value * fromPosition) const override;
    161161   
    162     void allocateBuffer() override;
    163 
    164162protected:
    165163
    166     llvm::Value * getStreamSetPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
     164    void ensureStreamCapacity(llvm::Value * self, llvm::Value * streamIndex) const;
    167165
    168 private:
    169 
    170     std::pair<llvm::Value *, llvm::Value *> getExpandedStreamOffset(llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex) const;
    171 
    172 private:
    173 
    174     const uint64_t  mInitialCapacity;
    175 
     166    llvm::Value * getStreamSetBlockPtr(llvm::Value * self, llvm::Value * blockIndex) const override;
    176167};
    177168
Note: See TracChangeset for help on using the changeset viewer.