Ignore:
Timestamp:
Mar 14, 2017, 7:06:06 PM (2 years ago)
Author:
cameron
Message:

Consolidate pipeline compiler options in toolchain

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5363 r5364  
    2020#include <kernels/streams_merge.h>
    2121#include <kernels/match_count.h>
    22 #include <kernels/pipeline.h>
    2322#include <kernels/mmap_kernel.h>
    2423#include <kernels/s2p_kernel.h>
     
    5857static cl::alias ShowLineNumbersLong("line-number", cl::desc("Alias for -n"), cl::aliasopt(ShowLineNumbers));
    5958
    60 static cl::opt<bool> pipelineParallel("enable-pipeline-parallel", cl::desc("Enable multithreading with pipeline parallelism."), cl::cat(bGrepOutputOptions));
    61 
    62 static cl::opt<bool> segmentPipelineParallel("enable-segment-pipeline-parallel", cl::desc("Enable multithreading with segment pipeline parallelism."), cl::cat(bGrepOutputOptions));
    63 
    6459bool isUTF_16 = false;
    6560std::string IRFilename = "icgrep.ll";
     
    247242    scanMatchK.setInitialArguments({iBuilder->CreateBitCast(inputStream, int8PtrTy), fileSize, fileIdx});
    248243   
    249     generatePipelineLoop(iBuilder, {&mmapK1, &mmapK2, &scanMatchK});
     244    generatePipeline(iBuilder, {&mmapK1, &mmapK2, &scanMatchK});
    250245    iBuilder->CreateRetVoid();
    251246
     
    260255
    261256    const unsigned segmentSize = codegen::SegmentSize;
    262     const unsigned bufferSegments = segmentPipelineParallel ? (codegen::BufferSegments * codegen::ThreadNum) : codegen::BufferSegments;
     257    const unsigned bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
    263258    const unsigned encodingBits = UTF_16 ? 16 : 8;
    264259
     
    335330        KernelList.push_back(&matchCountK); 
    336331
    337         if (pipelineParallel){
    338             generateParallelPipeline(iBuilder, KernelList);
    339         } else if (segmentPipelineParallel){
    340             generateSegmentParallelPipeline(iBuilder, KernelList);
    341         }  else{
    342             generatePipelineLoop(iBuilder, KernelList);
    343         }
     332        generatePipeline(iBuilder, KernelList);
    344333        iBuilder->CreateRet(matchCountK.getScalarField(matchCountK.getInstance(), "matchedLineCount"));
    345334
     
    351340        KernelList.push_back(&scanMatchK);
    352341
    353         if (pipelineParallel) {
    354             generateParallelPipeline(iBuilder, KernelList);
    355         } else if (segmentPipelineParallel) {
    356             generateSegmentParallelPipeline(iBuilder, KernelList);
    357         } else {
    358             generatePipelineLoop(iBuilder, KernelList);
    359         }
     342        generatePipeline(iBuilder, KernelList);
    360343       
    361344        iBuilder->CreateRetVoid();
     
    413396    // segment size made availabe for each call to the mmap source kernel
    414397    const unsigned segmentSize = codegen::SegmentSize;
    415     const unsigned bufferSegments = segmentPipelineParallel ? (codegen::BufferSegments * codegen::ThreadNum) : codegen::BufferSegments;
     398    const unsigned bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
    416399    const unsigned encodingBits = UTF_16 ? 16 : 8;
    417400
     
    497480    if (CountOnly) {
    498481        icgrepK.generateKernel({&BasisBits, &LineBreakStream}, {});
    499         if (pipelineParallel) {
    500             generateParallelPipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK});
    501         } else if (segmentPipelineParallel) {
    502             generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK});
    503         } else {
    504             generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK});
    505         }
     482        generatePipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK});
    506483        iBuilder->CreateRet(icgrepK.createGetAccumulatorCall(icgrepK.getInstance(), "matchedLineCount"));
    507484    } else {
     
    526503            scanMatchK.setInitialArguments({iBuilder->CreateBitCast(inputStream, int8PtrTy), fileSize, fileIdx});
    527504           
    528             if (pipelineParallel) {
    529                 generateParallelPipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK, &scanMatchK});
    530             } else if (segmentPipelineParallel) {
    531                 generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK, &scanMatchK});
    532             } else {
    533                 generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK, &scanMatchK});
    534             }
     505            generatePipeline(iBuilder, {&mmapK, &s2pk, &linebreakK, &icgrepK, &scanMatchK});
    535506        }
    536507        iBuilder->CreateRetVoid();
Note: See TracChangeset for help on using the changeset viewer.