source: icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h @ 5124

Last change on this file since 5124 was 5102, checked in by cameron, 3 years ago

Kernel system restructuring progress

File size: 2.0 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
6#ifndef PABLO_KERNEL_H
7#define PABLO_KERNEL_H
8
9#include <kernels/kernel.h>
10#include <IDISA/idisa_builder.h>
11#include <pablo/function.h>
12
13namespace pablo {
14   
15class PabloCompiler; class CarryManager;
16
17
18class PabloKernel : public kernel::KernelBuilder {
19public:
20    PabloKernel(IDISA::IDISA_Builder * builder,
21                    std::string kernelName,
22                    PabloFunction * function,
23                    parabix::StreamSetBuffer & inputBuffer,
24                    parabix::StreamSetBuffer & outputBuffer,
25                    std::vector<std::string> accumulators);
26    // At present only population count accumulator are supported,
27    // using the pablo.Count operation.
28   
29    PabloKernel(IDISA::IDISA_Builder * builder,
30                    std::string kernelName,
31                    PabloFunction * function,
32                    parabix::StreamSetBuffer & inputBuffer,
33                    std::vector<std::string> accumulators);
34    // At present only population count accumulator are supported,
35    // using the pablo.Count operation.
36   
37protected:
38    // A custom method for preparing kernel declarations is needed,
39    // so that the carry data requirements may be accommodated before
40    // finalizing the KernelStateType.
41    void prepareKernel() override;
42
43    void generateDoBlockMethod() override;
44   
45    // The default method for Pablo final block processing sets the
46    // EOFmark bit and then calls the standard DoBlock function.
47    // This may be overridden for specialized processing.
48    virtual void generateFinalBlockMethod() override;
49   
50    PabloFunction * mPabloFunction;
51
52    std::vector<ScalarBinding> accumBindings(std::vector<std::string> accum_names);
53   
54    //std::unique_ptr<pablo::PabloCompiler> pablo_compiler;
55    PabloCompiler * pablo_compiler;
56
57    friend class PabloCompiler;
58    friend class CarryManager;
59};
60}
61#endif // PABLO_KERNEL_H
Note: See TracBrowser for help on using the repository browser.