Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
strp_tsr.h
Go to the documentation of this file.
1 /*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
2 
3 #ifndef __STRP_TSR_H__
4 #define __STRP_TSR_H__
5 
6 #include "../scaling/scale_tsr.h"
7 #include "../summation/sum_tsr.h"
8 #include "../contraction/ctr_comm.h"
9 #include "../mapping/mapping.h"
10 
11 namespace CTF_int {
12  class summation;
13 
14  class strp_tsr {
15  public:
16  int alloced;
17  int order;
18  int64_t blk_sz;
19  int * edge_len;
20  int * strip_dim;
21  int * strip_idx;
22  char * A;
23  char * buffer;
24  algstrct const * sr_A;
25 
30  void run(int const dir);
31 
35  void free_exp();
36 
42  int64_t mem_fp();
43 
47  strp_tsr * clone();
48 
52  strp_tsr(strp_tsr * o);
53  ~strp_tsr(){ if (buffer != NULL) CTF_int::cdealloc(buffer); CTF_int::cdealloc(edge_len); CTF_int::cdealloc(strip_dim); CTF_int::cdealloc(strip_idx);}
54  strp_tsr(){ buffer = NULL; }
55  };
56 
57  class strp_scl : public scl {
58  public:
60 
62 
66  void run();
67 
71  int64_t mem_fp();
72 
76  scl * clone();
77 
81  strp_scl(scl * other);
82 
86  ~strp_scl();
88  };
89 
90  class strp_sum : public tsum {
91  public:
93 
96 
97  int strip_A;
98  int strip_B;
99 
103  void run();
104 
108  int64_t mem_fp();
109 
113  tsum * clone();
114 
115  strp_sum(tsum * other);
116 
120  ~strp_sum();
121  strp_sum(summation const * s);
122  };
123 
124  class strp_ctr : public ctr {
125  public:
127 
131 
132  int strip_A;
133  int strip_B;
134  int strip_C;
135 
139  void run(char * A, char * B, char * C);
140 
145  int64_t mem_fp();
146  int64_t mem_rec();
147 
148 
153  double est_time_rec(int nlyr);
154 
158  ctr * clone();
159 
163  ~strp_ctr();
164 
168  strp_ctr(ctr *other);
169  strp_ctr(contraction const * c) : ctr(c) {}
170  };
171 
186  int strip_diag(int order,
187  int order_tot,
188  int const * idx_map,
189  int64_t vrt_sz,
190  mapping const * edge_map,
191  topology const * topo,
192  algstrct const * sr,
193  int * blk_edge_len,
194  int64_t * blk_sz,
195  strp_tsr ** stpr);
196 
197 }
198 
199 #endif // __STRP_TSR_H__
strp_tsr * clone()
copies strp_tsr object
Definition: strp_tsr.cxx:19
strp_tsr * rec_strp_B
Definition: strp_tsr.h:95
algstrct const * sr_A
Definition: strp_tsr.h:24
strp_ctr(contraction const *c)
Definition: strp_tsr.h:169
strp_tsr * rec_strp_A
Definition: strp_tsr.h:128
strp_tsr * rec_strp_A
Definition: strp_tsr.h:94
tsum * rec_tsum
Definition: strp_tsr.h:92
class for execution distributed contraction of tensors
Definition: contraction.h:16
int strip_diag(int order, int order_tot, int const *idx_map, int64_t vrt_sz, mapping const *edge_map, topology const *topo, algstrct const *sr, int *blk_edge_len, int64_t *blk_sz, strp_tsr **stpr)
build stack required for stripping out diagonals of tensor
Definition: strp_tsr.cxx:273
strp_tsr * rec_strp_B
Definition: strp_tsr.h:129
int64_t blk_sz
Definition: strp_tsr.h:18
strp_tsr * rec_strp_C
Definition: strp_tsr.h:130
int cdealloc(void *ptr)
free abstraction
Definition: memcontrol.cxx:480
algstrct (algebraic structure) defines the elementwise operations computed in each tensor contraction...
Definition: algstrct.h:34
class for execution distributed summation of tensors
Definition: summation.h:15
void free_exp()
deallocates buffer
Definition: strp_tsr.cxx:94
strp_tsr * rec_strp
Definition: strp_tsr.h:61
int64_t mem_fp()
returns the number of bytes of buffer space we need
Definition: strp_tsr.cxx:23
void run(int const dir)
strips out part of tensor to be operated on
Definition: strp_tsr.cxx:33