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

Last change on this file since 6135 was 6135, checked in by xwa163, 4 months ago
  1. Implement twist_kernel and untwist_kernel by PEXT and PDEP
  2. Use twist form for multiplexing lz4 grep
File size: 2.2 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
26class P2SKernelWithCompressedOutput final : public BlockOrientedKernel {
27public:
28    P2SKernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
29    bool isCachable() const override { return true; }
30    bool hasSignature() const override { return false; }
31private:
32    cc::BitNumbering mBasisSetNumbering;
33    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
34};
35
36class P2S16Kernel final : public BlockOrientedKernel {
37public:
38    P2S16Kernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
39    bool isCachable() const override { return true; }
40    bool hasSignature() const override { return false; }
41private:
42    cc::BitNumbering mBasisSetNumbering;
43    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
44};
45   
46class P2S16KernelWithCompressedOutput final : public BlockOrientedKernel {
47public:
48    P2S16KernelWithCompressedOutput(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
49    bool isCachable() const override { return true; }
50    bool hasSignature() const override { return false; }
51private:
52    cc::BitNumbering mBasisSetNumbering;
53    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
54};
55   
56}
57
58#endif
Note: See TracBrowser for help on using the repository browser.