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

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

New kernel infrastructure

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