HMLP: High-performance Machine Learning Primitives
hmlp_internal.hpp
1 
23 #include <cstdlib>
24 #include <cstdio>
25 #include <cstddef>
26 #include <stdint.h>
27 
28 #ifndef HMLP_INTERNAL_HPP
29 #define HMLP_INTERNAL_HPP
30 
31 #define restrict __restrict__
32 
33 
34 typedef unsigned long long dim_t;
35 typedef unsigned long long inc_t;
36 
37 template<typename TA, typename TB, typename TC, typename TV>
38 struct aux_s
39 {
40  TA *a_next;
41 
42  TB *b_next;
43 
44  TC *c_buff;
45 
46  TV *V;
47 
48  int ldv;
49 
50  // For gsks
51 
52  TV *hi;
53 
54  TV *hj;
55 
56 // // For gsknn
57 // TV *D;
58 //
59 // int *I;
60 //
61 // int ldr;
62 
63  // index for gkmx to access data in the closure of opkernel and opreduce.
64  int i;
65 
66  int j;
67 
68  int b;
69 
70  // edge case problem size
71  int ib;
72 
73  int jb;
74 
75  int m;
76 
77  int n;
78 
79  // whether this is the first rank-k update.
80  int pc;
81 
82  int do_packC;
83 
84  int ldc;
85 };
86 
87 
88 
89 
90 #define BLIS_GEMM_KERNEL(name,type) \
91  void name \
92  ( \
93  dim_t k, \
94  type* restrict alpha, \
95  type* restrict a, \
96  type* restrict b, \
97  type* restrict beta, \
98  type* restrict c, \
99  inc_t rs_c, inc_t cs_c, \
100  aux_s<type, type, type, type> *aux \
101  ) \
102 
103 #define GEMM_OPERATOR(type) \
104  void operator() \
105  ( \
106  dim_t k, \
107  type *a, \
108  type *b, \
109  type *c, inc_t rs_c, inc_t cs_c, \
110  aux_s<type, type, type, type> *aux \
111  ) \
112 
113 #define STRA_OPERATOR(type) \
114  void operator() \
115  ( \
116  int k, \
117  type *a, \
118  type *b, \
119  int len, \
120  type **c_list, int ldc, \
121  type *alpha_list, \
122  aux_s<type, type, type, type> *aux \
123  ) \
124 
125 #define GSKS_OPERATOR(type) \
126  void operator() \
127  ( \
128  kernel_s<type> *ker, \
129  int k, \
130  int rhs, \
131  type *u, \
132  type *a, type *aa, \
133  type *b, type *bb, \
134  type *w, \
135  type *c, int ldc, \
136  aux_s<type, type, type, type> *aux \
137  ) \
138 
139 #define GSKNN_OPERATOR(type) \
140  void operator() \
141  ( \
142  kernel_s<type> *ker, \
143  int k, \
144  int r, \
145  type *a, type *aa, \
146  type *b, type *bb, \
147  type *c, \
148  aux_s<type, type, type, type> *aux \
149  int *bmap \
150  ) \
151 
152 
153 
154 
155 #endif
Definition: hmlp_internal.hpp:38