\hypertarget{kdposv_8c}{}\section{src/kdposv.c File Reference}
\label{kdposv_8c}\index{src/kdposv.\+c@{src/kdposv.\+c}}


L\+A\+Ss-\/\+D\+D\+Ss kdposv routine.  


{\ttfamily \#include \char`\"{}../include/lass.\+h\char`\"{}}\\*
Include dependency graph for kdposv.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{kdposv_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{kdposv_8c_ad9d439560ff8b96c5fdd6aa4ead8176f}{kdposv} (enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int N, int N\+R\+HS, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss kdposv routine. 

L\+A\+Ss-\/\+D\+D\+Ss is a software package provided by\+: Barcelona Supercomputing Center -\/ Centro Nacional de Supercomputacion

\begin{DoxyAuthor}{Author}
Pedro Valero-\/\+Lara \href{mailto:pedro.valero@bsc.es}{\tt pedro.\+valero@bsc.\+es} 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
2018-\/04-\/05   
\end{DoxyDate}


\subsection{Function Documentation}
\index{kdposv.\+c@{kdposv.\+c}!kdposv@{kdposv}}
\index{kdposv@{kdposv}!kdposv.\+c@{kdposv.\+c}}
\subsubsection[{\texorpdfstring{kdposv(enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{kdposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdposv (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{kdposv_8c_ad9d439560ff8b96c5fdd6aa4ead8176f}{}\label{kdposv_8c_ad9d439560ff8b96c5fdd6aa4ead8176f}
Solves a system of linear equations A  X = B, where A is a M-\/by-\/M simmetric positive definite matrix and X and B are M-\/by-\/\+N\+R\+HS matrices. The matrix A is descomposed as\+: \begin{DoxyVerb}A = L \times L^T
or
A = U^T \times U
\end{DoxyVerb}


where L is a lower triangular matrix and U is an upper triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em U\+P\+LO} & enum D\+D\+S\+S\+\_\+\+U\+P\+LO. U\+P\+LO specifies the form of A is stored\+:
\begin{DoxyItemize}
\item Lower\+: Lower triangle of A is stored. The upper traingular part is not referenced.
\item Upper\+: Upper triangle of A is stored. The lower triangular part is not referenced.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the order of the square matrix A. N $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N\+R\+HS} & int. N\+R\+HS specifies the number of right-\/hand-\/sides (number of columns of B). N\+R\+HS $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a positive definite matrix of dimension N by L\+DA. On exit, if return value is Success, the matrix A is overwriten by the factor U or L.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension N by N\+R\+HS, which stores the right-\/hand-\/sides of the systems of linear equations. (row-\/major order). On exit, if return value is Success, the matrix B is overwriten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N\+R\+H\+S ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & sucessful exit \\
\hline
{\em No\+Success} & unsucessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a7b849eccd797212a1ce50ee598bde5e2}{ddss\+\_\+dpotrf} 

ddss\+\_\+tile 

ddss\+\_\+symflat2tiled 

ddss\+\_\+symtiled2flat 
\end{DoxySeeAlso}


Definition at line 95 of file kdposv.\+c.



References ddss\+\_\+dflat2tiled(), ddss\+\_\+dsymflat2tiled(), ddss\+\_\+dsymtiled2flat\+\_\+nb(), ddss\+\_\+dtiled2flat(), and ddss\+\_\+tile\+\_\+size().



Referenced by ddss\+\_\+dposv().


\begin{DoxyCode}
99 \{
100 
101     \textcolor{comment}{// Local variables}
102     \textcolor{keywordtype}{int} nt, nrhst;
103     \textcolor{keywordtype}{int} mi, mmi, ki, ni, nni;
104     \textcolor{keywordtype}{int} Am, An;
105     \textcolor{keywordtype}{int} Bm, Bn;
106     \textcolor{keywordtype}{int} tile\_size\_m;
107     \textcolor{keywordtype}{int} tile\_size\_mm;
108     \textcolor{keywordtype}{int} tile\_size\_n;
109     \textcolor{keywordtype}{int} tile\_size\_nn;
110     \textcolor{keywordtype}{int} tile\_size\_k;
111 
112     \textcolor{comment}{// Number of tiles}
113     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
114     \{
115         nt = N / TILE\_SIZE;
116     \}
117     \textcolor{keywordflow}{else}
118     \{
119         nt = ( N / TILE\_SIZE ) + 1;
120     \}
121     \textcolor{keywordflow}{if} ( NRHS % TILE\_SIZE == 0 )
122     \{
123         nrhst = NRHS / TILE\_SIZE;
124     \}
125     \textcolor{keywordflow}{else}
126     \{
127         nrhst = ( NRHS / TILE\_SIZE ) + 1;
128     \}
129     
130     
131     \textcolor{comment}{/****************************}
132 \textcolor{comment}{    --Tile A matrix declaration--}
133 \textcolor{comment}{    ****************************/}
134 
135     Am = nt;
136     An = nt;
137 
138     Bm = nt;
139     Bn = nrhst; 
140     
141     \textcolor{comment}{/***************************}
142 \textcolor{comment}{    --Tile matrices allocation--}
143 \textcolor{comment}{    ***************************/}
144         
145     double (*TILE\_A)[An][TILE\_SIZE * TILE\_SIZE] = malloc ( Am * An * 
146         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
147     
148     \textcolor{keywordflow}{if} ( TILE\_A == NULL)
149     \{
150         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdposv for matrix TILE\_A\(\backslash\)n"} );
151         \textcolor{keywordflow}{return} NoSuccess;
152     \}
153     
154     double ( *TILE\_B )[Bn][TILE\_SIZE * TILE\_SIZE] = malloc(
155              Bm * Bn * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
156 
157     \textcolor{keywordflow}{if} ( TILE\_B == NULL ) 
158     \{
159         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdposv for matrix TILE\_B\(\backslash\)n"} );
160         \textcolor{keywordflow}{return} NoSuccess;
161     \}
162 
163     \textcolor{comment}{/************************************************}
164 \textcolor{comment}{    // --From flat data layout to tiled data layout--   }
165 \textcolor{comment}{    ************************************************/}
166 
167     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
168     \hyperlink{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{ddss\_dsymflat2tiled}( N, N, A, LDA, nt, nt, TILE\_A, UPLO );
169     
170     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
171     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
172 
173     \textcolor{comment}{/**************}
174 \textcolor{comment}{    --DPOSV tile--}
175 \textcolor{comment}{    **************/} 
176 
177     \textcolor{keywordflow}{if} ( UPLO == Lower )
178     \{
179         \textcolor{comment}{// Cholesky descomposition  }
180         \textcolor{comment}{// --UPLO = Lower--}
181         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
182         \{
183             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
184     
185 \textcolor{preprocessor}{            #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
186 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
187 \textcolor{preprocessor}{                label( dpotrf )}
188             LAPACKE\_dpotrf\_work( LAPACK\_ROW\_MAJOR, 
189                              \textcolor{charliteral}{'L'},
190                              tile\_size\_k, 
191                              TILE\_A[ki][ki], tile\_size\_k );
192 
193             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
194             \{
195                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
196             
197 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
198 \textcolor{preprocessor}{                    inout(TILE\_A[mi][ki]) \(\backslash\)}
199 \textcolor{preprocessor}{                    firstprivate( TILE\_A ) \(\backslash\)}
200 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
201 \textcolor{preprocessor}{                    label( dpotrf\_dtrsm )}
202                 cblas\_dtrsm( CblasRowMajor, 
203                              ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Lower, 
204                              ( CBLAS\_TRANSPOSE ) Trans, ( CBLAS\_DIAG ) NonUnit, 
205                              tile\_size\_m, TILE\_SIZE, 
206                              1.0, TILE\_A[ki][ki], TILE\_SIZE, 
207                                   TILE\_A[mi][ki], TILE\_SIZE );
208             \}
209             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < nt; mmi++ )
210             \{
211                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mmi );
212             
213 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
214 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][mmi] ) \(\backslash\)}
215 \textcolor{preprocessor}{                    firstprivate( mmi, ki ) \(\backslash\)}
216 \textcolor{preprocessor}{                    label( dpotrf\_dsyrk )}
217                 cblas\_dsyrk( CblasRowMajor, 
218                              ( CBLAS\_UPLO ) Lower, ( CBLAS\_TRANSPOSE ) NoTrans, 
219                              tile\_size\_mm, TILE\_SIZE, 
220                              -1.0,  TILE\_A[mmi][ki], TILE\_SIZE, 
221                               1.0, TILE\_A[mmi][mmi], tile\_size\_mm );
222             
223                 \textcolor{keywordflow}{for} ( ni = ki + 1; ni < mmi; ni++ )
224                 \{
225                 
226 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
227 \textcolor{preprocessor}{                        in( TILE\_A[ni][ki] ) \(\backslash\)}
228 \textcolor{preprocessor}{                        inout( TILE\_A[mmi][ni] ) \(\backslash\)}
229 \textcolor{preprocessor}{                        firstprivate( ni, mmi, ki ) \(\backslash\)}
230 \textcolor{preprocessor}{                        label( dpotrf\_dgemm )}
231                     cblas\_dgemm( CblasRowMajor, 
232                                  ( CBLAS\_TRANSPOSE ) NoTrans,
233                                  ( CBLAS\_TRANSPOSE ) Trans,
234                                  TILE\_SIZE, 
235                                  TILE\_SIZE, 
236                                  TILE\_SIZE,
237                                  -1.0, TILE\_A[mmi][ki], TILE\_SIZE,
238                                         TILE\_A[ni][ki], TILE\_SIZE,
239                                   1.0, TILE\_A[mmi][ni], TILE\_SIZE );
240                 \}
241             \}
242         \}
243     
244         \textcolor{comment}{/*********************************************}
245 \textcolor{comment}{        --From tiled data layout to flat data layout--  }
246 \textcolor{comment}{        *********************************************/}
247         \hyperlink{ddss__tiled2flat_8c_a9089190fbb27ac8ceaaaa558ab2f5e37}{ddss\_dsymtiled2flat\_nb}( N, N, A, LDA, nt, nt, TILE\_A, UPLO );
248         
249         \textcolor{comment}{// Triangular solve}
250         \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = NoTrans--  }
251         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
252         \{
253             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
254 
255             \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )
256             \{
257                 tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
258                         
259 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
260 \textcolor{preprocessor}{                    inout(  TILE\_B[ki][ni] ) \(\backslash\)}
261 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
262 \textcolor{preprocessor}{                    firstprivate( ki, ni ) \(\backslash\)}
263 \textcolor{preprocessor}{                    label( dtrsm\_dtrsm1 )}
264                 cblas\_dtrsm( CblasRowMajor,
265                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower,
266                              ( CBLAS\_TRANSPOSE ) NoTrans,
267                              ( CBLAS\_DIAG ) NonUnit,
268                              tile\_size\_k,
269                              tile\_size\_n,
270                              1.0, TILE\_A[ki][ki], tile\_size\_k,
271                                   TILE\_B[ki][ni], tile\_size\_n );
272             \}
273             \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ ) 
274             \{
275                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
276                 
277                 \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
278                 \{
279                     
280 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
281 \textcolor{preprocessor}{                        in( TILE\_B[ki][nni] ) \(\backslash\)}
282 \textcolor{preprocessor}{                        inout( TILE\_B[mi][nni] ) \(\backslash\)}
283 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_B ) \(\backslash\)}
284 \textcolor{preprocessor}{                        firstprivate( ki, mi, nni ) \(\backslash\)}
285 \textcolor{preprocessor}{                        label( dtrsm\_dgemm1 )}
286                     cblas\_dgemm( CblasRowMajor,
287                                  CblasNoTrans, CblasNoTrans,
288                                  tile\_size\_k,
289                                  tile\_size\_nn,
290                                  tile\_size\_k,
291                                  -1.0,  TILE\_A[mi][ki],  tile\_size\_k,
292                                        TILE\_B[ki][nni], tile\_size\_nn,
293                                   1.0, TILE\_B[mi][nni], tile\_size\_nn );
294                 \}
295             \}
296         \}
297 
298         \textcolor{comment}{// Triangular solve}
299         \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = Trans-- }
300         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
301         \{
302             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
303 
304             \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )
305             \{
306                 tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
307 
308 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
309 \textcolor{preprocessor}{                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
310 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
311 \textcolor{preprocessor}{                    firstprivate( ki, ni ) \(\backslash\)}
312 \textcolor{preprocessor}{                    label( dtrsm\_dtrsm2 )}
313                 cblas\_dtrsm( CblasRowMajor,
314                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower,
315                              ( CBLAS\_TRANSPOSE ) Trans,
316                              ( CBLAS\_DIAG ) NonUnit,
317                              tile\_size\_k,
318                              tile\_size\_n,
319                              1.0,   TILE\_A[ki][ki], tile\_size\_k,
320                                     TILE\_B[ki][ni], tile\_size\_n );
321             \}
322 
323             \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ )
324             \{
325                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
326                 
327                 \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- )
328                 \{
329                     tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
330 
331 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
332 \textcolor{preprocessor}{                        in( TILE\_B[ki][nni] ) \(\backslash\)}
333 \textcolor{preprocessor}{                        inout(  TILE\_B[mi][nni] ) \(\backslash\)}
334 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_B ) \(\backslash\)}
335 \textcolor{preprocessor}{                        firstprivate( ki, mi, nni ) \(\backslash\)}
336 \textcolor{preprocessor}{                        label( dtrsm\_dgemm2 )}
337                     cblas\_dgemm( CblasRowMajor,
338                                  CblasTrans, CblasNoTrans,
339                                  tile\_size\_m,
340                                  tile\_size\_nn,
341                                  tile\_size\_k,
342                                  -1.0,  TILE\_A[ki][mi],  tile\_size\_m,
343                                        TILE\_B[ki][nni], tile\_size\_nn,
344                                   1.0, TILE\_B[mi][nni], tile\_size\_nn );
345                 \}
346             \}
347         \}
348     \}
349     \textcolor{keywordflow}{else}
350     \{
351         \textcolor{comment}{// Cholesky descomposition  }
352         \textcolor{comment}{// --UPLO = Upper-- }
353         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
354         \{
355             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
356             
357 \textcolor{preprocessor}{            #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
358 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
359 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
360 \textcolor{preprocessor}{                label( dpotrf )}
361             LAPACKE\_dpotrf\_work( LAPACK\_ROW\_MAJOR, 
362                              \textcolor{charliteral}{'U'},
363                              tile\_size\_k, TILE\_A[ki][ki], 
364                              tile\_size\_k );
365 
366             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
367             \{
368                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
369             
370 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
371 \textcolor{preprocessor}{                    inout(TILE\_A[ki][mi]) \(\backslash\)}
372 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
373 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
374 \textcolor{preprocessor}{                    label( dpotrf\_dtrsm )}
375                 cblas\_dtrsm( CblasRowMajor, 
376                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Upper, 
377                              ( CBLAS\_TRANSPOSE ) Trans, ( CBLAS\_DIAG ) NonUnit, 
378                              TILE\_SIZE, tile\_size\_m, 
379                              1.0, TILE\_A[ki][ki], TILE\_SIZE, 
380                                   TILE\_A[ki][mi], tile\_size\_m );
381             \}
382             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < nt; mmi++ )
383             \{
384                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mmi );
385             
386 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][mmi] ) \(\backslash\)}
387 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][mmi] ) \(\backslash\)}
388 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
389 \textcolor{preprocessor}{                    firstprivate( mmi, ki ) \(\backslash\)}
390 \textcolor{preprocessor}{                    label( dpotrf\_dsyrk )}
391                 cblas\_dsyrk( CblasRowMajor, 
392                              ( CBLAS\_UPLO ) Upper, ( CBLAS\_TRANSPOSE ) Trans, 
393                              tile\_size\_mm, TILE\_SIZE, 
394                              -1.0,  TILE\_A[ki][mmi], tile\_size\_mm, 
395                               1.0, TILE\_A[mmi][mmi], tile\_size\_mm );
396             
397                 \textcolor{keywordflow}{for} ( ni = ki + 1; ni < mmi; ni++ )
398                 \{
399 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[ki][ni] ) \(\backslash\)}
400 \textcolor{preprocessor}{                        in( TILE\_A[ki][mmi] ) \(\backslash\)}
401 \textcolor{preprocessor}{                        inout( TILE\_A[ni][mmi] ) \(\backslash\)}
402 \textcolor{preprocessor}{                        shared( TILE\_A ) \(\backslash\)}
403 \textcolor{preprocessor}{                        firstprivate( ni, mmi, ki ) \(\backslash\)}
404 \textcolor{preprocessor}{                        label( dpotrf\_dgemm )}
405                         cblas\_dgemm( CblasRowMajor, 
406                                      ( CBLAS\_TRANSPOSE ) Trans,
407                                      ( CBLAS\_TRANSPOSE ) NoTrans,
408                                      TILE\_SIZE, 
409                                      TILE\_SIZE, 
410                                      TILE\_SIZE,
411                                      -1.0, TILE\_A[ki][ni],  TILE\_SIZE,
412                                            TILE\_A[ki][mmi], TILE\_SIZE,
413                                       1.0, TILE\_A[ni][mmi], TILE\_SIZE );
414                 \}
415             \}
416         \}
417         \textcolor{comment}{/*********************************************}
418 \textcolor{comment}{        --From tiled data layout to flat data layout--  }
419 \textcolor{comment}{         *********************************************/}
420         \hyperlink{ddss__tiled2flat_8c_a9089190fbb27ac8ceaaaa558ab2f5e37}{ddss\_dsymtiled2flat\_nb}( N, N, A, LDA, nt, nt, TILE\_A, UPLO );
421         \textcolor{comment}{// Triangular solve}
422         \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = Trans-- }
423         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
424         \{
425             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
426                                 
427             \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )
428             \{
429                 tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
430 
431 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
432 \textcolor{preprocessor}{                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
433 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
434 \textcolor{preprocessor}{                    firstprivate( ki, ni ) \(\backslash\)}
435 \textcolor{preprocessor}{                    label( dtrsm\_dtrsm1 )}
436                 cblas\_dtrsm( CblasRowMajor,
437                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower,
438                              ( CBLAS\_TRANSPOSE ) Trans,
439                              ( CBLAS\_DIAG ) NonUnit,
440                              tile\_size\_k,
441                              tile\_size\_n,
442                              1.0, TILE\_A[ki][ki], tile\_size\_k,
443                                   TILE\_B[ki][ni], tile\_size\_n );
444             \}
445 
446             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
447             \{
448                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
449                         
450                 \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ )
451                 \{
452                     tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
453 
454 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[ki][mi]) \(\backslash\)}
455 \textcolor{preprocessor}{                        in( TILE\_B[ki][nni] ) \(\backslash\)}
456 \textcolor{preprocessor}{                        inout(  TILE\_B[mi][nni] ) \(\backslash\)}
457 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_B ) \(\backslash\)}
458 \textcolor{preprocessor}{                        firstprivate( ki, mi, nni ) \(\backslash\)}
459 \textcolor{preprocessor}{                        label( dtrsm\_dgemm1 )}
460                     cblas\_dgemm( CblasRowMajor,
461                                  CblasTrans, CblasNoTrans,
462                                  tile\_size\_m,
463                                  tile\_size\_nn,
464                                  tile\_size\_k,
465                                  -1.0,  TILE\_A[ki][mi],  tile\_size\_m,
466                                        TILE\_B[ki][nni], tile\_size\_nn,
467                                   1.0, TILE\_B[mi][nni], tile\_size\_nn );
468                 \}
469             \}
470         \}
471         \textcolor{comment}{// Triangular solve}
472         \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = NoTrans-- }
473         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )  
474         \{ 
475             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki ); 
476  
477             \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )  
478             \{ 
479                 tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni ); 
480  
481 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
482 \textcolor{preprocessor}{                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
483 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
484 \textcolor{preprocessor}{                    firstprivate( ki, ni ) \(\backslash\)}
485 \textcolor{preprocessor}{                    label( dtrsm\_dtrsm2 ) }
486                 cblas\_dtrsm( CblasRowMajor, 
487                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower, 
488                              ( CBLAS\_TRANSPOSE ) NoTrans, 
489                              ( CBLAS\_DIAG ) NonUnit, 
490                              tile\_size\_k,  
491                              tile\_size\_n, 
492                              1.0, TILE\_A[ki][ki], tile\_size\_k, 
493                                   TILE\_B[ki][ni], tile\_size\_n ); 
494             \} 
495  
496             \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ )  
497             \{ 
498                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni ); 
499             
500                 \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- )  
501                 \{ 
502                     tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi ); 
503  
504 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
505 \textcolor{preprocessor}{                        in( TILE\_B[ki][nni] ) \(\backslash\)}
506 \textcolor{preprocessor}{                        inout( TILE\_B[mi][nni] ) \(\backslash\)}
507 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_B ) \(\backslash\)}
508 \textcolor{preprocessor}{                        firstprivate( ki, mi, nni ) \(\backslash\)}
509 \textcolor{preprocessor}{                        label( dtrsm\_dgemm2 ) }
510                     cblas\_dgemm( CblasRowMajor, 
511                                  CblasNoTrans, CblasNoTrans, 
512                                  tile\_size\_m,  
513                                  tile\_size\_nn,  
514                                  tile\_size\_k, 
515                                  -1.0,  TILE\_A[mi][ki],  tile\_size\_k, 
516                                        TILE\_B[ki][nni], tile\_size\_nn, 
517                                   1.0, TILE\_B[mi][nni], tile\_size\_nn ); 
518                 \} 
519             \} 
520         \}
521     \}
522 
523     \textcolor{comment}{/*********************************************}
524 \textcolor{comment}{    --From tiled data layout to flat data layout--  }
525 \textcolor{comment}{    *********************************************/}
526     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
527     
528     \textcolor{comment}{// --Tile A and B matrices free--}
529     free( TILE\_A );
530     free( TILE\_B );
531 
532     \textcolor{keywordflow}{return} Success;
533 
534 \}
\end{DoxyCode}
