Ignore:
Timestamp:
Jun 14, 2016, 2:31:21 PM (3 years ago)
Author:
cameron
Message:

Support for KernelInterface? instances

File:
1 edited

Legend:

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

    r5050 r5053  
    3737                    std::vector<ScalarBinding> internal_scalars);
    3838   
     39    void finalizeKernelStateType();
     40   
    3941    // Add ExternalLinkage method declarations for the kernel to a given client module.
    4042    void addKernelDeclarations(Module * client);
     
    4345    // all required methods.  The init and accumulator output methods will be
    4446    // defined, while the doBlock and finalBlock methods will initially be empty.
     47    //
    4548    virtual std::unique_ptr<llvm::Module> createKernelModule();
    4649   
     50    llvm::Value * createInstance(std::vector<llvm::Value *> initialParameters);
     51    llvm::Value * createDoBlockCall(llvm::Value * kernelInstance, std::vector<Value *> streamSets);
     52    llvm::Value * createFinalBlockCall(llvm::Value * kernelInstance, llvm::Value * remainingBytes, std::vector<llvm::Value *> streamSets);
     53    llvm::Value * createGetAccumulatorCall(llvm::Value * kernelInstance, std::string accumName);
     54   
     55   
    4756protected:
    48     // Get the index of a named scalar within the kernel state struct.
     57    // Add an additional scalar field to the KernelState struct.
     58    // Must occur before any call to addKernelDeclarations or createKernelModule.
     59    void addScalar(llvm::Type * t, std::string scalarName);
     60   
     61    // Run-time access of Kernel State and parameters of methods for
     62    // use in implementing kernels.
     63   
     64    // Get the index of a named scalar field within the kernel state struct.
    4965    llvm::Value * getScalarIndex(std::string);
     66   
     67    // Get the value of a scalar field for a given instance.
     68    llvm::Value * getScalarField(llvm::Value * self, std::string fieldName);
     69   
     70    // Set the value of a scalar field for a given instance.
     71    void setScalarField(llvm::Value * self, std::string fieldName, llvm::Value * newFieldVal);
     72   
    5073    // Get a parameter by name.
    51     llvm::Value * getParameter(Function * f, std::string paramName);
     74    llvm::Value * getParameter(llvm::Function * f, std::string paramName);
     75
    5276
    5377    IDISA::IDISA_Builder * iBuilder;
     
    5983    std::vector<ScalarBinding> mScalarOutputs;
    6084    std::vector<ScalarBinding> mInternalScalars;
     85
     86    std::vector<llvm::Type *>  mKernelFields;
    6187    llvm::Type *               mKernelStateType;
    6288    NameMap                    mInternalStateNameMap;
    63     NameMap                    mStreamSetNameMap;
    6489};
    6590
    66 
    6791#endif
Note: See TracChangeset for help on using the changeset viewer.