Ignore:
Timestamp:
May 3, 2017, 1:13:04 PM (2 years ago)
Author:
nmedfort
Message:

partial refactoring check in with change for Linda.

File:
1 edited

Legend:

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

    r5429 r5431  
    6161    // should return true.
    6262    //
    63    
     63       
     64    bool isCachable() const override { return false; }
     65
     66    std::string makeSignature() override;
     67
    6468    // Can the module ID itself serve as the unique signature?
    65     virtual bool moduleIDisSignature() { return false; }
    66    
    67     virtual std::string generateKernelSignature(std::string moduleId);
    68    
     69    virtual bool moduleIDisSignature() const { return false; }
     70
    6971    // Create a module stub for the kernel, populated only with its Module ID.     
    7072    //
     73
    7174    void createKernelStub(const StreamSetBuffers & inputs, const StreamSetBuffers & outputs);
     75
     76    void createKernelStub(const StreamSetBuffers & inputs, const StreamSetBuffers & outputs, llvm::Module * const kernelModule);
    7277
    7378    llvm::Module * getModule() const {
     
    106111    // Get the value of a scalar field for the current instance.
    107112    llvm::Value * getScalarFieldPtr(llvm::Value * index) const {
    108         return getScalarFieldPtr(getInstance(), index);
     113        return iBuilder->CreateGEP(getInstance(), {iBuilder->getInt32(0), index});
    109114    }
    110115
    111116    llvm::Value * getScalarFieldPtr(const std::string & fieldName) const {
    112         return getScalarFieldPtr(getInstance(), fieldName);
     117        return getScalarFieldPtr(getScalarIndex(fieldName));
    113118    }
    114119
     
    168173    // Constructor
    169174    KernelBuilder(IDISA::IDISA_Builder * builder,
    170                     std::string && kernelName,
    171                     std::vector<Binding> && stream_inputs,
    172                     std::vector<Binding> && stream_outputs,
    173                     std::vector<Binding> && scalar_parameters,
    174                     std::vector<Binding> && scalar_outputs,
    175                     std::vector<Binding> && internal_scalars);
     175                  std::string && kernelName,
     176                  std::vector<Binding> && stream_inputs,
     177                  std::vector<Binding> && stream_outputs,
     178                  std::vector<Binding> && scalar_parameters,
     179                  std::vector<Binding> && scalar_outputs,
     180                  std::vector<Binding> && internal_scalars);
    176181
    177182    //
     
    252257    llvm::Value * getAvailableItemCount(const std::string & name) const;
    253258
     259    llvm::Value * getLinearlyAccessibleItems(const std::string & name, llvm::Value * fromPosition) const;
     260
    254261    llvm::Value * getIsFinal() const {
    255262        return mIsFinal;
     
    260267    llvm::BasicBlock * CreateBasicBlock(std::string && name) const;
    261268
    262     // Stream set helpers.
    263 
    264269    llvm::Value * getStreamSetBufferPtr(const std::string & name) const;
    265 
    266     llvm::Value * getScalarFieldPtr(llvm::Value * const instance, llvm::Value * index) const {
    267         assert ("instance cannot be null!" && instance);
    268         return iBuilder->CreateGEP(getInstance(), {iBuilder->getInt32(0), index});
    269     }
    270 
    271     llvm::Value * getScalarFieldPtr(llvm::Value * const instance, const std::string & fieldName) const {
    272         return getScalarFieldPtr(instance, getScalarIndex(fieldName));
    273     }
    274270
    275271    void callGenerateInitializeMethod();
Note: See TracChangeset for help on using the changeset viewer.