Ignore:
Timestamp:
May 17, 2018, 3:41:00 PM (15 months ago)
Author:
nmedfort
Message:

Major refactoring of buffer types. Static buffers replace Circular and CircularCopyback?. External buffers unify Source/External?.

File:
1 edited

Legend:

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

    r6008 r6047  
    257257    idb->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry", main,0));
    258258
    259     auto ChStream = pxDriver.addBuffer<SourceBuffer>(idb, idb->getStreamSetTy(4));
     259    auto ChStream = pxDriver.addBuffer<ExternalBuffer>(idb, idb->getStreamSetTy(4));
    260260    auto mmapK = pxDriver.addKernelInstance<MemorySourceKernel>(idb, 4, 1);
    261261    mmapK->setInitialArguments({inputStream, fileSize});
    262262    pxDriver.makeKernelCall(mmapK, {}, {ChStream});
    263263
    264     auto MatchResults = pxDriver.addBuffer<CircularBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
     264    auto MatchResults = pxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
    265265    auto editdk = pxDriver.addKernelInstance<PatternKernel>(idb, patterns);
    266266    pxDriver.makeKernelCall(editdk, {ChStream}, {MatchResults});
     
    327327    iBuilder->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry", main));
    328328
    329     auto ByteStream = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
     329    auto ByteStream = pxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
    330330
    331331    auto mmapK = pxDriver.addKernelInstance<MMapSourceKernel>(iBuilder);
     
    333333    pxDriver.makeKernelCall(mmapK, {}, {ByteStream});
    334334
    335     auto BasisBits = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(8), segmentSize * bufferSegments);
     335    auto BasisBits = pxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8), segmentSize * bufferSegments);
    336336    auto s2pk = pxDriver.addKernelInstance<S2PKernel>(iBuilder);
    337337    pxDriver.makeKernelCall(s2pk, {ByteStream}, {BasisBits});
     
    369369    idb->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry", main,0));
    370370
    371     auto ByteStream = pxDriver.addBuffer<SourceBuffer>(idb, idb->getStreamSetTy(1, 8));
     371    auto ByteStream = pxDriver.addBuffer<ExternalBuffer>(idb, idb->getStreamSetTy(1, 8));
    372372
    373373    auto mmapK = pxDriver.addKernelInstance<MMapSourceKernel>(idb);
     
    375375    pxDriver.makeKernelCall(mmapK, {}, {ByteStream});
    376376
    377     auto ChStream = pxDriver.addBuffer<CircularBuffer>(idb, idb->getStreamSetTy(4), segmentSize * bufferSegments);
     377    auto ChStream = pxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(4), segmentSize * bufferSegments);
    378378    auto ccck = pxDriver.addKernelInstance<kernel::DirectCharacterClassKernelBuilder>(idb, "ccc",
    379379        std::vector<re::CC *>{re::makeCC(re::makeCC(0x41), re::makeCC(0x61)),
     
    388388   
    389389    for(unsigned i = 0; i < n; ++i){
    390         auto MatchResults = pxDriver.addBuffer<CircularBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
     390        auto MatchResults = pxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
    391391        auto editdk = pxDriver.addKernelInstance<PatternKernel>(idb, pattGroups[i]);
    392392        pxDriver.makeKernelCall(editdk, {ChStream}, {MatchResults});
     
    395395    StreamSetBuffer * MergedResults = MatchResultsBufs[0];
    396396    if (n > 1) {
    397         MergedResults = pxDriver.addBuffer<CircularBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
     397        MergedResults = pxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
    398398        kernel::Kernel * streamsMergeK = pxDriver.addKernelInstance<kernel::StreamsMerge>(idb, editDistance + 1, n);
    399399        pxDriver.makeKernelCall(streamsMergeK, MatchResultsBufs, {MergedResults});
     
    436436    idb->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry", main,0));
    437437
    438     auto ChStream = pxDriver.addBuffer<SourceBuffer>(idb, idb->getStreamSetTy(4));
     438    auto ChStream = pxDriver.addBuffer<ExternalBuffer>(idb, idb->getStreamSetTy(4));
    439439    auto mmapK = pxDriver.addKernelInstance<MemorySourceKernel>(idb, 4, 1);
    440440    mmapK->setInitialArguments({inputStream, fileSize});
    441441    pxDriver.makeKernelCall(mmapK, {}, {ChStream});
    442442
    443     auto MatchResults = pxDriver.addBuffer<CircularBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
     443    auto MatchResults = pxDriver.addBuffer<StaticBuffer>(idb, idb->getStreamSetTy(editDistance + 1), segmentSize * bufferSegments);
    444444    auto editdk = pxDriver.addKernelInstance<kernel::editdCPUKernel>(idb, editDistance, patternLen, groupSize);
    445445
     
    574574    Value * inputSize = iBuilder->CreateLoad(inputSizePtr);
    575575
    576     auto CCStream = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(4), 1);
     576    auto CCStream = pxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(4), 1);
    577577    auto sourceK = pxDriver.addKernelInstance<kernel::MemorySourceKernel>(iBuilder, inputTy, segmentSize);
    578578    sourceK->setInitialArguments({inputThreadPtr, inputSize});
     
    680680    fileSize->setName("fileSize");
    681681
    682     StreamSetBuffer * MatchResults = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(editDistance + 1));
     682    StreamSetBuffer * MatchResults = pxDriver.addBuffer<ExternalBuffer>(iBuilder, iBuilder->getStreamSetTy(editDistance + 1));
    683683    kernel::Kernel * sourceK = pxDriver.addKernelInstance<kernel::MemorySourceKernel>(iBuilder, editDistance + 1, 8);
    684684    sourceK->setInitialArguments({inputStream, fileSize});
Note: See TracChangeset for help on using the changeset viewer.