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

Last change on this file since 5941 was 5837, checked in by cameron, 16 months ago

Pablo packh/packl and transposition with -enable-pablo-s2p

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