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

Eliminate filesize parameter for pipeline construction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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();
Note: See TracChangeset for help on using the changeset viewer.