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

Update popcount kernel to new Pablo interface

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/grep_kernel.cpp

    r5464 r5491  
    6767
    6868
     69void PopcountKernel::generatePabloMethod() {
     70    auto pb = this->getEntryBlock();
     71    const auto toCount = pb->createExtract(getInputStreamVar("toCount"), pb->getInteger(0));
     72    pablo::Var * countResult = getOutputScalarVar("countResult");
     73    pb->createAssign(countResult, pb->createCount(toCount));
     74}
     75
     76
    6977PopcountKernel::PopcountKernel (const std::unique_ptr<kernel::KernelBuilder> & iBuilder)
    7078: PabloKernel(iBuilder, "Popcount",
     
    7482              {Binding{iBuilder->getSizeTy(), "countResult"}}) {
    7583   
    76     auto pb = this->getEntryBlock();
    77     const auto toCount = pb->createExtract(getInputStreamVar("toCount"), pb->getInteger(0));
    78     pablo::Var * countResult = getOutputScalarVar("countResult");
    79     pb->createAssign(countResult, pb->createCount(toCount));
    8084}
     85
  • icGREP/icgrep-devel/icgrep/kernels/grep_kernel.h

    r5454 r5491  
    3939public:
    4040    PopcountKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
     41    bool isCachable() const override { return true; }
     42    bool hasSignature() const override { return false; }
     43protected:
     44    void generatePabloMethod() override;   
    4145};
    4246
Note: See TracChangeset for help on using the changeset viewer.