source: icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.h @ 5260

Last change on this file since 5260 was 5260, checked in by nmedfort, 9 months ago

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

File size: 2.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 P2S_KERNEL_H
6#define P2S_KERNEL_H
7
8#include "streamset.h"
9#include "interface.h"
10#include "kernel.h"
11
12namespace llvm { class Module; }
13
14namespace IDISA { class IDISA_Builder; }
15
16namespace kernel {
17
18   
19class P2SKernel : public KernelBuilder {
20public:
21    P2SKernel(IDISA::IDISA_Builder * iBuilder) :
22    KernelBuilder(iBuilder, "p2s",
23                  {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}},
24                  {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
25                  {}, {}, {}) {}
26   
27private:
28    void generateDoBlockMethod() const override;
29   
30};
31
32class P2SKernelWithCompressedOutput : public KernelBuilder {
33public:
34    P2SKernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
35    KernelBuilder(iBuilder, "p2s_compress",
36                  {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
37                  {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
38                  {}, {}, {}) {}
39   
40private:
41    void generateDoBlockMethod() const override;
42};
43   
44
45class P2S16Kernel : public KernelBuilder {
46public:
47    P2S16Kernel(IDISA::IDISA_Builder * iBuilder) :
48    KernelBuilder(iBuilder, "p2s_16",
49                  {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}},
50                  {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
51                  {}, {}, {}) {}
52   
53private:
54    void generateDoBlockMethod() const override;
55   
56};
57
58   
59class P2S16KernelWithCompressedOutput : public KernelBuilder {
60public:
61    P2S16KernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
62    KernelBuilder(iBuilder, "p2s_16_compress",
63                  {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
64                  {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
65                  {},
66                  {},
67                  {Binding{iBuilder->getSizeTy(), "unitsGenerated"}, Binding{iBuilder->getSizeTy(), "unitsWritten"}}) {}
68       
69private:
70    void generateDoBlockMethod() const override;
71    void generateFinalBlockMethod() const override;
72};
73   
74}
75
76#endif
Note: See TracBrowser for help on using the repository browser.