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

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

Kernel infrastructure: move common logic into KernelBuilder? base class; demo linking in wc

File size: 1.5 KB
RevLine 
[5057]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
[5062]9#include <kernels/kernel.h>
[5057]10#include <IDISA/idisa_builder.h>
11#include <pablo/function.h>
12
13namespace pablo {
[5062]14   
15class PabloCompiler; class CarryManager;
[5057]16
[5062]17
18class PabloKernel : public kernel::KernelBuilder {
[5057]19public:
20    PabloKernel(IDISA::IDISA_Builder * builder,
21                    std::string kernelName,
22                    PabloFunction * function,
[5059]23                    std::vector<std::string> accumulators);
[5062]24    // At present only population count accumulator are supported,
25    // using the pablo.Count operation.
26   
[5074]27protected:
[5062]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.
[5074]31    void prepareKernelStateType() override;
[5057]32
[5074]33    void generateDoBlockMethod() override;
[5057]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.
[5074]38    virtual void generateFinalBlockMethod() override;
[5059]39   
40    PabloFunction * mPabloFunction;
[5057]41
[5059]42    std::vector<ScalarBinding> accumBindings(std::vector<std::string> accum_names);
[5062]43   
44    //std::unique_ptr<pablo::PabloCompiler> pablo_compiler;
45    PabloCompiler * pablo_compiler;
[5059]46
47    friend class PabloCompiler;
[5062]48    friend class CarryManager;
[5057]49};
50}
51#endif // PABLO_KERNEL_H
Note: See TracBrowser for help on using the repository browser.