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

Last change on this file since 5418 was 5418, checked in by nmedfort, 2 years ago

Removed non-functional CUDA code from icgrep and consolidated grep and multigrep mode into a single function; allowed segment parallel pipeline to utilize process as its initial thread; modified MMapSourceKernel to map and perform mmap directly and advise the OS to drop consumed data streams.

File size: 913 bytes
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 "kernel.h"
9namespace IDISA { class IDISA_Builder; }
10
11namespace kernel {
12
13/* The MMapSourceKernel is a simple wrapper for an external MMap file buffer.
14   The doSegment method of this kernel feeds one segment at a time to a
15   pipeline. */
16   
17class MMapSourceKernel final: public SegmentOrientedKernel {
18public:
19    MMapSourceKernel(IDISA::IDISA_Builder * iBuilder, unsigned blocksPerSegment = 1, unsigned codeUnitWidth = 8); 
20    bool moduleIDisSignature() override {return true;}
21private:
22    void generateInitializeMethod() override;
23    void generateDoSegmentMethod() override;
24    void generateFinalizeMethod() override;
25private:
26    const unsigned mSegmentBlocks;
27    const unsigned mCodeUnitWidth;
28};
29
30}
31
32#endif
Note: See TracBrowser for help on using the repository browser.