Ignore:
Timestamp:
Apr 9, 2017, 3:59:17 PM (2 years ago)
Author:
nmedfort
Message:

Updated all projects to use ParabixDriver?. Deprecated original pipeline generation methods. Enabled LLVM optimizations, IR and ASM printing for Kernel modules. Enabled object cache by default. Begun work on moving consumed position information back to producing kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/array-test.cpp

    r5377 r5401  
    124124}
    125125
    126 Function * pipeline(IDISA::IDISA_Builder * iBuilder, const unsigned count) {
     126void pipeline(ParabixDriver & pxDriver, const unsigned count) {
     127
     128    IDISA::IDISA_Builder * const iBuilder = pxDriver.getIDISA_Builder();
     129    Module * const mod = iBuilder->getModule();
    127130
    128131    Type * byteStreamTy = iBuilder->getStreamSetTy(1, 8);
    129 
    130     Module * const mod = iBuilder->getModule();
    131132
    132133    Function * const main = cast<Function>(mod->getOrInsertFunction("Main", iBuilder->getVoidTy(), byteStreamTy->getPointerTo(), iBuilder->getSizeTy(), nullptr));
     
    145146
    146147    MMapSourceKernel mmapK(iBuilder, segmentSize);
    147     mmapK.generateKernel({}, {&ByteStream});
    148148    mmapK.setInitialArguments({fileSize});
    149149
     150    pxDriver.addKernelCall(mmapK, {}, {&ByteStream});
     151
    150152    CircularBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8), segmentSize * bufferSegments);
    151153
    152     S2PKernel  s2pk(iBuilder);
    153     s2pk.generateKernel({&ByteStream}, {&BasisBits});
     154    S2PKernel s2pk(iBuilder);
     155    pxDriver.addKernelCall(s2pk, {&ByteStream}, {&BasisBits});
    154156
    155157    PabloKernel bm(iBuilder, "MatchParens",
     
    158160
    159161    generate(&bm);
    160 //    SSAPass::transform(&bm);
    161 
    162 //    pablo_function_passes(&bm);
    163 
    164     bm.getEntryBlock()->print(errs());
    165162
    166163    ExpandableBuffer matches(iBuilder, iBuilder->getStreamSetTy(count), segmentSize * bufferSegments);
    167164    SingleBlockBuffer errors(iBuilder, iBuilder->getStreamTy());
    168165
    169     bm.generateKernel({&BasisBits}, {&matches, &errors});
     166    pxDriver.addKernelCall(bm, {&BasisBits}, {&matches, &errors});
    170167
    171168    PrintStreamSet printer(iBuilder, {"matches", "errors"});
    172     printer.generateKernel({&matches, &errors}, {});
     169    pxDriver.addKernelCall(printer, {&matches, &errors}, {});
    173170
    174171    iBuilder->SetInsertPoint(BasicBlock::Create(mod->getContext(), "entry", main, 0));
     
    179176    errors.allocateBuffer();
    180177
    181 //    generatePipeline(iBuilder, {&mmapK, &s2pk, &bm});
    182 
    183     generatePipeline(iBuilder, {&mmapK, &s2pk, &bm, &printer});
     178    pxDriver.generatePipelineIR();
    184179    iBuilder->CreateRetVoid();
    185180
    186     return main;
     181    pxDriver.linkAndFinalize();
    187182}
    188183
     
    193188    Module * M = new Module("mp", ctx);
    194189    IDISA::IDISA_Builder * idb = IDISA::GetIDISA_Builder(M);
    195 
    196     llvm::Function * f = pipeline(idb, 3);
    197 
    198     verifyModule(*M, &dbgs());
    199 
    200     ExecutionEngine * wcEngine = JIT_to_ExecutionEngine(M);
    201 
    202     wcEngine->finalizeObject();
    203 
     190    ParabixDriver pxDriver(idb);
     191    pipeline(pxDriver, 3);
    204192    delete idb;
    205 
    206     return reinterpret_cast<MatchParens>(wcEngine->getPointerToFunction(f));
     193    return reinterpret_cast<MatchParens>(pxDriver.getPointerToMain());
    207194}
    208195
Note: See TracChangeset for help on using the changeset viewer.