Changeset 6126


Ignore:
Timestamp:
Jul 7, 2018, 4:40:37 PM (8 days ago)
Author:
cameron
Message:

Big-endian numbering option for CharClasses? kernel

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

Legend:

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

    r6125 r6126  
    5252}
    5353
    54 CharClassesSignature::CharClassesSignature(const std::vector<CC *> &ccs, bool useDirectCC)
    55 : mUseDirectCC(useDirectCC), mSignature((useDirectCC ? "d" : "p") + signature(ccs)) {
     54CharClassesSignature::CharClassesSignature(const std::vector<CC *> &ccs, bool useDirectCC, cc::BitNumbering bn)
     55: mUseDirectCC(useDirectCC),
     56  mSignature((useDirectCC ? "d" : "p") + numberingSuffix(bn) + signature(ccs)) {
    5657}
    5758
    5859
    5960CharClassesKernel::CharClassesKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, std::vector<CC *> && ccs, bool useDirectCC, cc::BitNumbering basisNumbering)
    60 : CharClassesSignature(ccs, useDirectCC)
     61: CharClassesSignature(ccs, useDirectCC, basisNumbering)
    6162, PabloKernel(iBuilder,
    6263              "cc" + sha1sum(mSignature),
     
    100101        ucdCompiler.generateWithDefaultIfHierarchy(nameMap, pb);
    101102    }
    102 
     103    if (mBasisSetNumbering == cc::BitNumbering::BigEndian) {
     104        // The first UnicodeSet in the vector ccs represents the last bit of the
     105        // character class basis bit streams.
     106        std::reverse(names.begin(), names.end());
     107    }
    103108    for (unsigned i = 0; i < names.size(); i++) {
    104109        auto t = nameMap.find(names[i]);
  • icGREP/icgrep-devel/icgrep/kernels/charclasses.h

    r6119 r6126  
    1515
    1616struct CharClassesSignature {
    17     CharClassesSignature(const std::vector<re::CC *> & ccs, bool useDirectCC);
     17    CharClassesSignature(const std::vector<re::CC *> & ccs, bool useDirectCC, cc::BitNumbering basisNumbering);
    1818protected:
    1919    const bool mUseDirectCC;
     
    3030    void generatePabloMethod() override;
    3131protected:
     32    std::vector<re::CC *> mCCs;
    3233    cc::BitNumbering mBasisSetNumbering;
    33     std::vector<re::CC *> mCCs;
    34    
     34
    3535};
    3636
Note: See TracChangeset for help on using the changeset viewer.