Ignore:
Timestamp:
May 6, 2016, 3:28:07 PM (3 years ago)
Author:
cameron
Message:

Refactor: move grep-specific code out of toolchain

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/casefold_pipeline.cpp

    r5014 r5033  
    44 */
    55
     6#include <toolchain.h>
    67#include <kernels/casefold_pipeline.h>
    78#include <utf_encoding.h>
     
    1516#include <pablo/pablo_compiler.h>
    1617#include <pablo/pablo_toolchain.h>
    17 
    18 static cl::opt<unsigned> SegmentSize("segment-size", cl::desc("Segment Size"), cl::value_desc("positive integer"), cl::init(1));
    1918
    2019
     
    3837
    3938void PipelineBuilder::CreateKernels(PabloFunction * function){
    40     mS2PKernel = new KernelBuilder(iBuilder, "s2p", SegmentSize);
    41     mP2SKernel = new KernelBuilder(iBuilder, "p2s", SegmentSize);
    42     mCaseFoldKernel = new KernelBuilder(iBuilder, "casefold", SegmentSize);
    43     mStdOutKernel = new KernelBuilder(iBuilder, "stddout", SegmentSize);
     39    mS2PKernel = new KernelBuilder(iBuilder, "s2p", codegen::SegmentSize);
     40    mP2SKernel = new KernelBuilder(iBuilder, "p2s", codegen::SegmentSize);
     41    mCaseFoldKernel = new KernelBuilder(iBuilder, "casefold", codegen::SegmentSize);
     42    mStdOutKernel = new KernelBuilder(iBuilder, "stddout", codegen::SegmentSize);
    4443
    4544    generateS2PKernel(mMod, iBuilder, mS2PKernel);
     
    8382    BasicBlock * segmentCondBlock = nullptr;
    8483    BasicBlock * segmentBodyBlock = nullptr;
    85     const unsigned segmentSize = SegmentSize;
     84    const unsigned segmentSize = codegen::SegmentSize;
    8685    if (segmentSize > 1) {
    8786        segmentCondBlock = BasicBlock::Create(mMod->getContext(), "segmentCond", main, 0);
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5025 r5033  
    44 */
    55
     6
     7#include <toolchain.h>
    68#include "pipeline.h"
    79#include "utf_encoding.h"
     
    1517#include <pablo/pablo_toolchain.h>
    1618
    17 #include <llvm/Support/CommandLine.h>
    1819#include <llvm/IR/Intrinsics.h>
    19 
    20 static cl::opt<unsigned> SegmentSize("segment-size", cl::desc("Segment Size"), cl::value_desc("positive integer"), cl::init(1));
    2120
    2221using namespace pablo;
     
    3837
    3938void PipelineBuilder::CreateKernels(PabloFunction * function, bool isNameExpression){
    40     mS2PKernel = new KernelBuilder(iBuilder, "s2p", SegmentSize);
    41     mICgrepKernel = new KernelBuilder(iBuilder, "icgrep", SegmentSize);
    42     mScanMatchKernel = new KernelBuilder(iBuilder, "scanMatch", SegmentSize);
     39    mS2PKernel = new KernelBuilder(iBuilder, "s2p", codegen::SegmentSize);
     40    mICgrepKernel = new KernelBuilder(iBuilder, "icgrep", codegen::SegmentSize);
     41    mScanMatchKernel = new KernelBuilder(iBuilder, "scanMatch", codegen::SegmentSize);
    4342    generateS2PKernel(mMod, iBuilder, mS2PKernel);
    4443    generateScanMatch(mMod, iBuilder, 64, mScanMatchKernel, isNameExpression);
     
    9796    BasicBlock * segmentCondBlock = nullptr;
    9897    BasicBlock * segmentBodyBlock = nullptr;
    99     const unsigned segmentSize = SegmentSize;
     98    const unsigned segmentSize = codegen::SegmentSize;
    10099    if (segmentSize > 1) {
    101100        segmentCondBlock = BasicBlock::Create(mMod->getContext(), "segmentCond", main, 0);
Note: See TracChangeset for help on using the changeset viewer.