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
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
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; }
15
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);
18    typedef void (*GrepFunctionType_CPU)(char * rslt, char * LineBreak, char * byte_data, size_t filesize, const int fileIdx);
19class GrepEngine {
20public:
21
22    GrepEngine();
23
24    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal, const bool usingStdIn = false);
25
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);
27     
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);
31   
32    re::CC *  grepCodepoints();
33
34    const std::vector<std::string> & grepPropertyValues(const std::string & propertyName);
35   
36private:
37   
38    GrepFunctionType mGrepFunction;
39    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
40#ifdef CUDA_ENABLED
41    GrepFunctionType_CPU mGrepFunction_CPU;
42#endif
43};
44
45
46re::CC * getParsedCodePointSet();
47void setParsedCodePointSet();
48
49void setParsedPropertyValues();
50
51void initFileResult(std::vector<std::string> filenames);
52void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
53
54#endif
Note: See TracBrowser for help on using the repository browser.