source: icGREP/icgrep-devel/icgrep/kernels/deletion.h @ 5266

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

Changes working towards simplifying accessing stream elements + some modifications to simplify include / forward declarations within the CodeGen? library.

File size: 1.1 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#ifndef DELETION_H
6#define DELETION_H
7
8#include "streamset.h"
9#include "interface.h"
10#include "kernel.h"
11
12
13namespace llvm { class Module; class Value;}
14
15namespace IDISA { class IDISA_Builder; }
16
17//
18// Parallel Prefix Deletion
19// see Parallel Prefix Compress in Henry S. Warren, Hacker's Delight, Chapter 7
20//
21// Given that we want to delete bits within fields of width fw, moving
22// nondeleted bits to the right, the parallel prefix compress method can
23// be applied.   This requires a preprocessing step to compute log2(fw)
24// masks that can be used to select bits to be moved in each step of the
25// algorithm.
26//
27
28using namespace parabix;
29
30namespace kernel {
31
32class DeletionKernel : public kernel::KernelBuilder {
33public:
34
35    DeletionKernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount);
36   
37protected:
38
39    void generateDoBlockMethod() const override;
40
41    void generateFinalBlockMethod() const override;
42
43private:
44    unsigned mDeletionFieldWidth;
45    unsigned mStreamCount;
46};
47
48}
49   
50#endif
51
Note: See TracBrowser for help on using the repository browser.