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

Last change on this file since 6135 was 6135, checked in by xwa163, 9 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
RevLine 
[4939]1/*
[6089]2 *  Copyright (c) 2018 International Characters.
[4939]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
[5260]8#include "kernel.h"  // for KernelBuilder
[6089]9#include <cc/alphabet.h>
[5822]10#include <pablo/pablo_kernel.h>
[6026]11#include <string>
[5822]12
[5260]13namespace IDISA { class IDISA_Builder; }  // lines 14-14
14namespace llvm { class Value; }
[5837]15
[4974]16namespace kernel {
[6002]17
18class S2PKernel final : public MultiBlockKernel {
[5689]19public:
[6132]20    S2PKernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian, bool aligned = true, std::string prefix = "", unsigned numOfStreams = 8);
[5431]21    bool isCachable() const override { return true; }
[5464]22    bool hasSignature() const override { return false; }
[5392]23protected:
[6001]24    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, llvm::Value * const numOfStrides) override;
[5422]25private:
[6089]26    cc::BitNumbering mBasisSetNumbering;
[5422]27    bool mAligned;
[6132]28    unsigned mNumOfStreams;
[5063]29};
[5051]30
[6069]31class S2P_21Kernel final : public MultiBlockKernel {
32public:
[6089]33    S2P_21Kernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
[6069]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;
[6089]38    cc::BitNumbering mBasisSetNumbering;
[6069]39};
40
[5822]41class S2P_PabloKernel final : public pablo::PabloKernel {
42public:
[6089]43    S2P_PabloKernel(const std::unique_ptr<KernelBuilder> & b, unsigned codeUnitWidth = 8, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
[5822]44    bool isCachable() const override { return true; }
45    bool hasSignature() const override { return false; }
46protected:
47    void generatePabloMethod() override;
48    unsigned mCodeUnitWidth;
[6089]49    cc::BitNumbering mBasisSetNumbering;
[5822]50};
51
[6060]52
[4974]53}
[4939]54#endif
Note: See TracBrowser for help on using the repository browser.