Changeset 5221


Ignore:
Timestamp:
Dec 6, 2016, 7:34:50 PM (2 years ago)
Author:
cameron
Message:

Eliminate filesize parameter for pipeline construction

Location:
icGREP/icgrep-devel/icgrep
Files:
6 edited

Legend:

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

    r5220 r5221  
    245245    MatchResults.allocateBuffer();
    246246   
    247     generatePipelineLoop(iBuilder, {&editdk, &editdScanK}, fileSize);
     247    generatePipelineLoop(iBuilder, {&editdk, &editdScanK});
    248248       
    249249    iBuilder->CreateRetVoid();
     
    316316    CCResults.setStreamSetBuffer(outputStream, fileSize);
    317317   
    318     generatePipelineLoop(iBuilder, {&s2pk, &ccck}, fileSize);
     318    generatePipelineLoop(iBuilder, {&s2pk, &ccck});
    319319       
    320320    iBuilder->CreateRetVoid();
     
    487487    editdk.setInitialArguments({pattStream, strideCarry});
    488488   
    489     generatePipelineLoop(iBuilder, {&editdk}, inputSize);
     489    generatePipelineLoop(iBuilder, {&editdk});
    490490       
    491491    iBuilder->CreateRetVoid();
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5220 r5221  
    225225    scanMatchK.setInitialArguments({inputStream, fileSize, fileIdx});
    226226   
    227     generatePipelineLoop(iBuilder, {&scanMatchK}, fileSize);
     227    generatePipelineLoop(iBuilder, {&scanMatchK});
    228228    iBuilder->CreateRetVoid();
    229229
     
    372372            generatePipelineParallel(iBuilder, {&s2pk, &icgrepK});
    373373        } else if (segmentPipelineParallel){
    374             generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK}, fileSize);
     374            generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK});
    375375        } else {
    376             generatePipelineLoop(iBuilder, {&s2pk, &icgrepK}, fileSize);
     376            generatePipelineLoop(iBuilder, {&s2pk, &icgrepK});
    377377        }
    378378
     
    388388
    389389            icgrepK.generateKernel({&BasisBits},  {&MatchResults});
    390             generatePipelineLoop(iBuilder, {&s2pk, &icgrepK}, fileSize);
     390            generatePipelineLoop(iBuilder, {&s2pk, &icgrepK});
    391391
    392392        }
     
    405405                generatePipelineParallel(iBuilder, {&s2pk, &icgrepK, &scanMatchK});
    406406            } else if (segmentPipelineParallel){
    407                 generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, fileSize);
     407                generateSegmentParallelPipeline(iBuilder, {&s2pk, &icgrepK, &scanMatchK});
    408408            }  else{
    409                 generatePipelineLoop(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, fileSize);
     409                generatePipelineLoop(iBuilder, {&s2pk, &icgrepK, &scanMatchK});
    410410            }
    411411        }
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.cpp

    r5220 r5221  
    5252    std::vector<Value *> instancePtrs;
    5353    for (unsigned i = 0; i < kernels.size(); i++) {
    54         Value * ptr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(i + 1)});
     54        Value * ptr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(i)});
    5555        instancePtrs.push_back(iBuilder->CreateLoad(ptr));
    5656    }
     
    9494}
    9595
    96 void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, std::vector<KernelBuilder *> kernels, Value * fileSize) {
     96void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, std::vector<KernelBuilder *> kernels) {
    9797   
    9898    unsigned threadNum = codegen::ThreadNum;
     
    116116
    117117    std::vector<Type *> structTypes;
    118     structTypes.push_back(size_ty);//input size
    119118    for (unsigned i = 0; i < kernels.size(); i++) {
    120119        structTypes.push_back(kernels[i]->getInstance()->getType());
     
    123122
    124123    AllocaInst * sharedStruct = iBuilder->CreateAlloca(sharedStructType);
    125     Value * sizePtr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
    126     iBuilder->CreateStore(fileSize, sizePtr);
    127     for (unsigned i = 0; i < kernels.size(); i++) {
    128         Value * ptr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(i+1)});
     124    for (unsigned i = 0; i < kernels.size(); i++) {
     125        Value * ptr = iBuilder->CreateGEP(sharedStruct, {iBuilder->getInt32(0), iBuilder->getInt32(i)});
    129126        iBuilder->CreateStore(kernels[i]->getInstance(), ptr);
    130127    }
     
    200197
    201198
    202 void generatePipelineLoop(IDISA::IDISA_Builder * iBuilder, std::vector<KernelBuilder *> kernels, Value * fileSize) {
     199void generatePipelineLoop(IDISA::IDISA_Builder * iBuilder, std::vector<KernelBuilder *> kernels) {
    203200   
    204201    BasicBlock * entryBlock = iBuilder->GetInsertBlock();
  • icGREP/icgrep-devel/icgrep/kernels/pipeline.h

    r5220 r5221  
    1010#include <kernels/kernel.h>
    1111
    12 void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, std::vector<kernel::KernelBuilder *> kernels, Value * fileSize);
     12void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, std::vector<kernel::KernelBuilder *> kernels);
    1313
    14 void generatePipelineLoop(IDISA::IDISA_Builder * iBuilder, std::vector<kernel::KernelBuilder *> kernels, llvm::Value * totalBytes);
     14void generatePipelineLoop(IDISA::IDISA_Builder * iBuilder, std::vector<kernel::KernelBuilder *> kernels);
    1515
    1616void generatePipelineParallel(IDISA::IDISA_Builder * iBuilder, std::vector<kernel::KernelBuilder *> kernels);
  • icGREP/icgrep-devel/icgrep/u8u16.cpp

    r5220 r5221  
    364364
    365365    if (segmentPipelineParallel){
    366         generateSegmentParallelPipeline(iBuilder, {&s2pk, &u8u16k, &delK, &p2sk, &stdoutK}, fileSize);
     366        generateSegmentParallelPipeline(iBuilder, {&s2pk, &u8u16k, &delK, &p2sk, &stdoutK});
    367367    } else {
    368         generatePipelineLoop(iBuilder, {&s2pk, &u8u16k, &delK, &p2sk, &stdoutK}, fileSize);
     368        generatePipelineLoop(iBuilder, {&s2pk, &u8u16k, &delK, &p2sk, &stdoutK});
    369369    }
    370370
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5220 r5221  
    176176    BasisBits.allocateBuffer();
    177177   
    178     generatePipelineLoop(iBuilder, {&s2pk, &wck}, fileSize);
     178    generatePipelineLoop(iBuilder, {&s2pk, &wck});
    179179   
    180180    Value * lineCount = wck.createGetAccumulatorCall(wck.getInstance(), "lineCount");
Note: See TracChangeset for help on using the changeset viewer.