source: icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.h @ 5098

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

Updates for kernels with variable output length; stdout kernel

File size: 1009 bytes
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 STDOUT_KERNEL_H
6#define STDOUT_KERNEL_H
7
8#include "streamset.h"
9#include "kernel.h"
10#include <llvm/IR/Type.h>
11
12namespace IDISA { class IDISA_Builder; }
13
14namespace kernel {
15
16class stdOutKernel : public KernelBuilder {
17public:
18    stdOutKernel(IDISA::IDISA_Builder * iBuilder, unsigned codeUnitWidth) :
19    KernelBuilder(iBuilder, "stdout",
20                  {StreamSetBinding{StreamSetType(1, codeUnitWidth), "bufferPtr"}}, {}, {}, {}, {}) {
21        mStreamType = PointerType::get(StreamSetType(1, codeUnitWidth).getStreamSetBlockType(iBuilder), 0);
22        mScalarInputs = {ScalarBinding{mStreamType , "bufferBasePtr"}, ScalarBinding{mStreamType, "bufferFinalBlockPtr"}};
23    }
24   
25private:
26    void prepareKernel() override;
27    void generateDoBlockMethod() override;
28    void generateFinalBlockMethod() override;
29   
30    llvm::Type * mStreamType;
31};
32}
33
34#endif
Note: See TracBrowser for help on using the repository browser.