source: icGREP/icgrep-devel/icgrep/kernels/mmap_kernel.h @ 5257

Last change on this file since 5257 was 5257, checked in by cameron, 2 years ago

finalSegment kernel methods initial check-in

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef MMAP_KERNEL_H
6#define MMAP_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
16/* The MMapSourceKernel is a simple wrapper for an external MMap file buffer.
17   The doSegment method of this kernel feeds one segment at a time to a
18   pipeline. */
19   
20class MMapSourceKernel : public KernelBuilder {
21public:
22    MMapSourceKernel(IDISA::IDISA_Builder * iBuilder, unsigned blocksPerSegment = 1, unsigned codeUnitWidth = 8) :
23    KernelBuilder(iBuilder, "mmap_source",
24                  {}, {Binding{iBuilder->getStreamSetTy(1, codeUnitWidth), "sourceBuffer"}}, 
25                  {Binding{iBuilder->getSizeTy(), "fileSize"}}, {}, {}),
26    mSegmentBlocks(blocksPerSegment),
27    mCodeUnitWidth(codeUnitWidth) {}
28   
29private:
30    unsigned mSegmentBlocks;
31    unsigned mCodeUnitWidth;
32 
33    void generateDoBlockMethod() const override;
34    void generateDoSegmentMethod() const override;
35    void generateFinalSegmentMethod() const override;
36   
37};
38}
39
40#endif
Note: See TracBrowser for help on using the repository browser.