Ignore:
Timestamp:
Feb 4, 2017, 9:28:54 AM (2 years ago)
Author:
cameron
Message:

getScalarOutput for Pablo kernels; use in wc

File:
1 edited

Legend:

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

    r5292 r5300  
    9090void wc_gen(PabloKernel * kernel) {
    9191    //  input: 8 basis bit streams
     92    const auto u8bitSet = kernel->getInputSet("u8bit");
    9293    //  output: 3 counters
    9394   
    94     cc::CC_Compiler ccc(kernel);
     95    cc::CC_Compiler ccc(kernel, u8bitSet);
    9596   
    9697    PabloBuilder & pb = ccc.getBuilder();
    9798
    98     Var * lc = kernel->addOutput("lineCount", kernel->getSizeTy());
    99     Var * wc = kernel->addOutput("wordCount", kernel->getSizeTy());
    100     Var * cc = kernel->addOutput("charCount", kernel->getSizeTy());
     99    Var * lc = kernel->getScalarOutput("lineCount");
     100    Var * wc = kernel->getScalarOutput("wordCount");
     101    Var * cc = kernel->getScalarOutput("charCount");
    101102
    102103    if (CountLines) {
     
    151152    S2PKernel  s2pk(iBuilder);
    152153    std::unique_ptr<Module> s2pM = s2pk.createKernelModule({&ByteStream}, {&BasisBits});
    153 
    154     PabloKernel wck(iBuilder, "wc");
     154   
     155    PabloKernel wck(iBuilder, "wc", {Binding{iBuilder->getStreamSetTy(8, 1), "u8bit"}}, {},
     156                      {Binding{iBuilder->getSizeTy(), "lineCount"}, Binding{iBuilder->getSizeTy(), "wordCount"}, Binding{iBuilder->getSizeTy(), "charCount"}});
     157
    155158    wc_gen(&wck);
    156159    pablo_function_passes(&wck);
Note: See TracChangeset for help on using the changeset viewer.