Ignore:
Timestamp:
May 12, 2017, 4:54:11 PM (2 years ago)
Author:
nmedfort
Message:

Refactoring work + correction for getRawItemPointer

File:
1 edited

Legend:

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

    r5440 r5446  
    6868    virtual llvm::Value * getStreamSetCount(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const;
    6969
    70     llvm::Value * getRawItemPointer(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * streamIndex, llvm::Value * absolutePosition) const;
     70    virtual llvm::Value * getRawItemPointer(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * streamIndex, llvm::Value * absolutePosition) const;
    7171
    7272    virtual void setBaseAddress(IDISA::IDISA_Builder * const iBuilder, llvm::Value * addr, llvm::Value *) const;
     
    9999protected:
    100100
    101     StreamSetBuffer(BufferKind k, llvm::Type * baseType, llvm::Type * resolvedType, unsigned blocks, unsigned AddressSpace);
     101    StreamSetBuffer(BufferKind k, llvm::Type * baseType, llvm::Type * resolvedType, unsigned BufferBlocks, unsigned AddressSpace);
    102102
    103103    // Get the buffer pointer for a given block of the stream.
     
    186186};
    187187
    188 class CircularBuffer final : public StreamSetBuffer {
     188class CircularBuffer : public StreamSetBuffer {
    189189public:
    190190    static inline bool classof(const StreamSetBuffer * b) {
     
    194194    CircularBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
    195195
    196 protected:
    197     llvm::Value * getStreamSetBlockPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * blockIndex) const override;
     196    llvm::Value * getRawItemPointer(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * streamIndex, llvm::Value * absolutePosition) const final;
     197
     198protected:
     199
     200    CircularBuffer(const BufferKind kind, const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
     201
     202    llvm::Value * getStreamSetBlockPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * blockIndex) const final;
    198203};
    199204   
     
    206211//  Kernels that read from a CircularCopybackBuffer must not access the overflow area.
    207212//
    208 class CircularCopybackBuffer final : public StreamSetBuffer {
     213class CircularCopybackBuffer final : public CircularBuffer {
    209214public:
    210215    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::CircularCopybackBuffer;}
     
    221226    llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromBlock) const override;
    222227   
    223 protected:
    224     llvm::Value * getStreamSetBlockPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * blockIndex) const override;
    225228private:
    226229    size_t mOverflowBlocks;
Note: See TracChangeset for help on using the changeset viewer.