-
Notifications
You must be signed in to change notification settings - Fork 6
/
stencil.hh
58 lines (33 loc) · 1.56 KB
/
stencil.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "ir_rose.hh"
#include "ir_chill.hh"
#include "chill_ast.hh"
//#include <omega.h>
#include <omegatools.hh>
#include "code_gen/CG_chillRepr.h"
// #include "loop.hh"
#include "ir_code.hh"
#include "ir_rose.hh"
#include <ir_chill.hh> // ??
// *extern Loop *myloop; // ???
//void stencil( chillAST_node *topstatement, class stencilInfo &SI ); // stencilInfo was originally a struct, and this was the way it got filled in. TODO remove
class stencilInfo {
public:
uint dimensions; // number of dimensions in the stencil
uint elements; // total number of elements in the stencil
chillAST_VarDecl* srcArrayVariable; // the variable of the source array
chillAST_VarDecl* dstArrayVariable; // the variable of the destination array
int minOffset[3]; // the minimum offset for each dimension NOTE hardcoded to 3 dimensions TODO
int maxOffset[3]; // the maximum offset for each dimension
chillAST_VarDecl* indexVariables[3]; // the variable used for indexing each dimension
vector< vector< int > > offsets; // k+1, j-47, i+0 etc
vector < vector<chillAST_node*> > coefficients; // the coefficients of for each element, NOT IN ANY SET ORDER
chillAST_node* find_coefficient( int i, int j, int k ) ; // hardcoded 3 dimensions TODO
// constructors
stencilInfo();
stencilInfo( chillAST_node *topstatement ) ;
void walktree( chillAST_node *node, vector< chillAST_node * > &coeffstohere );
void print( FILE *fp=stdout );
int radius();
bool isSymmetric();
}; // class stencilInfo