Ignore:
Timestamp:
Nov 28, 2017, 1:45:19 AM (18 months ago)
Author:
nmedfort
Message:

Bug fix for segment pipeline parallel mode + memory management improvements.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/pipeline.cpp

    r5733 r5748  
    2828    Function * const f = Function::Create(FunctionType::get(b->getVoidTy(), {b->getVoidPtrTy()}, false), Function::InternalLinkage, name, b->getModule());
    2929    f->setCallingConv(CallingConv::C);
    30     f->arg_begin()->setName("input");
     30    f->arg_begin()->setName("state");
    3131    return f;
    3232}
     
    5151    Constant * nullVoidPtrVal = ConstantPointerNull::getNullValue(voidPtrTy);
    5252    std::vector<Type *> structTypes;
    53 
    5453    codegen::BufferSegments = std::max(codegen::BufferSegments, codegen::ThreadNum);
    5554
     
    6261    StructType * const threadStructType = StructType::get(m->getContext(), {sharedStructType->getPointerTo(), sizeTy});
    6362
     63    const auto ip = iBuilder->saveIP();
     64
    6465    Function * const threadFunc = makeThreadFunction(iBuilder, "segment");
    65     Function::arg_iterator args = threadFunc->arg_begin();
    66     Value * threadStruct = iBuilder->CreateBitCast(&*(args), threadStructType->getPointerTo());
     66    auto args = threadFunc->arg_begin();
    6767
    6868    // -------------------------------------------------------------------------------------------------------------------------
    6969    // MAKE SEGMENT PARALLEL PIPELINE THREAD
    7070    // -------------------------------------------------------------------------------------------------------------------------
    71     const auto ip = iBuilder->saveIP();
    7271
    7372     // Create the basic blocks for the thread function.
    7473    BasicBlock * entryBlock = BasicBlock::Create(iBuilder->getContext(), "entry", threadFunc);
    7574    iBuilder->SetInsertPoint(entryBlock);
     75
     76    Value * const threadStruct = iBuilder->CreateBitCast(&*(args), threadStructType->getPointerTo());
     77
    7678    Value * const sharedStatePtr = iBuilder->CreateLoad(iBuilder->CreateGEP(threadStruct, {iBuilder->getInt32(0), iBuilder->getInt32(0)}));
    7779    for (unsigned k = 0; k < n; ++k) {
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.cpp

    r5746 r5748  
    128128
    129129bool DebugOptionIsSet(const DebugFlags flag) {
    130     if (IN_DEBUG_MODE && (flag == EnableAsserts)) return true;
     130    // if (IN_DEBUG_MODE && (flag == EnableAsserts)) return true;
    131131    return DebugOptions.isSet(flag);
    132132}
Note: See TracChangeset for help on using the changeset viewer.