Cyclops Tensor Framework
parallel arithmetic on multidimensional arrays
Main Page
Modules
Namespaces
Data Structures
Files
File List
Globals
ctr_tsr.h
Go to the documentation of this file.
1
/*Copyright (c) 2011, Edgar Solomonik, all rights reserved.*/
2
3
#ifndef __CTR_TSR_H__
4
#define __CTR_TSR_H__
5
6
#include "
ctr_comm.h
"
7
namespace
CTF_int
{
8
9
class
ctr_virt
:
public
ctr
{
10
public
:
11
ctr
*
rec_ctr
;
12
int
num_dim
;
13
int
*
virt_dim
;
14
int
order_A
;
15
int64_t
blk_sz_A
;
16
int
const
*
idx_map_A
;
17
int
order_B
;
18
int64_t
blk_sz_B
;
19
int
const
*
idx_map_B
;
20
int
order_C
;
21
int64_t
blk_sz_C
;
22
int
const
*
idx_map_C
;
23
24
void
print
();
25
29
void
run
(
char
* A,
char
* B,
char
* C);
30
int64_t
mem_fp
();
31
int64_t
mem_rec
();
32
33
double
est_time_rec
(
int
nlyr);
34
ctr
*
clone
();
35
39
~ctr_virt
();
40
44
ctr_virt
(
ctr
*other);
45
ctr_virt
(
contraction
const
* c,
46
int
num_tot,
47
int
* virt_dim,
48
int64_t vrt_sz_A,
49
int64_t vrt_sz_B,
50
int64_t vrt_sz_C);
51
};
52
53
/* Assume LDA equal to dim */
54
/* class ctr_dgemm : public ctr {
55
public:
56
char transp_A;
57
char transp_B;
58
char const * alpha;
59
int n;
60
int m;
61
int k;
62
63
void print() {};
64
void run();
65
int64_t mem_fp();
66
double est_time_fp(int nlyr);
67
double est_time_rec(int nlyr);
68
ctr * clone();
69
70
ctr_dgemm(ctr * other);
71
~ctr_dgemm();
72
ctr_dgemm(){}
73
};*/
74
75
struct
iparam
{
76
int64_t
l
;
77
int64_t
n
;
78
int64_t
m
;
79
int64_t
k
;
80
int64_t
sz_C
;
81
char
tA
;
82
char
tB
;
83
char
tC
;
84
bool
offload
;
85
};
86
87
class
seq_tsr_ctr
:
public
ctr
{
88
public
:
89
char
const
*
alpha
;
90
int
order_A
;
91
int
*
edge_len_A
;
92
int
const
*
idx_map_A
;
93
int
*
sym_A
;
94
int
order_B
;
95
int
*
edge_len_B
;
96
int
const
*
idx_map_B
;
97
int
*
sym_B
;
98
int
order_C
;
99
int
*
edge_len_C
;
100
int
const
*
idx_map_C
;
101
int
*
sym_C
;
102
//fseq_tsr_ctr func_ptr;
103
104
int
is_inner
;
105
iparam
inner_params
;
106
107
int
is_custom
;
108
bivar_function
const
*
func
;
// custom_params;
109
113
void
run
(
char
* A,
char
* B,
char
* C);
114
void
print
();
115
int64_t
mem_fp
();
116
double
est_fp();
117
uint64_t est_membw();
118
double
est_time_rec
(
int
nlyr);
119
double
est_time_fp
(
int
nlyr);
120
ctr
*
clone
();
121
126
seq_tsr_ctr
(
ctr
* other);
127
~seq_tsr_ctr
(){
CTF_int::cdealloc
(edge_len_A),
CTF_int::cdealloc
(edge_len_B),
CTF_int::cdealloc
(edge_len_C),
128
CTF_int::cdealloc
(sym_A),
CTF_int::cdealloc
(sym_B),
CTF_int::cdealloc
(sym_C); }
129
seq_tsr_ctr
(
contraction
const
* c,
130
bool
is_inner,
131
iparam
const
* inner_params,
132
int
* virt_blk_len_A,
133
int
* virt_blk_len_B,
134
int
* virt_blk_len_C,
135
int64_t vrt_sz_C);
136
};
137
149
void
inv_idx
(
int
order_A
,
150
int
const
* idx_A,
151
int
order_B
,
152
int
const
* idx_B,
153
int
order_C
,
154
int
const
* idx_C,
155
int
* order_tot,
156
int
** idx_arr);
157
158
159
}
160
161
#endif // __CTR_TSR_H__
CTF_int::ctr_virt::blk_sz_B
int64_t blk_sz_B
Definition:
ctr_tsr.h:18
CTF_int::seq_tsr_ctr::idx_map_B
int const * idx_map_B
Definition:
ctr_tsr.h:96
CTF_int::ctr::est_time_fp
virtual double est_time_fp(int nlyr)
Definition:
ctr_comm.h:178
CTF_int::ctr_virt::num_dim
int num_dim
Definition:
ctr_tsr.h:12
CTF_int::seq_tsr_ctr::inner_params
iparam inner_params
Definition:
ctr_tsr.h:105
CTF_int::seq_tsr_ctr::is_custom
int is_custom
Definition:
ctr_tsr.h:107
CTF_int::iparam::tC
char tC
Definition:
ctr_tsr.h:83
CTF_int::seq_tsr_ctr::is_inner
int is_inner
Definition:
ctr_tsr.h:104
CTF_int::iparam::offload
bool offload
Definition:
ctr_tsr.h:84
CTF_int::iparam::k
int64_t k
Definition:
ctr_tsr.h:79
CTF_int::ctr_virt::order_A
int order_A
Definition:
ctr_tsr.h:14
CTF_int::inv_idx
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
CTF_int::seq_tsr_ctr::idx_map_C
int const * idx_map_C
Definition:
ctr_tsr.h:100
CTF_int::ctr_virt::mem_fp
int64_t mem_fp()
Definition:
ctr_tsr.cxx:92
CTF_int::ctr
Definition:
ctr_comm.h:165
CTF_int::iparam::m
int64_t m
Definition:
ctr_tsr.h:78
CTF_int::ctr_virt::~ctr_virt
~ctr_virt()
deallocates ctr_virt object
Definition:
ctr_tsr.cxx:41
CTF_int::seq_tsr_ctr::sym_A
int * sym_A
Definition:
ctr_tsr.h:93
CTF_int::bivar_function
untyped internal class for triply-typed bivariate function
Definition:
ctr_comm.h:16
CTF_int::ctr_virt::idx_map_C
int const * idx_map_C
Definition:
ctr_tsr.h:22
CTF_int::ctr_virt::blk_sz_C
int64_t blk_sz_C
Definition:
ctr_tsr.h:21
CTF_int::seq_tsr_ctr::order_C
int order_C
Definition:
ctr_tsr.h:98
CTF_int::ctr_virt::ctr_virt
ctr_virt(ctr *other)
copies ctr_virt object
Definition:
ctr_tsr.cxx:46
CTF_int::contraction
class for execution distributed contraction of tensors
Definition:
contraction.h:16
CTF_int::ctr_virt::idx_map_B
int const * idx_map_B
Definition:
ctr_tsr.h:19
CTF_int::iparam::n
int64_t n
Definition:
ctr_tsr.h:77
CTF_int::seq_tsr_ctr::order_A
int order_A
Definition:
ctr_tsr.h:90
CTF_int::iparam::sz_C
int64_t sz_C
Definition:
ctr_tsr.h:80
CTF_int::ctr_virt::run
void run(char *A, char *B, char *C)
iterates over the dense virtualization block grid and contracts
Definition:
ctr_tsr.cxx:101
CTF_int::ctr_virt::clone
ctr * clone()
Definition:
ctr_tsr.cxx:66
CTF_int::seq_tsr_ctr::idx_map_A
int const * idx_map_A
Definition:
ctr_tsr.h:92
CTF_int::seq_tsr_ctr::~seq_tsr_ctr
~seq_tsr_ctr()
Definition:
ctr_tsr.h:127
CTF_int::seq_tsr_ctr::sym_C
int * sym_C
Definition:
ctr_tsr.h:101
CTF_int::iparam::l
int64_t l
Definition:
ctr_tsr.h:76
CTF_int::ctr_virt::print
void print()
Definition:
ctr_tsr.cxx:70
CTF_int::ctr_virt::est_time_rec
double est_time_rec(int nlyr)
Definition:
ctr_tsr.cxx:82
CTF_int::seq_tsr_ctr
Definition:
ctr_tsr.h:87
CTF_int::seq_tsr_ctr::func
bivar_function const * func
Definition:
ctr_tsr.h:108
CTF_int::ctr_virt::virt_dim
int * virt_dim
Definition:
ctr_tsr.h:13
CTF_int::ctr_virt::order_B
int order_B
Definition:
ctr_tsr.h:17
CTF_int::cdealloc
int cdealloc(void *ptr)
free abstraction
Definition:
memcontrol.cxx:480
CTF_int::seq_tsr_ctr::alpha
char const * alpha
Definition:
ctr_tsr.h:89
CTF_int::iparam
Definition:
ctr_tsr.h:75
CTF_int::ctr_virt::blk_sz_A
int64_t blk_sz_A
Definition:
ctr_tsr.h:15
CTF_int::ctr_virt::mem_rec
int64_t mem_rec()
Definition:
ctr_tsr.cxx:96
ctr_comm.h
CTF_int::seq_tsr_ctr::edge_len_A
int * edge_len_A
Definition:
ctr_tsr.h:91
CTF_int::ctr_virt::order_C
int order_C
Definition:
ctr_tsr.h:20
CTF_int::ctr_virt
Definition:
ctr_tsr.h:9
CTF_int::ctr_virt::rec_ctr
ctr * rec_ctr
Definition:
ctr_tsr.h:11
CTF_int::seq_tsr_ctr::edge_len_B
int * edge_len_B
Definition:
ctr_tsr.h:95
CTF_int::seq_tsr_ctr::order_B
int order_B
Definition:
ctr_tsr.h:94
CTF_int::seq_tsr_ctr::sym_B
int * sym_B
Definition:
ctr_tsr.h:97
CTF_int
Definition:
model_trainer.cxx:16
CTF_int::iparam::tB
char tB
Definition:
ctr_tsr.h:82
CTF_int::ctr_virt::idx_map_A
int const * idx_map_A
Definition:
ctr_tsr.h:16
CTF_int::seq_tsr_ctr::edge_len_C
int * edge_len_C
Definition:
ctr_tsr.h:99
CTF_int::iparam::tA
char tA
Definition:
ctr_tsr.h:81
src
contraction
ctr_tsr.h
Generated on Thu Feb 28 2019 19:22:24 for Cyclops Tensor Framework by
1.8.11