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

Last change on this file since 5082 was 5076, checked in by cameron, 3 years ago

Updates for kernels with variable output length; stdout kernel

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
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                    std::vector<std::string> accumulators);
24    // At present only population count accumulator are supported,
25    // using the pablo.Count operation.
26   
27protected:
28    // A custom method for preparing kernel declarations is needed,
29    // so that the carry data requirements may be accommodated before
30    // finalizing the KernelStateType.
31    void prepareKernel() override;
32
33    void generateDoBlockMethod() override;
34   
35    // The default method for Pablo final block processing sets the
36    // EOFmark bit and then calls the standard DoBlock function.
37    // This may be overridden for specialized processing.
38    virtual void generateFinalBlockMethod() override;
39   
40    PabloFunction * mPabloFunction;
41
42    std::vector<ScalarBinding> accumBindings(std::vector<std::string> accum_names);
43   
44    //std::unique_ptr<pablo::PabloCompiler> pablo_compiler;
45    PabloCompiler * pablo_compiler;
46
47    friend class PabloCompiler;
48    friend class CarryManager;
49};
50}
51#endif // PABLO_KERNEL_H
Note: See TracBrowser for help on using the repository browser.