Ignore:
Timestamp:
Nov 18, 2016, 1:46:55 PM (2 years ago)
Author:
nmedfort
Message:

Merged PabloFunction? and PabloKernel? classes. Updated projects where necessary.

File:
1 edited

Legend:

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

    r5207 r5217  
    3434#include <kernels/pipeline.h>
    3535
    36 #include <pablo/function.h>
     36#include <pablo/prototype.h>
    3737#include <pablo/pablo_kernel.h>
    3838#include <pablo/pablo_toolchain.h>
     
    217217    fileIdx->setName("fileIdx");
    218218
    219     ExternalFileBuffer MatchResults(iBuilder, StreamSetType(iBuilder, 2, 1));
     219    ExternalFileBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy( 2, 1));
    220220    MatchResults.setStreamSetBuffer(rsltStream, fileSize);
    221221
     
    328328    }
    329329       
    330     ExternalFileBuffer ByteStream(iBuilder, StreamSetType(iBuilder, 1, 8));
    331     CircularBuffer BasisBits(iBuilder, StreamSetType(iBuilder, 8, 1), segmentSize * bufferSegments);
     330    ExternalFileBuffer ByteStream(iBuilder, iBuilder->getStreamSetTy(1, 8));
     331    CircularBuffer BasisBits(iBuilder, iBuilder->getStreamSetTy(8, 1), segmentSize * bufferSegments);
    332332
    333333    kernel::s2pKernel  s2pk(iBuilder);
    334334    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    335335   
     336    pablo::PabloKernel icgrepK(iBuilder, "icgrep");
     337
    336338    re_ast = re::regular_expression_passes(re_ast);
    337     pablo::PabloFunction * function = re::re2pablo_compiler(encodingBits, re_ast, CountOnly);
    338     pablo_function_passes(function);
     339    re::re2pablo_compiler(&icgrepK, encodingBits, re_ast, CountOnly);
     340    pablo_function_passes(&icgrepK);
     341
     342
    339343
    340344    ByteStream.setStreamSetBuffer(inputStream, fileSize);
     
    365369    pthreadExitFunc->setCallingConv(llvm::CallingConv::C);
    366370
    367     if (CountOnly) {
    368         pablo::PabloKernel icgrepK(iBuilder, "icgrep", function);
     371    if (CountOnly) {       
    369372        icgrepK.generateKernel({&BasisBits}, {});       
    370373        Value * icgrepInstance = icgrepK.createInstance({});
     
    384387#ifdef CUDA_ENABLED
    385388        if (codegen::NVPTX){
    386             ExternalFileBuffer MatchResults(iBuilder, StreamSetType(iBuilder,2, i1), addrSpace);
     389            ExternalFileBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy(2, i1), addrSpace);
    387390            MatchResults.setStreamSetBuffer(outputStream, fileSize);
    388391
    389             pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {});
    390392            icgrepK.generateKernel({&BasisBits},  {&MatchResults});
    391393            Value * icgrepInstance = icgrepK.createInstance({});
     
    396398#endif
    397399        if (CPU_Only) {
    398             CircularBuffer MatchResults(iBuilder, StreamSetType(iBuilder, 2, 1), segmentSize * bufferSegments);
     400            CircularBuffer MatchResults(iBuilder, iBuilder->getStreamSetTy( 2, 1), segmentSize * bufferSegments);
    399401            MatchResults.allocateBuffer();
    400402
    401             pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function);
    402403            icgrepK.generateKernel({&BasisBits}, {&MatchResults});
    403404            Value * icgrepInstance = icgrepK.createInstance({});
Note: See TracChangeset for help on using the changeset viewer.