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

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

Work on OptimizationBranch?; revisited pipeline termination

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