Ignore:
Timestamp:
May 6, 2017, 4:05:05 PM (2 years ago)
Author:
nmedfort
Message:

Continued refactoring work.

Location:
icGREP/icgrep-devel/icgrep/editd
Files:
7 edited

Legend:

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

    r5429 r5435  
    191191void editdPipeline(ParabixDriver & pxDriver, const std::vector<std::string> & patterns) {
    192192
    193     IDISA::IDISA_Builder * const idb = pxDriver.getIDISA_Builder();
     193    auto & idb = pxDriver.getBuilder();
    194194    Module * const m = idb->getModule();
    195195    Type * const sizeTy = idb->getSizeTy();
     
    221221        ));
    222222
     223    editdk->setBuilder(idb.get());
    223224    buildPatternKernel(reinterpret_cast<PabloKernel *>(editdk), patterns);
    224225    pxDriver.makeKernelCall(editdk, {ChStream}, {MatchResults});
     
    235236
    236237void buildPreprocessKernel(PabloKernel * const kernel) {
     238    assert (kernel->getBuilder());
    237239    cc::CC_Compiler ccc(kernel, kernel->getInputStreamVar("basis"));
    238240
     
    256258void preprocessPipeline(ParabixDriver & pxDriver) {
    257259
    258     IDISA::IDISA_Builder * iBuilder = pxDriver.getIDISA_Builder();
     260    auto & iBuilder = pxDriver.getBuilder();
    259261    Module * m = iBuilder->getModule();
    260262    Type * mBitBlockType = iBuilder->getBitBlockType();
     
    292294    ));
    293295
     296    ccck->setBuilder(iBuilder.get());
    294297    buildPreprocessKernel(reinterpret_cast<PabloKernel *>(ccck));
    295298
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.cpp

    r5356 r5435  
    8484}
    8585
    86 editdCPUKernel::editdCPUKernel(IDISA::IDISA_Builder * b, unsigned dist, unsigned pattLen) :
    87 BlockOrientedKernel(b, "editd_cpu",
     86editdCPUKernel::editdCPUKernel(const std::unique_ptr<IDISA::IDISA_Builder> & b, unsigned dist, unsigned pattLen) :
     87BlockOrientedKernel("editd_cpu",
    8888             {Binding{b->getStreamSetTy(4), "CCStream"}},
    8989             {Binding{b->getStreamSetTy(dist + 1), "ResultStream"}},
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.h

    r5347 r5435  
    1717public:
    1818
    19     editdCPUKernel(IDISA::IDISA_Builder * b, unsigned dist, unsigned pattLen);
     19    editdCPUKernel(const std::unique_ptr<IDISA::IDISA_Builder> & b, unsigned dist, unsigned pattLen);
    2020   
    2121
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.cpp

    r5356 r5435  
    1111namespace kernel {
    1212
    13 void bitblock_advance_ci_co(IDISA::IDISA_Builder * iBuilder, Value * val, unsigned shift, Value * stideCarryArr, unsigned carryIdx, std::vector<std::vector<Value *>> & adv, std::vector<std::vector<int>> & calculated, int i, int j){   
     13void bitblock_advance_ci_co(IDISA::IDISA_Builder * const iBuilder, Value * val, unsigned shift, Value * stideCarryArr, unsigned carryIdx, std::vector<std::vector<Value *>> & adv, std::vector<std::vector<int>> & calculated, int i, int j){
    1414    if (!calculated[i][j]) {
    1515        Value * ptr = iBuilder->CreateGEP(stideCarryArr, {iBuilder->getInt32(0), iBuilder->getInt32(carryIdx)});
     
    8080}
    8181
    82 editdGPUKernel::editdGPUKernel(IDISA::IDISA_Builder * b, unsigned dist, unsigned pattLen) :
    83 BlockOrientedKernel(b, "editd_gpu",
     82editdGPUKernel::editdGPUKernel(const std::unique_ptr<IDISA::IDISA_Builder> & b, unsigned dist, unsigned pattLen) :
     83BlockOrientedKernel("editd_gpu",
    8484              {Binding{b->getStreamSetTy(4), "CCStream"}},
    8585              {Binding{b->getStreamSetTy(dist + 1), "ResultStream"}},
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.h

    r5297 r5435  
    1717public:
    1818   
    19     editdGPUKernel(IDISA::IDISA_Builder * b, unsigned dist, unsigned pattLen);
     19    editdGPUKernel(const std::unique_ptr<IDISA::IDISA_Builder> & b, unsigned dist, unsigned pattLen);
    2020   
    2121   
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.cpp

    r5398 r5435  
    8787}
    8888
    89 editdScanKernel::editdScanKernel(IDISA::IDISA_Builder * iBuilder, unsigned dist) :
    90 BlockOrientedKernel(iBuilder, "scanMatch",
     89editdScanKernel::editdScanKernel(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder, unsigned dist) :
     90BlockOrientedKernel("scanMatch",
    9191              {Binding{iBuilder->getStreamSetTy(dist + 1), "matchResults"}},
    9292              {}, {}, {}, {Binding{iBuilder->getSizeTy(), "BlockNo"}}),
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.h

    r5297 r5435  
    1515class editdScanKernel : public BlockOrientedKernel {
    1616public:
    17     editdScanKernel(IDISA::IDISA_Builder * iBuilder, unsigned dist);
     17    editdScanKernel(const std::unique_ptr<IDISA::IDISA_Builder> & iBuilder, unsigned dist);
    1818       
    1919private:
Note: See TracChangeset for help on using the changeset viewer.