Ignore:
Timestamp:
May 7, 2017, 4:34:48 PM (2 years ago)
Author:
nmedfort
Message:

Continued refactoring work. PabloKernel? now abstract base type with a 'generatePabloMethod' hook to generate Pablo code.

File:
1 edited

Legend:

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

    r5435 r5436  
    5858    }
    5959
    60     virtual void allocateBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder);
     60    virtual void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
    6161
    6262    virtual void releaseBuffer(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const;
     
    121121
    122122protected:
    123     const BufferKind                        mBufferKind;
    124     llvm::Type * const                      mType;
    125     const size_t                            mBufferBlocks;
    126     const unsigned                          mAddressSpace;
    127     llvm::Value *                           mStreamSetBufferPtr;
    128     llvm::Type * const                      mBaseType;
    129     std::string                             mUniqueID;
     123    const BufferKind                 mBufferKind;
     124    llvm::Type * const               mType;
     125    const size_t                     mBufferBlocks;
     126    const unsigned                   mAddressSpace;
     127    llvm::Value *                    mStreamSetBufferPtr;
     128    llvm::Type * const               mBaseType;
     129    std::string                      mUniqueID;
    130130    kernel::Kernel *                 mProducer;
    131131    std::vector<kernel::Kernel *>    mConsumers;
     
    138138    }   
    139139
    140     SingleBlockBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type);
     140    SingleBlockBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type);
    141141
    142142protected:
     
    151151    }
    152152
    153     SourceBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, unsigned AddressSpace = 0);
     153    SourceBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, unsigned AddressSpace = 0);
    154154
    155155    void setBaseAddress(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * addr) const override;
     
    175175    }
    176176
    177     ExternalBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, llvm::Value * addr, unsigned AddressSpace = 0);
     177    ExternalBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, llvm::Value * addr, unsigned AddressSpace = 0);
    178178
    179179    // Can't allocate - raise an error. */
    180     void allocateBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder) override;
     180    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    181181
    182182    llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition, llvm::Value *) const override;
     
    192192    }
    193193   
    194     CircularBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
     194    CircularBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
    195195
    196196protected:
     
    210210    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::CircularCopybackBuffer;}
    211211   
    212     CircularCopybackBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, size_t bufferBlocks, size_t overflowBlocks, unsigned AddressSpace = 0);
    213 
    214     void allocateBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder) override;
     212    CircularCopybackBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, size_t overflowBlocks, unsigned AddressSpace = 0);
     213
     214    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    215215   
    216216    // Generate copyback code for the given number of overflowItems.
     
    232232    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::SwizzledCopybackBuffer;}
    233233   
    234     SwizzledCopybackBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, size_t bufferBlocks, size_t overflowBlocks, unsigned fieldwidth = 64, unsigned AddressSpace = 0);
    235    
    236     void allocateBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder) override;
     234    SwizzledCopybackBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, size_t overflowBlocks, unsigned fieldwidth = 64, unsigned AddressSpace = 0);
     235   
     236    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    237237   
    238238    void createBlockAlignedCopy(IDISA::IDISA_Builder * const iBuilder, llvm::Value * targetBlockPtr, llvm::Value * sourceBlockPtr, llvm::Value * itemsToCopy) const override;
     
    260260    static inline bool classof(const StreamSetBuffer * b) {return b->getBufferKind() == BufferKind::ExpandableBuffer;}
    261261
    262     ExpandableBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
     262    ExpandableBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type, size_t bufferBlocks, unsigned AddressSpace = 0);
    263263
    264264    llvm::Value * getStreamBlockPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, const bool readOnly) const override;
     
    268268    llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
    269269
    270     void allocateBuffer(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder) override;
     270    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    271271
    272272    llvm::Value * getStreamSetCount(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const override;
Note: See TracChangeset for help on using the changeset viewer.