Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
scale_tsr.h
Go to the documentation of this file.
1 /*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
2 
3 #ifndef __SCL_TSR_H__
4 #define __SCL_TSR_H__
5 
6 #include "../tensor/algstrct.h"
7 #include "sym_seq_scl.h"
8 
9 namespace CTF_int {
10 
11 
12  class scl {
13  public:
14  char * A;
15  algstrct const * sr_A;
16  char const * alpha;
17  void * buffer;
18 
19  virtual void run() {};
20  virtual int64_t mem_fp() { return 0; };
21  virtual scl * clone() { return NULL; };
22 
23  virtual ~scl(){ if (buffer != NULL) CTF_int::cdealloc(buffer); }
24  scl(scl * other);
25  scl(){ buffer = NULL; }
26  };
27 
28  class scl_virt : public scl {
29  public:
30  /* Class to be called on sub-blocks */
32 
33  int num_dim;
34  int * virt_dim;
35  int order_A;
36  int64_t blk_sz_A;
37  int const * idx_map_A;
38 
39  void run();
40  int64_t mem_fp();
41  scl * clone();
42 
43  scl_virt(scl * other);
44  ~scl_virt();
46  };
47 
48  class seq_tsr_scl : public scl {
49  public:
50  int order;
51  int * edge_len;
52  int const * idx_map;
53  int const * sym;
54  //fseq_tsr_scl func_ptr;
55 
56  int is_custom;
57  endomorphism const * func; //fseq_elm_scl custom_params;
58 
59  void run();
60  void print();
61  int64_t mem_fp();
62  scl * clone();
63 
68  seq_tsr_scl(scl * other);
71  };
72 
82  void inv_idx(int order_A,
83  int const * idx_A,
84  int * order_tot,
85  int ** idx_arr);
86 
87 }
88 #endif // __SCL_TSR_H__
char const * alpha
Definition: scale_tsr.h:16
char * A
Definition: scale_tsr.h:14
untyped internal class for singly-typed single variable function (Endomorphism)
Definition: sym_seq_scl.h:12
void inv_idx(int order_A, int const *idx_A, int order_B, int const *idx_B, int order_C, int const *idx_C, int *order_tot, int **idx_arr)
invert index map
Definition: ctr_tsr.cxx:592
virtual int64_t mem_fp()
Definition: scale_tsr.h:20
algstrct const * sr_A
Definition: scale_tsr.h:15
int64_t blk_sz_A
Definition: scale_tsr.h:36
int const * idx_map_A
Definition: scale_tsr.h:37
virtual ~scl()
Definition: scale_tsr.h:23
virtual void run()
Definition: scale_tsr.h:19
endomorphism const * func
Definition: scale_tsr.h:57
int const * sym
Definition: scale_tsr.h:53
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
virtual scl * clone()
Definition: scale_tsr.h:21
void * buffer
Definition: scale_tsr.h:17
int const * idx_map
Definition: scale_tsr.h:52