Ignore:
Timestamp:
Oct 25, 2017, 4:57:58 PM (20 months ago)
Author:
nmedfort
Message:

First stage of MultiBlockKernel? and pipeline restructuring

File:
1 edited

Legend:

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

    r5650 r5706  
    22#define KERNEL_BUILDER_H
    33
    4 #include <kernels/interface.h>
    54#include <IR_Gen/idisa_builder.h>
     5#include <kernels/kernel.h>
    66
    77namespace kernel {
     
    1010
    1111class KernelBuilder : public virtual IDISA::IDISA_Builder {
     12    friend class Kernel;
    1213public:
    1314
     
    3536    void releaseLogicalSegmentNo(llvm::Value * nextSegNo);
    3637
    37     llvm::Value * getProducedItemCount(const std::string & name, llvm::Value * doFinal = nullptr);
     38    llvm::Value * getProducedItemCount(const std::string & name) {
     39        return getInternalItemCount(name, Kernel::PRODUCED_ITEM_COUNT_SUFFIX);
     40    }
    3841
    39     void setProducedItemCount(const std::string & name, llvm::Value * value);
     42    void setProducedItemCount(const std::string & name, llvm::Value * value) {
     43        setInternalItemCount(name, Kernel::PRODUCED_ITEM_COUNT_SUFFIX, value);
     44    }
    4045
    41     llvm::Value * getProcessedItemCount(const std::string & name);
     46    llvm::Value * getProcessedItemCount(const std::string & name) {
     47        return getInternalItemCount(name, Kernel::PROCESSED_ITEM_COUNT_SUFFIX);
     48    }
    4249
    43     void setProcessedItemCount(const std::string & name, llvm::Value * value);
     50    void setProcessedItemCount(const std::string & name, llvm::Value * value) {
     51        setInternalItemCount(name, Kernel::PROCESSED_ITEM_COUNT_SUFFIX, value);
     52    }
    4453
    45     llvm::Value * getConsumedItemCount(const std::string & name);
     54    llvm::Value * getConsumedItemCount(const std::string & name) {
     55        return getInternalItemCount(name, Kernel::CONSUMED_ITEM_COUNT_SUFFIX);
     56    }
    4657
    47     void setConsumedItemCount(const std::string & name, llvm::Value * value);
     58    void setConsumedItemCount(const std::string & name, llvm::Value * value) {
     59        setInternalItemCount(name, Kernel::CONSUMED_ITEM_COUNT_SUFFIX, value);
     60    }
    4861
    4962    llvm::Value * getTerminationSignal();
    5063
    51     void setTerminationSignal();
     64    void setTerminationSignal() { setTerminationSignal(getTrue()); }
     65
     66    void setTerminationSignal(llvm::Value * const value);
     67
     68    llvm::Value * getCycleCountPtr();
    5269
    5370    // Run-time access of Kernel State and parameters of methods for
    5471    // use in implementing kernels.
     72
     73    llvm::Value * getInputStreamPtr(const std::string & name, llvm::Value * const blockIndex);
    5574
    5675    llvm::Value * getInputStreamBlockPtr(const std::string & name, llvm::Value * streamIndex);
     
    6382
    6483    llvm::Value * getInputStreamSetCount(const std::string & name);
     84
     85    llvm::Value * getOutputStreamPtr(const std::string & name, llvm::Value * const blockIndex);
    6586
    6687    llvm::Value * getOutputStreamBlockPtr(const std::string & name, llvm::Value * streamIndex);
     
    7697    llvm::Value * getAdjustedInputStreamBlockPtr(llvm::Value * blockAdjustment, const std::string & name, llvm::Value * streamIndex);
    7798
    78     llvm::Value * getRawInputPointer(const std::string & name, llvm::Value * streamIndex, llvm::Value * absolutePosition);
     99    llvm::Value * getRawInputPointer(const std::string & name, llvm::Value * absolutePosition);
    79100
    80     llvm::Value * getRawOutputPointer(const std::string & name, llvm::Value * streamIndex, llvm::Value * absolutePosition);
     101    llvm::Value * getRawOutputPointer(const std::string & name, llvm::Value * absolutePosition);
    81102
    82103    llvm::Value * getBaseAddress(const std::string & name);
     104
     105    void CreateCopyBack(const std::string & name, llvm::Value * from, llvm::Value * to);
    83106
    84107    void setBaseAddress(const std::string & name, llvm::Value * addr);
     
    98121    llvm::Value * getLinearlyWritableItems(const std::string & name, llvm::Value * fromPos, bool reverse = false);
    99122   
     123    llvm::Value * copy(const std::string & name, llvm::Value * target, llvm::Value * source, llvm::Value * itemsToCopy, const unsigned alignment = 0);
     124
    100125    llvm::BasicBlock * CreateConsumerWait();
    101126
    102     llvm::Value * getStreamSetBufferPtr(const std::string & name);
     127    llvm::Value * getStreamHandle(const std::string & name);
    103128
    104129    llvm::CallInst * createDoSegmentCall(const std::vector<llvm::Value *> & args);
     
    130155    llvm::Value * getScalarFieldPtr(llvm::Value * instance, const std::string & fieldName);
    131156
     157    llvm::Value * getInternalItemCount(const std::string & name, const std::string & suffix);
     158
     159    void setInternalItemCount(const std::string & name, const std::string & suffix, llvm::Value * const value);
     160
    132161private:
    133162
Note: See TracChangeset for help on using the changeset viewer.