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

Last change on this file since 5822 was 5822, checked in by cameron, 13 months ago

s2p written using proposed Pablo PackL and PackH operations

File size: 1.5 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 S2P_KERNEL_H
6#define S2P_KERNEL_H
7
8#include "kernel.h"  // for KernelBuilder
9
10#ifdef PABLO_PACKING
11#include <pablo/pablo_kernel.h>
12#endif
13
14namespace IDISA { class IDISA_Builder; }  // lines 14-14
15namespace llvm { class Value; }
16//#define S2P_MULTIBLOCK
17namespace kernel {
18#ifdef S2P_MULTIBLOCK
19    class S2PKernel final : public MultiBlockKernel {
20#else
21    class S2PKernel final : public BlockOrientedKernel {
22#endif
23public:
24    S2PKernel(const std::unique_ptr<kernel::KernelBuilder> & b, bool aligned = true);
25    bool isCachable() const override { return true; }
26    bool hasSignature() const override { return false; }
27protected:
28#ifdef S2P_MULTIBLOCK
29    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb) override;
30#else
31    void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
32    void generateFinalBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value * remainingBytes) override;
33#endif
34private:
35    bool mAligned;
36};
37
38#ifdef PABLO_PACKING
39
40class S2P_PabloKernel final : public pablo::PabloKernel {
41public:
42    S2P_PabloKernel(const std::unique_ptr<KernelBuilder> & b, unsigned codeUnitWidth);
43    bool isCachable() const override { return true; }
44    bool hasSignature() const override { return false; }
45protected:
46    void generatePabloMethod() override;
47    unsigned mCodeUnitWidth;
48};
49#endif
50
51}
52#endif
Note: See TracBrowser for help on using the repository browser.