source: icGREP/icgrep-devel/icgrep/grep_engine.h @ 5417

Last change on this file since 5417 was 5406, checked in by cameron, 2 years ago

Progress towards adapting GPU code to ParabixDriver? framework, but need NVPTX_Driver subclass

File size: 1.9 KB
RevLine 
[4324]1/*
[4947]2 *  Copyright (c) 2016 International Characters.
[4324]3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
[5267]6#ifndef DO_GREP_H
7#define DO_GREP_H
8#include <grep_type.h>  // for GrepType, GrepType::Normal
9#include <string>       // for string
10#include <vector>
11namespace llvm { class ExecutionEngine; }
12namespace llvm { class Module; }
13namespace re { class CC; }
14namespace re { class RE; }
[4324]15
[5048]16    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
17    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
[5341]18    typedef void (*GrepFunctionType_CPU)(char * rslt, char * LineBreak, char * byte_data, size_t filesize, const int fileIdx);
[5406]19class GrepEngine {
[4659]20public:
[4324]21
[5240]22    GrepEngine();
[5401]23
[5377]24    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal, const bool usingStdIn = false);
[5398]25
[5401]26    void grepCodeGen(std::string moduleName, std::vector<re::RE *> REs, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal, const bool usingStdIn = false);
[5338]27     
[5377]28    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly);
29
30    void doGrep(const int fileIdx, bool CountOnly, std::vector<size_t> & total_CountOnly);
[4949]31   
[4947]32    re::CC *  grepCodepoints();
[5267]33
34    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
[4946]35   
[4324]36private:
[4939]37   
[4986]38    GrepFunctionType mGrepFunction;
[5025]39    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
[5400]40#ifdef CUDA_ENABLED
[5151]41    GrepFunctionType_CPU mGrepFunction_CPU;
[5400]42#endif
[4324]43};
44
45
[5033]46re::CC * getParsedCodePointSet();
47void setParsedCodePointSet();
48
[5206]49void setParsedPropertyValues();
50
[5377]51void initFileResult(std::vector<std::string> filenames);
[5107]52void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
[5033]53
[4324]54#endif
Note: See TracBrowser for help on using the repository browser.