Changeset 5336 for icGREP


Ignore:
Timestamp:
Feb 20, 2017, 3:17:13 PM (2 years ago)
Author:
xuedongx
Message:

add UnicodeLineBreak? kernel for icGrep

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5332 r5336  
    7676target_link_libraries (RegExpCompiler RegExpADT)
    7777
    78 add_executable(icgrep icgrep.cpp toolchain.cpp grep_engine.cpp kernels/scanmatchgen.cpp kernels/cc_kernel.cpp kernels/cc_scan_kernel.cpp)
     78add_executable(icgrep icgrep.cpp toolchain.cpp grep_engine.cpp kernels/scanmatchgen.cpp kernels/cc_kernel.cpp kernels/cc_scan_kernel.cpp kernels/unicode_linebreak_kernel.cpp)
    7979add_executable(u8u16 u8u16.cpp toolchain.cpp)
    8080add_executable(base64 base64.cpp kernels/radix64.cpp toolchain.cpp)
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5333 r5336  
    1717#include <UCD/resolve_properties.h>
    1818#include <kernels/cc_kernel.h>
     19#include <kernels/unicode_linebreak_kernel.h>
    1920#include <kernels/pipeline.h>
    2021#include <kernels/mmap_kernel.h>
     
    3637#include <util/aligned_allocator.h>
    3738
     39#define UNICODE_LINE_BREAK (!re::AlgorithmOptionIsSet(re::DisableUnicodeLineBreak))
    3840
    3941using namespace parabix;
     
    341343    LF.push_back(re::makeCC(0x0A));
    342344   
    343     kernel::ParabixCharacterClassKernelBuilder linebreakK(iBuilder, "linebreak", LF, encodingBits);
     345    kernel::UnicodeLineBreakKernelBuilder unicodelbK(iBuilder, "unicodelinebreak", encodingBits);
     346    kernel::ParabixCharacterClassKernelBuilder linefeedK(iBuilder, "linefeed", LF, encodingBits);
     347
     348    pablo::PabloKernel *linebreakK = UNICODE_LINE_BREAK ? &cast<pablo::PabloKernel>(unicodelbK) :  &cast<pablo::PabloKernel>(linefeedK);
    344349    CircularBuffer LineBreakStream(iBuilder, iBuilder->getStreamSetTy(1, 1), segmentSize * bufferSegments);
    345350    LineBreakStream.allocateBuffer();
    346     linebreakK.generateKernel({&BasisBits}, {&LineBreakStream});
    347 
     351    linebreakK->generateKernel({&BasisBits}, {&LineBreakStream});
    348352
    349353    pablo::PabloKernel icgrepK(iBuilder, "icgrep", {Binding{iBuilder->getStreamSetTy(8), "basis"}});
     
    384388            scanMatchK.generateKernel({&MatchResults, &LineBreakStream}, {});               
    385389            scanMatchK.setInitialArguments({iBuilder->CreateBitCast(inputStream, int8PtrTy), fileSize, fileIdx});
    386 
    387             if (pipelineParallel){
    388                 generatePipelineParallel(iBuilder, {&mmapK, &s2pk, &icgrepK, &linebreakK, &scanMatchK});
    389             } else if (segmentPipelineParallel){
    390                 generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &icgrepK, &linebreakK, &scanMatchK});
    391             }  else{
    392                 generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &icgrepK, &linebreakK, &scanMatchK});
    393             }
     390           
     391            if (pipelineParallel){
     392                generatePipelineParallel(iBuilder, {&mmapK, &s2pk, &icgrepK, linebreakK, &scanMatchK});
     393            } else if (segmentPipelineParallel){
     394                generateSegmentParallelPipeline(iBuilder, {&mmapK, &s2pk, &icgrepK, linebreakK, &scanMatchK});
     395            }  else{
     396                generatePipelineLoop(iBuilder, {&mmapK, &s2pk, &icgrepK, linebreakK, &scanMatchK});
     397            }
    394398        }
    395399        iBuilder->CreateRetVoid();
Note: See TracChangeset for help on using the changeset viewer.