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

Last change on this file since 6184 was 6184, checked in by nmedfort, 7 months ago

Initial version of PipelineKernel? + revised StreamSet? model.

File size: 3.0 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 <cc/alphabet.h>
9#include "kernel.h"  // for KernelBuilder
10
11namespace IDISA { class IDISA_Builder; }
12
13namespace kernel {
14
15class P2SKernel final : public BlockOrientedKernel {
16public:
17    P2SKernel(const std::unique_ptr<kernel::KernelBuilder> &,
18              StreamSet * basisBits,
19              StreamSet * byteStream,
20              cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
21
22    bool isCachable() const override { return true; }
23    bool hasSignature() const override { return false; }
24private:
25    const cc::BitNumbering mBasisSetNumbering;
26    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
27};
28
29
30class P2SMultipleStreamsKernel final : public BlockOrientedKernel {
31public:
32    P2SMultipleStreamsKernel(const std::unique_ptr<kernel::KernelBuilder> & b,
33                             const StreamSets & inputStreams,
34                             StreamSet * const outputStream,
35                             cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
36protected:
37    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
38private:
39    const cc::BitNumbering mBasisSetNumbering;
40};
41
42class P2SKernelWithCompressedOutput final : public BlockOrientedKernel {
43public:
44    P2SKernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
45    bool isCachable() const override { return true; }
46    bool hasSignature() const override { return false; }
47private:
48    const cc::BitNumbering mBasisSetNumbering;
49    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
50};
51
52class P2S16Kernel final : public BlockOrientedKernel {
53public:
54    P2S16Kernel(const std::unique_ptr<kernel::KernelBuilder> &, StreamSet * u16bits, StreamSet * u16bytes, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
55    bool isCachable() const override { return true; }
56    bool hasSignature() const override { return false; }
57private:
58    const cc::BitNumbering mBasisSetNumbering;
59    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
60};
61   
62class P2S16KernelWithCompressedOutput final : public BlockOrientedKernel {
63public:
64    P2S16KernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> &,
65                                    StreamSet * basisBits, StreamSet * fieldCounts, StreamSet * i16Stream,
66                                    cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
67    bool isCachable() const override { return true; }
68    bool hasSignature() const override { return false; }
69private:
70    const cc::BitNumbering mBasisSetNumbering;
71    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
72};
73   
74}
75
76#endif
Note: See TracBrowser for help on using the repository browser.