Ignore:
Timestamp:
Feb 10, 2017, 1:48:34 PM (2 years ago)
Author:
nmedfort
Message:

Adjusted pablo compiler to use getInputStream and getOutputStream when accessing packed stream fields.

File:
1 edited

Legend:

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

    r5294 r5310  
    224224#endif
    225225
    226     Module * cpuM = new Module(moduleName+":cpu", getGlobalContext());
     226    Module * cpuM = new Module(moduleName + ":cpu", getGlobalContext());
    227227    IDISA::IDISA_Builder * CPUBuilder = IDISA::GetIDISA_Builder(cpuM);
    228228
     
    234234    // segment size made availabe for each call to the mmap source kernel
    235235    const unsigned segmentSize = codegen::SegmentSize;
    236     unsigned bufferSegments = codegen::BufferSegments;
    237     if (segmentPipelineParallel)
    238         {
    239             bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
    240         }
     236    const unsigned bufferSegments = segmentPipelineParallel ? (codegen::BufferSegments * codegen::ThreadNum) : codegen::BufferSegments;
    241237    const unsigned encodingBits = UTF_16 ? 16 : 8;
    242238
     
    302298    mmapK.setInitialArguments({fileSize});
    303299   
    304     CircularBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8, 1), segmentSize * bufferSegments);
     300    CircularBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8), segmentSize * bufferSegments);
    305301
    306302    kernel::S2PKernel  s2pk(iBuilder);
    307303    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    308    
    309     pablo::PabloKernel icgrepK(iBuilder, "icgrep");
    310 
    311     re_ast = re::regular_expression_passes(re_ast);
    312     re::re2pablo_compiler(&icgrepK, encodingBits, re_ast, CountOnly);
     304       
     305    pablo::PabloKernel icgrepK(iBuilder, "icgrep", {Binding{iBuilder->getStreamSetTy(8), "basis"}});
     306    re::re2pablo_compiler(&icgrepK, re::regular_expression_passes(re_ast), CountOnly);
    313307    pablo_function_passes(&icgrepK);
    314308
     
    317311
    318312    if (CountOnly) {
    319         icgrepK.generateKernel({&BasisBits}, {});       
     313        icgrepK.generateKernel({&BasisBits}, {});
    320314        if (pipelineParallel){
    321315            generatePipelineParallel(iBuilder, {&mmapK, &s2pk, &icgrepK});
     
    325319            generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &icgrepK});
    326320        }
    327 
    328         Value * matchCount = icgrepK.createGetAccumulatorCall(icgrepK.getInstance(), "matchedLineCount");
    329 
    330         iBuilder->CreateRet(matchCount);
    331 
     321        iBuilder->CreateRet(icgrepK.createGetAccumulatorCall(icgrepK.getInstance(), "matchedLineCount"));
    332322    } else {
    333323#ifdef CUDA_ENABLED
     
    342332#endif
    343333        if (CPU_Only) {
    344             CircularBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy( 2, 1), segmentSize * bufferSegments);
     334            CircularBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy(2, 1), segmentSize * bufferSegments);
    345335            MatchResults.allocateBuffer();
    346336
     
    378368    }
    379369#endif
    380    
    381      
     370
     371
    382372    mEngine = JIT_to_ExecutionEngine(cpuM);
    383373    ApplyObjectCache(mEngine);
Note: See TracChangeset for help on using the changeset viewer.