Ignore:
Timestamp:
Jan 1, 2018, 8:17:29 AM (15 months ago)
Author:
cameron
Message:

Bug fix for multiplexed alphabet mode

File:
1 edited

Legend:

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

    r5816 r5819  
    1919#include <cc/cc_compiler.h>         // for CC_Compiler
    2020#include <cc/alphabet.h>
     21#include <cc/multiplex_CCs.h>
    2122#include <re/re_compiler.h>
    2223#include <llvm/Support/raw_ostream.h>
     
    176177}
    177178
    178 inline static unsigned ceil_log2(const unsigned v) {
    179     assert ("log2(0) is undefined!" && v != 0);
    180     return (sizeof(unsigned) * CHAR_BIT) - __builtin_clz(v - 1U);
    181 }
    182 
    183179// Helper to compute stream set inputs to pass into PabloKernel constructor.
    184180std::vector<Binding> icGrepInputs(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, std::vector<cc::Alphabet *> alphabets) {
     
    188184        Binding{iBuilder->getStreamSetTy(3, 1), "required"}};
    189185    for (unsigned i = 0; i < alphabets.size(); i++) {
    190         unsigned basis_size = ceil_log2(alphabets[i]->getSize());
    191         streamSetInputs.push_back(Binding{iBuilder->getStreamSetTy(basis_size, 1), "basisSet" + std::to_string(i)});
     186        unsigned basis_size = cast<cc::MultiplexedAlphabet>(alphabets[i])->getMultiplexedCCs().size();
     187        streamSetInputs.push_back(Binding{iBuilder->getStreamSetTy(basis_size, 1), alphabets[i]->getName() + "_basis"});
    192188    }
    193189    return streamSetInputs;
     
    213209    RE_Compiler re_compiler(this, cc_compiler);
    214210    for (unsigned i = 0; i < mAlphabets.size(); i++) {
    215         auto basis = getInputStreamVar("basisSet" + std::to_string(i));
     211        auto basis = getInputStreamVar(mAlphabets[i]->getName() + "_basis");
    216212        re_compiler.addAlphabet(mAlphabets[i], basis);
    217213    }
Note: See TracChangeset for help on using the changeset viewer.