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/pablo/pablo_kernel.h

    r5435 r5436  
    1414#include <boost/container/flat_map.hpp>
    1515
    16 namespace IDISA { class IDISA_Builder; }
    1716namespace llvm { class Type; }
    1817namespace pablo { class Integer; }
     
    4645    }
    4746
    48     PabloKernel(const std::unique_ptr<IDISA::IDISA_Builder> & builder, std::string kernelName,
     47    PabloKernel(const std::unique_ptr<kernel::KernelBuilder> & builder, std::string kernelName,
    4948                std::vector<Binding> stream_inputs = {},
    5049                std::vector<Binding> stream_outputs = {},
     
    126125protected:
    127126
     127    virtual void generatePabloMethod() = 0;
     128
     129    String * makeName(const llvm::StringRef & prefix) const;
     130
     131    Integer * getInteger(const int64_t value) const;
     132
    128133    // A custom method for preparing kernel declarations is needed,
    129134    // so that the carry data requirements may be accommodated before
    130135    // finalizing the KernelStateType.
    131     void prepareKernel()  override;
     136    void prepareKernel() final;
    132137
    133     void generateDoBlockMethod() override final;
     138    void generateDoBlockMethod() final;
    134139
    135140    // The default method for Pablo final block processing sets the
    136141    // EOFmark bit and then calls the standard DoBlock function.
    137142    // This may be overridden for specialized processing.
    138     virtual void generateFinalBlockMethod(llvm::Value * remainingBytes) override final;
    139 
    140     inline String * makeName(const llvm::StringRef & prefix) const {
    141         return mSymbolTable->makeString(iBuilder->getContext(), prefix);
    142     }
    143 
    144     inline Integer * getInteger(const int64_t value) const {
    145         return mSymbolTable->getInteger(iBuilder->getContext(), value);
    146     }
     143    void generateFinalBlockMethod(llvm::Value * remainingBytes) final;
    147144
    148145private:
Note: See TracChangeset for help on using the changeset viewer.