Ignore:
Timestamp:
Jan 10, 2017, 5:43:35 PM (2 years ago)
Author:
cameron
Message:

Add mmap kernel to all pipelines

File:
1 edited

Legend:

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

    r5244 r5254  
    3232#include <kernels/interface.h>
    3333#include <kernels/kernel.h>
     34#include <kernels/mmap_kernel.h>
    3435#include <kernels/s2p_kernel.h>
    3536#include <editd/editdscan_kernel.h>
     
    287288    Type * mBitBlockType = iBuilder->getBitBlockType();
    288289   
    289     ExternalFileBuffer ByteStream(iBuilder, iBuilder->getStreamSetTy(1, 8));
    290     SingleBlockBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8));
    291     ExternalFileBuffer CCResults(iBuilder, iBuilder->getStreamSetTy(4));
    292 
    293     S2PKernel  s2pk(iBuilder);
    294     std::unique_ptr<Module> s2pM = s2pk.createKernelModule({&ByteStream}, {&BasisBits});
    295 
    296     PabloKernel  ccck(iBuilder, "ccc");
    297 
    298     buildPreprocessKernel(ccck, iBuilder);
    299    
    300     std::unique_ptr<Module> cccM = ccck.createKernelModule({&BasisBits}, {&CCResults});
    301    
    302     s2pk.addKernelDeclarations(mMod);
    303     ccck.addKernelDeclarations(mMod);
    304 
    305290    Type * const size_ty = iBuilder->getSizeTy();
    306291    Type * const voidTy = iBuilder->getVoidTy();
     
    319304    outputStream->setName("output");
    320305   
     306    ExternalFileBuffer ByteStream(iBuilder, iBuilder->getStreamSetTy(1, 8));
     307    SingleBlockBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8));
     308    ExternalFileBuffer CCResults(iBuilder, iBuilder->getStreamSetTy(4));
     309
     310    MMapSourceKernel mmapK(iBuilder, iBuilder->getStride());
     311    std::unique_ptr<Module> mmapM = mmapK.createKernelModule({}, {&ByteStream});
     312    mmapK.setInitialArguments({fileSize});
     313   
     314    S2PKernel  s2pk(iBuilder);
     315    std::unique_ptr<Module> s2pM = s2pk.createKernelModule({&ByteStream}, {&BasisBits});
     316
     317    PabloKernel  ccck(iBuilder, "ccc");
     318
     319    buildPreprocessKernel(ccck, iBuilder);
     320   
     321    std::unique_ptr<Module> cccM = ccck.createKernelModule({&BasisBits}, {&CCResults});
     322   
     323    mmapK.addKernelDeclarations(mMod);
     324    s2pk.addKernelDeclarations(mMod);
     325    ccck.addKernelDeclarations(mMod);
     326   
    321327    iBuilder->SetInsertPoint(BasicBlock::Create(mMod->getContext(), "entry", main,0));
    322328
     
    325331    CCResults.setStreamSetBuffer(outputStream, fileSize);
    326332   
    327     generatePipelineLoop(iBuilder, {&s2pk, &ccck});
     333    generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &ccck});
    328334       
    329335    iBuilder->CreateRetVoid();
    330336   
    331337    Linker L(*mMod);
     338    L.linkInModule(std::move(mmapM));
    332339    L.linkInModule(std::move(s2pM));
    333340    L.linkInModule(std::move(cccM));
Note: See TracChangeset for help on using the changeset viewer.