source: icGREP/icgrep-devel/icgrep/kernels/symboltablepipeline.h @ 5000

Last change on this file since 5000 was 5000, checked in by nmedfort, 3 years ago

Redesigned buffer system to allow the pipeline to control selection of the current input and output streams; DoBlock? functions containing lookahead now take multiple input stream arguments. Selection and passing occurs automatically. Some work on Symbol Table.

File size: 1.8 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
6#ifndef SYMBOLTABLEPIPELINE_H
7#define SYMBOLTABLEPIPELINE_H
8
9#include <IDISA/idisa_builder.h>
10#include "kernel.h"
11
12namespace llvm {
13    class Module;
14    class Function;
15    class Type;
16}
17
18namespace pablo { class PabloFunction; class PabloBlock; }
19
20namespace kernel {
21
22class SymbolTableBuilder {
23public:
24    SymbolTableBuilder(llvm::Module * m, IDISA::IDISA_Builder * b);
25    ~SymbolTableBuilder();
26    void createKernels();
27    llvm::Function * ExecuteKernels();
28
29protected:
30
31    pablo::PabloFunction * generateLeadingFunction(const std::vector<unsigned> & endpoints);
32    pablo::PabloFunction * generateSortingFunction(const pablo::PabloFunction * const leading, const std::vector<unsigned> & endpoints);
33
34    void generateGatherKernel(KernelBuilder * kBuilder, const std::vector<unsigned> & endpoints, const unsigned scanWordBitWidth = 64);
35    Function * generateGatherFunction(const unsigned minKeyLength, const unsigned maxKeyLength, Type * const resultType);
36
37    Value * generateMaskedGather(Value * const base, Value * const vindex, Value * const mask);
38
39private:
40    llvm::Module *                      mMod;
41    IDISA::IDISA_Builder *              iBuilder;
42    KernelBuilder *                     mS2PKernel;
43    KernelBuilder *                     mLeadingKernel;
44    KernelBuilder *                     mSortingKernel;
45    KernelBuilder *                     mGatherKernel;
46    KernelBuilder *                     mStdOutKernel;
47
48    unsigned                            mLongestLookahead;
49
50    std::vector<Function *>             mGatherFunction;
51
52    llvm::Type *                        mBitBlockType;
53    int                                 mBlockSize;
54};
55
56}
57
58#endif // SYMBOLTABLEPIPELINE_H
Note: See TracBrowser for help on using the repository browser.