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.cpp

    r5435 r5436  
    1111#include <pablo/pe_ones.h>
    1212#include <pablo/pablo_toolchain.h>
     13#include <kernels/kernel_builder.h>
    1314#include "llvm/Support/Debug.h"
    1415
     
    119120
    120121void PabloKernel::prepareKernel() {
     122    if (DebugOptionIsSet(DumpTrace)) {
     123        setName(getName() + "_DumpTrace");
     124    }
     125    generatePabloMethod();
     126    pablo_function_passes(this);
    121127    mPabloCompiler->initializeKernelData(iBuilder);
    122128    BlockOrientedKernel::prepareKernel();
     
    127133}
    128134
    129 void PabloKernel::generateFinalBlockMethod(Value * remainingBytes) {
     135void PabloKernel::generateFinalBlockMethod(Value * const remainingBytes) {
    130136    // Standard Pablo convention for final block processing: set a bit marking
    131137    // the position just past EOF, as well as a mask marking all positions past EOF.
     
    135141}
    136142
    137 PabloKernel::PabloKernel(const std::unique_ptr<IDISA::IDISA_Builder> & b,
     143String * PabloKernel::makeName(const llvm::StringRef & prefix) const {
     144    return mSymbolTable->makeString(iBuilder->getContext(), prefix);
     145}
     146
     147Integer * PabloKernel::getInteger(const int64_t value) const {
     148    return mSymbolTable->getInteger(iBuilder->getContext(), value);
     149}
     150
     151PabloKernel::PabloKernel(const std::unique_ptr<KernelBuilder> & b,
    138152                         std::string kernelName,
    139153                         std::vector<Binding> stream_inputs,
     
    170184        result->setScalar();
    171185    }
    172     if (DebugOptionIsSet(DumpTrace)) {
    173         setName(getName() + "_DumpTrace");
    174     }
    175186}
    176187
Note: See TracChangeset for help on using the changeset viewer.