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

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

Kernel infrastructure: move common logic into KernelBuilder? base class; demo linking in wc

File size: 1.9 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
19//    void generateP2SKernel(llvm::Module *, IDISA::IDISA_Builder * iBuilder, KernelBuilder * kBuilder);
20
21//    void generateP2S_16Kernel(llvm::Module *, IDISA::IDISA_Builder * iBuilder, KernelBuilder * kBuilder);
22
23//    void generateP2S_16_withCompressedOutputKernel(llvm::Module *, IDISA::IDISA_Builder * iBuilder, KernelBuilder * kBuilder);
24   
25   
26class p2sKernel : public KernelBuilder {
27public:
28    p2sKernel(IDISA::IDISA_Builder * iBuilder) :
29    KernelBuilder(iBuilder, "p2s",
30                  {StreamSetBinding{StreamSetType(8, 1), "basisBits"}},
31                  {StreamSetBinding{StreamSetType(1, 8), "byteStream"}},
32                  {}, {}, {}) {}
33   
34private:
35    void generateDoBlockMethod() override;
36   
37};
38
39class p2s_16Kernel : public KernelBuilder {
40public:
41    p2s_16Kernel(IDISA::IDISA_Builder * iBuilder) :
42    KernelBuilder(iBuilder, "p2s_16",
43                  {StreamSetBinding{StreamSetType(16, 1), "basisBits"}},
44                  {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
45                  {}, {}, {}) {}
46   
47private:
48    void generateDoBlockMethod() override;
49   
50};
51
52   
53class p2s_16Kernel_withCompressedOutputKernel : public KernelBuilder {
54public:
55    p2s_16Kernel_withCompressedOutputKernel(IDISA::IDISA_Builder * iBuilder) :
56    KernelBuilder(iBuilder, "p2s_16_compress",
57                  {StreamSetBinding{StreamSetType(16, 1), "basisBits"}, StreamSetBinding{StreamSetType(1, 1), "deletionCounts"}},
58                  {StreamSetBinding{StreamSetType(1, 16), "i16Stream"}},
59                  {}, {}, {}) {}
60       
61private:
62    void generateDoBlockMethod() override;
63};
64   
65}
66
67#endif
Note: See TracBrowser for help on using the repository browser.