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

Last change on this file since 6135 was 6135, checked in by xwa163, 8 months ago
  1. Implement twist_kernel and untwist_kernel by PEXT and PDEP
  2. Use twist form for multiplexing lz4 grep
File size: 1.9 KB
Line 
1/*
2 *  Copyright (c) 2018 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef S2P_KERNEL_H
6#define S2P_KERNEL_H
7
8#include "kernel.h"  // for KernelBuilder
9#include <cc/alphabet.h>
10#include <pablo/pablo_kernel.h>
11#include <string>
12
13namespace IDISA { class IDISA_Builder; }  // lines 14-14
14namespace llvm { class Value; }
15
16namespace kernel {
17
18class S2PKernel final : public MultiBlockKernel {
19public:
20    S2PKernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian, bool aligned = true, std::string prefix = "", unsigned numOfStreams = 8);
21    bool isCachable() const override { return true; }
22    bool hasSignature() const override { return false; }
23protected:
24    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, llvm::Value * const numOfStrides) override;
25private:
26    cc::BitNumbering mBasisSetNumbering;
27    bool mAligned;
28    unsigned mNumOfStreams;
29};
30
31class S2P_21Kernel final : public MultiBlockKernel {
32public:
33    S2P_21Kernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
34    bool isCachable() const override { return true; }
35    bool hasSignature() const override { return false; }
36protected:
37    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, llvm::Value * const numOfStrides) override;
38    cc::BitNumbering mBasisSetNumbering;
39};
40
41class S2P_PabloKernel final : public pablo::PabloKernel {
42public:
43    S2P_PabloKernel(const std::unique_ptr<KernelBuilder> & b, unsigned codeUnitWidth = 8, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
44    bool isCachable() const override { return true; }
45    bool hasSignature() const override { return false; }
46protected:
47    void generatePabloMethod() override;
48    unsigned mCodeUnitWidth;
49    cc::BitNumbering mBasisSetNumbering;
50};
51
52
53}
54#endif
Note: See TracBrowser for help on using the repository browser.