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

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

Defer binding of buffers to stream sets until kernel generation

File size: 1.4 KB
RevLine 
[4907]1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
[4959]5#ifndef SCANMATCHGEN_H
6#define SCANMATCHGEN_H
[4907]7
[5055]8#include "streamset.h"
[5063]9#include "kernel.h"
[5106]10#include <llvm/Support/Host.h>
11#include <llvm/ADT/Triple.h>
[4907]12
[5055]13namespace llvm { class Module; class Function;}
14
[4959]15namespace IDISA { class IDISA_Builder; }
[4939]16
[4974]17namespace kernel {
[5055]18   
[5063]19class scanMatchKernel : public KernelBuilder {
[5055]20public:
[5133]21    scanMatchKernel(IDISA::IDISA_Builder * iBuilder, bool isNameExpression) :
[5063]22    KernelBuilder(iBuilder, "scanMatch",
[5133]23                  {StreamSetBinding{parabix::StreamSetType(2, parabix::i1), "matchResults"}}, 
[5055]24                    {}, 
[5106]25                    {ScalarBinding{iBuilder->getInt8PtrTy(), "FileBuf"}, ScalarBinding{iBuilder->getSizeTy(), "FileSize"}, ScalarBinding{iBuilder->getSizeTy(), "FileIdx"}}, 
[5055]26                    {}, 
[5106]27                    {ScalarBinding{iBuilder->getSizeTy(), "BlockNo"}, ScalarBinding{iBuilder->getSizeTy(), "LineStart"}, ScalarBinding{iBuilder->getSizeTy(), "LineNum"}}),
[5055]28
[5106]29    mScanwordBitWidth(Triple(llvm::sys::getProcessTriple()).isArch32Bit() ? 32 : 64),
[5055]30    mIsNameExpression(isNameExpression) {}
31       
32private:
[5074]33    void generateDoBlockMethod() override;
[5055]34    llvm::Function * generateScanWordRoutine(llvm::Module * m);
35       
36    unsigned mScanwordBitWidth;
37    bool mIsNameExpression;
38};
[4974]39}
40
[4907]41#endif // SCANMATCHGEN_H
Note: See TracBrowser for help on using the repository browser.