Ignore:
Timestamp:
Jun 2, 2017, 7:14:05 AM (2 years ago)
Author:
cameron
Message:

Update popcount kernel to new Pablo interface

File:
1 edited

Legend:

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

    r5489 r5491  
    1515#include <kernels/linebreak_kernel.h>
    1616#include <kernels/streams_merge.h>
    17 #include <kernels/match_count.h>
    1817#include <kernels/source_kernel.h>
    1918#include <kernels/s2p_kernel.h>
     
    367366    }
    368367
    369     kernel::MatchCount matchCountK(idb);
    370     mGrepDriver->addKernelCall(matchCountK, {MergedResults}, {});
     368    kernel::Kernel * matchCountK = mGrepDriver->addKernelInstance(make_unique<kernel::PopcountKernel>(idb));
     369    mGrepDriver->makeKernelCall(matchCountK, {MergedResults}, {});
    371370    mGrepDriver->generatePipelineIR();
    372 
    373     idb->setKernel(&matchCountK);
    374     Value * matchedLineCount = idb->getScalarField("matchedLineCount");
     371    idb->setKernel(matchCountK);
     372    Value * matchedLineCount = idb->getAccumulator("countResult");
    375373    matchedLineCount = idb->CreateZExt(matchedLineCount, int64Ty);
    376374   
     
    472470        idb->CreateRet(idb->getInt64(0));
    473471    } else {
    474         kernel::Kernel * matchCountK = mGrepDriver->addKernelInstance(make_unique<kernel::MatchCount>(idb));
     472        kernel::Kernel * matchCountK = mGrepDriver->addKernelInstance(make_unique<kernel::PopcountKernel>(idb));
    475473        mGrepDriver->makeKernelCall(matchCountK, {MergedResults}, {});
    476474        mGrepDriver->generatePipelineIR();
    477475        idb->setKernel(matchCountK);
    478         Value * matchedLineCount = idb->getScalarField("matchedLineCount");
     476        Value * matchedLineCount = idb->getAccumulator("countResult");
    479477        matchedLineCount = idb->CreateZExt(matchedLineCount, int64Ty);
    480478        idb->CreateRet(matchedLineCount);
Note: See TracChangeset for help on using the changeset viewer.