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

Last change on this file since 6145 was 6145, checked in by xwa163, 3 months ago
  1. LZ4 Grep: complete utf8 character classes for multiplexing pipeline
  2. Implement multiple streams version of S2P and P2S
File size: 2.7 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> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian, std::string prefix = "", unsigned numOfStreams = 8);
18    bool isCachable() const override { return true; }
19    bool hasSignature() const override { return false; }
20private:
21    cc::BitNumbering mBasisSetNumbering;
22    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
23    unsigned mNumOfStreams;
24};
25
26
27class P2SMultipleStreamsKernel final : public BlockOrientedKernel {
28public:
29    P2SMultipleStreamsKernel(
30            const std::unique_ptr<kernel::KernelBuilder> & b,
31            cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian,
32            std::vector<unsigned> numsOfStreams = std::vector<unsigned>{8}
33    );
34private:
35    cc::BitNumbering mBasisSetNumbering;
36    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
37    std::vector<unsigned> mNumsOfStreams;
38};
39
40class P2SKernelWithCompressedOutput final : public BlockOrientedKernel {
41public:
42    P2SKernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
43    bool isCachable() const override { return true; }
44    bool hasSignature() const override { return false; }
45private:
46    cc::BitNumbering mBasisSetNumbering;
47    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
48};
49
50class P2S16Kernel final : public BlockOrientedKernel {
51public:
52    P2S16Kernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
53    bool isCachable() const override { return true; }
54    bool hasSignature() const override { return false; }
55private:
56    cc::BitNumbering mBasisSetNumbering;
57    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
58};
59   
60class P2S16KernelWithCompressedOutput final : public BlockOrientedKernel {
61public:
62    P2S16KernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
63    bool isCachable() const override { return true; }
64    bool hasSignature() const override { return false; }
65private:
66    cc::BitNumbering mBasisSetNumbering;
67    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
68};
69   
70}
71
72#endif
Note: See TracBrowser for help on using the repository browser.