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

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

Defer binding of buffers to stream sets until kernel generation

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