source: icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h @ 5055

Last change on this file since 5055 was 5055, checked in by cameron, 3 years ago

scanmatch kernel using new infrastructure

File size: 1.5 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 */
5#ifndef SCANMATCHGEN_H
6#define SCANMATCHGEN_H
7
8#include "streamset.h"
9#include "interface.h"
10
11namespace llvm { class Module; class Function;}
12
13namespace IDISA { class IDISA_Builder; }
14
15namespace kernel {
16
17class KernelBuilder;
18
19void generateScanMatch(llvm::Module * m, IDISA::IDISA_Builder * iBuilder, unsigned scanWordBitWidth, KernelBuilder * kBuilder, bool isNameExpression);
20
21   
22   
23class scanMatchKernel : public KernelInterface {
24public:
25    scanMatchKernel(IDISA::IDISA_Builder * iBuilder, unsigned scanwordBitWidth, bool isNameExpression) :
26    KernelInterface(iBuilder, "scanMatch",
27                    {StreamSetBinding{StreamSetType(2, 1), "matchResults"}}, 
28                    {}, 
29                    {ScalarBinding{iBuilder->getInt8PtrTy(), "FileBuf"}, ScalarBinding{iBuilder->getInt64Ty(), "FileSize"}, ScalarBinding{iBuilder->getInt64Ty(), "FileIdx"}}, 
30                    {}, 
31                    {ScalarBinding{iBuilder->getInt64Ty(), "BlockNo"}, ScalarBinding{iBuilder->getInt64Ty(), "LineStart"}, ScalarBinding{iBuilder->getInt64Ty(), "LineNum"}}),
32
33    mScanwordBitWidth(scanwordBitWidth),
34    mIsNameExpression(isNameExpression) {}
35       
36    std::unique_ptr<llvm::Module> createKernelModule() override;
37
38private:
39    llvm::Function * generateScanWordRoutine(llvm::Module * m);
40       
41    unsigned mScanwordBitWidth;
42    bool mIsNameExpression;
43};
44}
45
46#endif // SCANMATCHGEN_H
Note: See TracBrowser for help on using the repository browser.