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/kernels/pipeline.cpp

    r5363 r5364  
    227227
    228228void generateSegmentParallelPipeline(IDISA::IDISA_Builder * iBuilder, const std::vector<KernelBuilder *> & kernels) {
    229    
    230     const unsigned threadNum = codegen::ThreadNum;
    231    
     229       
    232230    Module * m = iBuilder->getModule();
    233231   
     
    240238    ProducerTable producerTable = createProducerTable(kernels);
    241239   
    242     Type * const pthreadsTy = ArrayType::get(size_ty, threadNum);
     240    Type * const pthreadsTy = ArrayType::get(size_ty, codegen::ThreadNum);
    243241    AllocaInst * const pthreads = iBuilder->CreateAlloca(pthreadsTy);
    244242    std::vector<Value *> pthreadsPtrs;
    245     for (unsigned i = 0; i < threadNum; i++) {
     243    for (unsigned i = 0; i < codegen::ThreadNum; i++) {
    246244        pthreadsPtrs.push_back(iBuilder->CreateGEP(pthreads, {iBuilder->getInt32(0), iBuilder->getInt32(i)}));
    247245    }
     
    266264    std::vector<Function *> thread_functions;
    267265    const auto ip = iBuilder->saveIP();
    268     for (unsigned i = 0; i < threadNum; i++) {
     266    for (unsigned i = 0; i < codegen::ThreadNum; i++) {
    269267        thread_functions.push_back(generateSegmentParallelPipelineThreadFunction("thread"+std::to_string(i), iBuilder, kernels, sharedStructType, producerTable, i));
    270268    }
    271269    iBuilder->restoreIP(ip);
    272270   
    273     for (unsigned i = 0; i < threadNum; i++) {
     271    for (unsigned i = 0; i < codegen::ThreadNum; i++) {
    274272        iBuilder->CreatePThreadCreateCall(pthreadsPtrs[i], nullVal, thread_functions[i], iBuilder->CreateBitCast(sharedStruct, int8PtrTy));
    275273    }
    276274   
    277275    std::vector<Value *> threadIDs;
    278     for (unsigned i = 0; i < threadNum; i++) {
     276    for (unsigned i = 0; i < codegen::ThreadNum; i++) {
    279277        threadIDs.push_back(iBuilder->CreateLoad(pthreadsPtrs[i]));
    280278    }
    281279   
    282     for (unsigned i = 0; i < threadNum; i++) {
     280    for (unsigned i = 0; i < codegen::ThreadNum; i++) {
    283281        iBuilder->CreatePThreadJoinCall(threadIDs[i], status);
    284282    }
Note: See TracChangeset for help on using the changeset viewer.