LASs - Linear Algebra Routines on OmpSs 1.0.0 LASs

- Main Page
- Files

- File List
- File Members

lass.h
Go to the documentation of this file.
1 /**
2 *
3 * @file lass.h
4 *
5 * @brief LASs header definition.
6 *
7 * LASs is a software package provided by:
8 * Barcelona Supercomputing Center - Centro Nacional de Supercomputacion
9 *
10 * @author Pedro Valero-Lara pedro.valero@bsc.es
11 * @date 2017-09-07
12 * @reviewer
13 * @modified
14 *
15 **/
16
17 #include <stdio.h>
18 #include <stdlib.h>
19 #include <string.h>
20 #include <assert.h>
21 #include <float.h>
22 #include <sys/time.h>
23 #include <math.h>
24 #include <time.h>
25 #include <unistd.h>
26 #if defined(LASs_WITH_MKL)
27 #include <mkl.h>
28 #include <mkl_lapacke.h>
29 #else
30 #include <cblas.h>
31 #include <lapacke.h>
32 #endif
33 #include "../mmsparse/mm_io.h"
34 #include "lass_macros.h"
35 #include "lass_types.h"
36
37 #ifndef DDSS_H
38 #define DDSS_H
39
40 // LASs-DDSs routines
41
42 // BLAS-3 routines
43
44 int ddss_dgemm( enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B,
45 int M, int N, int K,
46 double ALPHA, double *A, int LDA,
47 double *B, int LDB,
48 double BETA, double *C, int LDC );
49
50 int ddss_dsymm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
51 int M, int N,
52 double ALPHA, double *A, int LDA,
53 double *B, int LDB,
54 double BETA, double *C, int LDC );
55
56 int ddss_dtrsm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
57 enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG,
58 int M, int N,
59 const double ALPHA, double *A, int LDA,
60 double *B, int LDB );
61
62 int ddss_dtrmm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
63 enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG,
64 int M, int N,
65 const double ALPHA, double *A, int LDA,
66 double *B, int LDB );
67
68 int ddss_dsyrk( enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A,
69 int N, int K,
70 const double ALPHA, double *A, int LDA,
71 const double BETA, double *C, int LDC );
72
73 int ddss_dsyr2k( enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS,
74 int N, int K,
75 const double ALPHA, double *A, int LDA,
76 double *B, int LDB,
77 const double BETA, double *C, int LDC );
78
79 // LAPACK routines
80
81 int ddss_dnpgetrf( int M,
82 int N,
83 double *A, int LDA );
84
85 int ddss_dnpgesv( int N, int NRHS,
86 double *A, int LDA,
87 double *B, int LDB );
88
89 int ddss_dtpgetrf( int M,
90 int N,
91 double *A, int LDA,
92 int *ipiv );
93
94 int ddss_dtpgesv( int N, int NRHS,
95 double *A, int LDA,
96 int *IPIV,
97 double *B, int LDB );
98
99 int ddss_dpotrf( enum DDSS_UPLO UPLO,
100 int N,
101 double *A, int LDA );
102
103 int ddss_dposv( enum DDSS_UPLO UPLO,
104 int N, int NRHS,
105 double *A, int LDA,
106 double *B, int LDB );
107
108 // BLAS-3 kernels
109
110 enum LASS_RETURN kdgemm( enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B,
111 int M, int N, int K,
112 const double ALPHA, double *A, int LDA,
113 double *B, int LDB,
114 const double BETA, double *C, int LDC );
115
116 enum LASS_RETURN kdsymm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
117 int M, int N,
118 const double ALPHA, double *A, int LDA,
119 double *B, int LDB,
120 const double BETA, double *C, int LDC );
121
122 enum LASS_RETURN kdtrsm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
123 enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG,
124 int M, int N,
125 const double ALPHA, double *A, int LDA,
126 double *B, int LDB );
127
128 enum LASS_RETURN kdtrmm( enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO,
129 enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG,
130 int M, int N,
131 const double ALPHA, double *A, int LDA,
132 double *B, int LDB );
133
134 enum LASS_RETURN kdsyrk( enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A,
135 int N, int K,
136 const double ALPHA, double* A, int LDA,
137 const double BETA, double *C, int LDC );
138
139 enum LASS_RETURN kdsyr2k( enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS,
140 int N, int K,
141 const double ALPHA, double *A, int LDA,
142 double *B, int LDB,
143 const double BETA, double *C, int LDC );
144
145 // LAPACK kernels
146
147 enum LASS_RETURN kdnpgetrf( int M,
148 int N,
149 double *A, int LDA );
150
151 enum LASS_RETURN kdnpgesv( int N, int NRHS,
152 double *A, int LDA,
153 double *B, int LDB );
154
155 enum LASS_RETURN kdtpgetrf( int M,
156 int N,
157 double *A, int LDA,
158 int *ipiv );
159
160 enum LASS_RETURN kdtpgesv( int N, int NRHS,
161 double *A, int LDA,
162 int *IPIV,
163 double *B, int LDB );
164
165 enum LASS_RETURN kdpotrf( enum DDSS_UPLO UPLO,
166 int N,
167 double *A, int LDA );
168
169 enum LASS_RETURN kdposv( enum DDSS_UPLO UPLO,
170 int N, int NRHS,
171 double *A, int LDA,
172 double *B, int LDB );
173
174 // LAPACK codes
175
176 enum LASS_RETURN dnpgetrf( int M, int N, double *A, int LDA );
177
178 // ddss_tile.c routines
179
180 int ddss_tile_size( int M, int MT );
181
182 // ddss_flat2tiled.c routines
183
184 void ddss_dflat2tiled( int M, int N, double *A, int LDA, int MT, int NT,
185 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE] );
186
187 void ddss_dsymtiled2flat( int M, int N, double *A, int LDA, int MT, int NT,
188 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE], enum DDSS_UPLO UPLO );
189
190 void ddss_dgather_tile( int M, int N, double *A, int LDA,
191 double *TILE_A, int MID, int NID );
192
193 // ddss_tiled2flat.c routines
194
195 void ddss_dtiled2flat( int M, int N, double *A, int LDA, int MT, int NT,
196 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE] );
197
198 void ddss_dtiled2flat_nb( int M, int N, double *A, int LDA, int MT, int NT,
199 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE] );
200
201 void ddss_dsymflat2tiled( int M, int N, double *A, int LDA, int MT, int NT,
202 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE], enum DDSS_UPLO UPLO );
203
204 void ddss_dsymtiled2flat_nb( int M, int N, double *A, int LDA, int MT, int NT,
205 double (*TILE_A)[NT][TILE_SIZE * TILE_SIZE], enum DDSS_UPLO UPLO );
206
207 void ddss_dscatter_tile( int M, int N, double *A, int LDA,
208 double *TILE_A, int MID, int NID );
209
210 #endif
211
212 #ifndef DSSS_H
213 #define DSSS_H
214
215 // LASs-DSSs routines
216
217 // DGTSV
218
219 int dsss_dgtsv( int N,
220 double *DL, double *D, double *DU,
221 double *RHS );
222
223 // DSPMV
224
225 int dsss_dspmv( int M, int N,
226 double ALPHA,
227 const double *VAL_A, const int *ROW_PTR_A, const int *COL_IND_A,
228 const double *X,
229 double BETA,
230 double *Y );
231
232 // DGTSV kernel
233
234 enum LASS_RETURN kdgtsv( int N,
235 double *DL, double *D, double *DU,
236 double *RHS );
237
238 // DSPMV kernel
239
240 enum LASS_RETURN kdspmv ( int M, int N,
241 double ALPHA,
242 const double *VAL_A, const int *ROW_PTR_A, const int *COL_IND_A,
243 const double *X,
244 double BETA,
245 double *Y );
246
247 // DGTSV code
248
249 void dgtsvseq( int N,
250 double *DL, double *D, double *DU,
251 double *RHS );
252
253 // DSPMV code
254
255 void dspmvseq( int M, int N,
256 double ALPHA,
257 const double *VAL_A, const int *ROW_PTR_A, const int *COL_IND_A,
258 const double *X,
259 double BETA,
260 double *Y );
261
262 #endif
ddss_tile_size
int ddss_tile_size(int M, int MT)
Definition: ddss_tile.c:52
ddss_dflat2tiled
void ddss_dflat2tiled(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])
Definition: ddss_flat2tiled.c:68
ddss_dsyrk
int ddss_dsyrk(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, int N, int K, const double ALPHA, double *A, int LDA, const double BETA, double *C, int LDC)
Definition: ddss_dsyrk.c:106
kdtpgesv
enum LASS_RETURN kdtpgesv(int N, int NRHS, double *A, int LDA, int *IPIV, double *B, int LDB)
Definition: kdtpgesv.c:91
ddss_dscatter_tile
void ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
Definition: ddss_tiled2flat.c:414
ddss_dnpgetrf
int ddss_dnpgetrf(int M, int N, double *A, int LDA)
Definition: ddss_dnpgetrf.c:70
kdtrmm
enum LASS_RETURN kdtrmm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)
Definition: kdtrmm.c:123
ddss_dsymm
int ddss_dsymm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, int M, int N, double ALPHA, double *A, int LDA, double *B, int LDB, double BETA, double *C, int LDC)
Definition: ddss_dsymm.c:120
kdnpgesv
enum LASS_RETURN kdnpgesv(int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: kdnpgesv.c:86
ddss_dgemm
int ddss_dgemm(enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B, int M, int N, int K, double ALPHA, double *A, int LDA, double *B, int LDB, double BETA, double *C, int LDC)
Definition: ddss_dgemm.c:128
kdtpgetrf
enum LASS_RETURN kdtpgetrf(int M, int N, double *A, int LDA, int *ipiv)
Definition: kdtpgetrf.c:80
ddss_dtiled2flat
void ddss_dtiled2flat(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])
Definition: ddss_tiled2flat.c:68
ddss_dpotrf
int ddss_dpotrf(enum DDSS_UPLO UPLO, int N, double *A, int LDA)
Definition: ddss_dpotrf.c:74
ddss_dtiled2flat_nb
void ddss_dtiled2flat_nb(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])
Definition: ddss_tiled2flat.c:142
kdposv
enum LASS_RETURN kdposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: kdposv.c:95
lass_macros.h
Macros definition.
ddss_dtrsm
int ddss_dtrsm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)
Definition: ddss_dtrsm.c:113
dspmvseq
void dspmvseq(int M, int N, double ALPHA, const double *VAL_A, const int *ROW_PTR_A, const int *COL_IND_A, const double *X, double BETA, double *Y)
Definition: dspmv.c:84
ddss_dgather_tile
void ddss_dgather_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
Definition: ddss_flat2tiled.c:238
ddss_dsyr2k
int ddss_dsyr2k(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)
Definition: ddss_dsyr2k.c:114
kdsyrk
enum LASS_RETURN kdsyrk(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, int N, int K, const double ALPHA, double *A, int LDA, const double BETA, double *C, int LDC)
Definition: kdsyrk.c:117
ddss_dnpgesv
int ddss_dnpgesv(int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: ddss_dnpgesv.c:84
kdtrsm
enum LASS_RETURN kdtrsm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)
Definition: kdtrsm.c:123
kdgemm
enum LASS_RETURN kdgemm(enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B, int M, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)
Definition: kdgemm.c:131
ddss_dsymtiled2flat
void ddss_dsymtiled2flat(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)
Definition: ddss_tiled2flat.c:223
kdnpgetrf
enum LASS_RETURN kdnpgetrf(int M, int N, double *A, int LDA)
Definition: kdnpgetrf.c:74
ddss_dposv
int ddss_dposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)
Definition: ddss_dposv.c:92
kdpotrf
enum LASS_RETURN kdpotrf(enum DDSS_UPLO UPLO, int N, double *A, int LDA)
Definition: kdpotrf.c:78
dnpgetrf
enum LASS_RETURN dnpgetrf(int M, int N, double *A, int LDA)
Definition: dnpgetrf.c:70
ddss_dtrmm
int ddss_dtrmm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)
Definition: ddss_dtrmm.c:113
ddss_dsymflat2tiled
void ddss_dsymflat2tiled(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)
Definition: ddss_flat2tiled.c:147
ddss_dtpgesv
int ddss_dtpgesv(int N, int NRHS, double *A, int LDA, int *IPIV, double *B, int LDB)
Definition: ddss_dtpgesv.c:89
ddss_dsymtiled2flat_nb
void ddss_dsymtiled2flat_nb(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)
Definition: ddss_tiled2flat.c:324
kdsymm
enum LASS_RETURN kdsymm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)
Definition: kdsymm.c:125
kdsyr2k
enum LASS_RETURN kdsyr2k(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)
Definition: kdsyr2k.c:124
ddss_dtpgetrf
int ddss_dtpgetrf(int M, int N, double *A, int LDA, int *ipiv)
Definition: ddss_dtpgetrf.c:77