source: icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.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: 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                  {StreamSetBinding{StreamSetType(8, 1), "basisBits"}},
24                  {StreamSetBinding{StreamSetType(1, 8), "byteStream"}},
25                  {}, {}, {}) {}
26   
27private:
28    void generateDoBlockMethod() override;
29   
30};
31
32class p2sKernel_withCompressedOutput : public KernelBuilder {
33public:
34    p2sKernel_withCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
35    KernelBuilder(iBuilder, "p2s_compress",
36                  {StreamSetBinding{StreamSetType(8, 1), "basisBits"}, StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
37                  {StreamSetBinding{StreamSetType(1, 8), "byteStream"}},
38                  {}, {}, {}) {}
39   
40private:
41    void prepareKernel() override;
42    void generateDoBlockMethod() override;
43};
44   
45
46class p2s_16Kernel : public KernelBuilder {
47public:
48    p2s_16Kernel(IDISA::IDISA_Builder * iBuilder) :
49    KernelBuilder(iBuilder, "p2s_16",
50                  {StreamSetBinding{StreamSetType(16, 1), "basisBits"}},
51                  {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
52                  {}, {}, {}) {}
53   
54private:
55    void generateDoBlockMethod() override;
56   
57};
58
59   
60class p2s_16Kernel_withCompressedOutput : public KernelBuilder {
61public:
62    p2s_16Kernel_withCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
63    KernelBuilder(iBuilder, "p2s_16_compress",
64                  {StreamSetBinding{StreamSetType(16, 1), "basisBits"}, StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
65                  {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
66                  {},
67                  {},
68                  {ScalarBinding{iBuilder->getSizeTy(), "unitsGenerated"}, ScalarBinding{iBuilder->getSizeTy(), "unitsWritten"}}) {}
69       
70private:
71    void prepareKernel() override;
72    void generateDoBlockMethod() override;
73    void generateFinalBlockMethod() override;
74};
75   
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.