Ignore:
Timestamp:
Oct 1, 2016, 12:03:14 PM (3 years ago)
Author:
cameron
Message:

Kernel/pipeline progress: sychronize with logicalSegmentNo

File:
1 edited

Legend:

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

    r5141 r5174  
    77#define KERNEL_INTERFACE_H
    88
    9 
    109#include <string>
    1110#include <vector>
     
    1312#include <IDISA/idisa_builder.h>
    1413#include "streamset.h"
     14
    1515
    1616struct ScalarBinding {
     
    3333
    3434public:
     35    /*
     36     
     37     This class defines the methods to be used to generate the code 
     38     necessary for declaring, allocating, calling and synchronizing
     39     kernels.   The methods to be used for constructing kernels are defined
     40     within the KernelBuilder class of kernel.h
     41     
     42     */
     43   
     44    std::string & getName() { return mKernelName;}
     45   
     46    std::vector<StreamSetBinding> getStreamInputs() {return mStreamSetInputs;}
     47    std::vector<StreamSetBinding> getStreamOutputs() {return mStreamSetOutputs;}
     48    std::vector<ScalarBinding> getScalarInputs() { return mScalarInputs;}
     49    std::vector<ScalarBinding> getScalarOutputs() { return mScalarOutputs;}
     50   
     51   
     52    // Add ExternalLinkage method declarations for the kernel to a given client module.
     53    void addKernelDeclarations(Module * client);
     54   
     55    virtual llvm::Value * createInstance(std::vector<llvm::Value *> initialParameters);
     56
     57    llvm::Value * createDoSegmentCall(llvm::Value * kernelInstance, llvm::Value * blkCount);
     58    llvm::Value * createFinalBlockCall(llvm::Value * kernelInstance, llvm::Value * remainingBytes);
     59    llvm::Value * createGetAccumulatorCall(llvm::Value * kernelInstance, std::string accumName);
     60   
     61    unsigned getLookAhead() { return mLookAheadPositions; }
     62   
     63   
     64    virtual llvm::Value * getLogicalSegmentNo(llvm::Value * kernelInstance) = 0;
     65    virtual llvm::Value * getProcessedItemCount(llvm::Value * kernelInstance) = 0;
     66    virtual llvm::Value * getProducedItemCount(llvm::Value * kernelInstance) = 0;
     67    virtual llvm::Value * getTerminationSignal(llvm::Value * kernelInstance) = 0;
     68   
     69protected:
    3570    KernelInterface(IDISA::IDISA_Builder * builder,
    3671                    std::string kernelName,
     
    5085    mLookAheadPositions(0) {}
    5186   
    52     unsigned getLookAhead() { return mLookAheadPositions; }
    5387   
    54     // Add ExternalLinkage method declarations for the kernel to a given client module.
    55     void addKernelDeclarations(Module * client);
    56    
    57     virtual llvm::Value * createInstance(std::vector<llvm::Value *> initialParameters);
    58     llvm::Value * createInstance(std::vector<llvm::Value *> initialParameters, std::vector<parabix::StreamSetBuffer *> inputs, std::vector<parabix::StreamSetBuffer *> outputBuffers);
    59     llvm::Value * createDoBlockCall(llvm::Value * kernelInstance);
    60     llvm::Value * createDoSegmentCall(llvm::Value * kernelInstance, llvm::Value * blkCount);
    61     llvm::Value * createFinalBlockCall(llvm::Value * kernelInstance, llvm::Value * remainingBytes);
    62     llvm::Value * createGetAccumulatorCall(llvm::Value * kernelInstance, std::string accumName);
    63    
    64    
    65 protected:
    6688   
    6789    IDISA::IDISA_Builder * iBuilder;
     
    7698   
    7799    void setLookAhead(unsigned lookAheadPositions) {mLookAheadPositions = lookAheadPositions;}
     100    llvm::Value * createDoBlockCall(llvm::Value * kernelInstance);
    78101
    79102};
Note: See TracChangeset for help on using the changeset viewer.