\hypertarget{kdtrmm_8c}{}\section{src/kdtrmm.c File Reference}
\label{kdtrmm_8c}\index{src/kdtrmm.\+c@{src/kdtrmm.\+c}}


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


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


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss kdtrmm 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} 

Boro Sofranac \href{mailto:boro.sofranac@bsc.es}{\tt boro.\+sofranac@bsc.\+es} 
\end{DoxyAuthor}
\begin{DoxyDate}{Date}
2018-\/03-\/19   
\end{DoxyDate}


\subsection{Function Documentation}
\index{kdtrmm.\+c@{kdtrmm.\+c}!kdtrmm@{kdtrmm}}
\index{kdtrmm@{kdtrmm}!kdtrmm.\+c@{kdtrmm.\+c}}
\subsubsection[{\texorpdfstring{kdtrmm(enum D\+D\+S\+S\+\_\+\+S\+I\+D\+E S\+I\+D\+E, enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+A, enum D\+D\+S\+S\+\_\+\+D\+I\+A\+G D\+I\+A\+G, int M, int N, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{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)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdtrmm (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+S\+I\+DE}]{S\+I\+DE, }
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+A, }
\item[{enum D\+D\+S\+S\+\_\+\+D\+I\+AG}]{D\+I\+AG, }
\item[{int}]{M, }
\item[{int}]{N, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{kdtrmm_8c_afff986820ff4c554e2b217e99b49c143}{}\label{kdtrmm_8c_afff986820ff4c554e2b217e99b49c143}
Performs one of the matrix-\/matrix operations\+: \begin{DoxyVerb}B = ALPHA * op( A ) * B, or B = ALPHA * B * op( A )
\end{DoxyVerb}


where op( A ) is one of\+: \begin{DoxyVerb}op( A ) = A      or
op( A ) = A**T 
\end{DoxyVerb}


A\+L\+P\+HA is a scalar, B is a M by N matrix and A is a unit, or non-\/unit, upper or lower triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em S\+I\+DE} & enum D\+D\+S\+S\+\_\+\+S\+I\+DE. S\+I\+DE specifies the position of the triangular A matrix in the operations\+:
\begin{DoxyItemize}
\item Left\+: B = A\+L\+P\+HA $\ast$ op( A ) $\ast$ B.
\item Right\+: B = A\+L\+P\+HA $\ast$ B $\ast$ op( A ).
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em U\+P\+LO} & enum D\+D\+S\+S\+\_\+\+U\+P\+LO. U\+P\+LO specifies the form in which 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 T\+R\+A\+N\+S\+\_\+A} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+A specifies the form of op( A ) to be used\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( A ) = A.
\item Trans\+: op( A ) = A$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em D\+I\+AG} & enum D\+D\+S\+S\+\_\+\+D\+I\+AG. D\+I\+AG specifies whether or not A is unit triangular as follows\+:
\begin{DoxyItemize}
\item Unit\+: A is assumed to be unit triangular.
\item Non\+Unit\+: A is not assumed to be unit triangular.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of B. M must be at least zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of B. N must be at least zero.\\
\hline
\mbox{\tt in}  & {\em A\+L\+P\+HA} & double. A\+L\+P\+HA specifies the scalar alpha.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to a matrix of dimension K by K, where K is M when S\+I\+DE = Left and is N otherwise. When U\+P\+LO = Uppper the strictly lower triangular part of A is not referenced and when U\+P\+LO = Lower the strictly upper triangular part of A is not referenced. Note that when D\+I\+AG = Unit, the diagonal elements of A are not referenced either, but are assumed to be unity.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). When S\+I\+DE = Left then L\+DA must be at least max( 1, M ), otherwise 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 M by N. On exit the matrix B is overwritten by the transformed matrix.\\
\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 ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
ddss\+\_\+tile 

ddss\+\_\+flat2tiled 

\hyperlink{lass_8h_afc5c48ad2172946afab6c9e989c4e81a}{ddss\+\_\+dsymflat2tiled} 

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


Definition at line 123 of file kdtrmm.\+c.



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



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


\begin{DoxyCode}
128 \{
129 
130     \textcolor{comment}{// Local variables}
131     \textcolor{keywordtype}{int} k;
132     \textcolor{keywordtype}{int} mt, nt;
133     \textcolor{keywordtype}{int} ki, ni, mi, nni, mmi;
134     \textcolor{keywordtype}{int} Am, An;
135     \textcolor{keywordtype}{int} Bm, Bn;
136     \textcolor{keywordtype}{int} tile\_size\_m;
137     \textcolor{keywordtype}{int} tile\_size\_n;
138     \textcolor{keywordtype}{int} tile\_size\_k;
139     
140     \textcolor{comment}{// Number of tiles}
141     \textcolor{keywordflow}{if} ( M % TILE\_SIZE == 0 ) 
142     \{
143         mt = M / TILE\_SIZE;
144     \} 
145     \textcolor{keywordflow}{else} 
146     \{
147         mt = ( M / TILE\_SIZE ) + 1;
148     \}
149 
150     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 ) 
151     \{
152         nt = N / TILE\_SIZE;
153     \} 
154     \textcolor{keywordflow}{else} 
155     \{
156         nt = ( N / TILE\_SIZE ) + 1;
157     \}
158 
159     \textcolor{comment}{/****************************}
160 \textcolor{comment}{     --Tile matrices declaration--}
161 \textcolor{comment}{     ****************************/}
162 
163     \textcolor{keywordflow}{if} ( SIDE == Left ) 
164     \{
165         Am = An = mt;
166         k = M;
167     \} 
168     \textcolor{keywordflow}{else} 
169     \{
170         Am = An = nt;
171         k = N;
172     \}
173 
174     Bm = mt;
175     Bn = nt;
176     
177     \textcolor{comment}{/***************************}
178 \textcolor{comment}{     --Tile matrices allocation--}
179 \textcolor{comment}{     ***************************/}
180 
181     double ( *TILE\_A )[An][TILE\_SIZE * TILE\_SIZE] = malloc(
182              Am * An * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
183 
184     \textcolor{keywordflow}{if} ( TILE\_A == NULL ) 
185     \{
186         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_A\(\backslash\)n"} );
187         \textcolor{keywordflow}{return} NoSuccess;
188     \}
189 
190     double ( *TILE\_B )[Bn][TILE\_SIZE * TILE\_SIZE] = malloc(
191              Bm * Bn * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
192 
193     \textcolor{keywordflow}{if} ( TILE\_B == NULL ) 
194     \{
195         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_B\(\backslash\)n"} );
196         \textcolor{keywordflow}{return} NoSuccess;
197     \}
198 
199     \textcolor{comment}{/*********************************************}
200 \textcolor{comment}{     --From flat data layout to tiled data layout-- }
201 \textcolor{comment}{     *********************************************/}
202 
203     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
204     \hyperlink{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{ddss\_dsymflat2tiled}( k, k, A, LDA, Am, An, TILE\_A, UPLO );
205 
206     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
207     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, N, B, LDB, Bm, Bn, TILE\_B );
208     
209     \textcolor{comment}{/*************}
210 \textcolor{comment}{     --DTRMM tile--}
211 \textcolor{comment}{     *************/}
212 
213     \textcolor{keywordflow}{if} ( SIDE == Left ) 
214     \{
215         \textcolor{keywordflow}{if} ( UPLO == Upper ) 
216         \{
217             \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = NoTrans-- }
218             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans ) 
219             \{
220                 \textcolor{keywordflow}{for} ( ki = 0; ki < mt; ki++ ) 
221                 \{
222                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
223                     
224                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
225                     \{
226                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
227                         
228 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
229 \textcolor{preprocessor}{                                inout( TILE\_B[ki][ni] ) \(\backslash\)}
230 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
231 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
232 \textcolor{preprocessor}{                                label( dtrmm )}
233                         cblas\_dtrmm( CblasRowMajor,
234                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
235                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
236                                      ( CBLAS\_DIAG ) DIAG,
237                                      tile\_size\_k, 
238                                      tile\_size\_n,
239                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
240                                             TILE\_B[ki][ni], tile\_size\_n );
241                         
242                         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ ) 
243                         \{
244                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
245                         
246 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
247 \textcolor{preprocessor}{                                    in( TILE\_B[mi][ni] ) \(\backslash\)}
248 \textcolor{preprocessor}{                                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
249 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
250 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
251 \textcolor{preprocessor}{                                    label( dgemm )}
252                             cblas\_dgemm( CblasRowMajor,
253                                          CblasNoTrans, CblasNoTrans,
254                                          tile\_size\_k, 
255                                          tile\_size\_n, 
256                                          tile\_size\_m,
257                                          ALPHA, TILE\_A[ki][mi],  tile\_size\_m,
258                                                 TILE\_B[mi][ni],  tile\_size\_n,
259                                          1.0,   TILE\_B[ki][ni],  tile\_size\_n );
260                         \}
261                     \}
262                 \}
263             \}
264             \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = Trans-- }
265             \textcolor{keywordflow}{else} 
266             \{   
267                 \textcolor{keywordflow}{for} ( ki = mt-1; ki > -1; ki-- ) 
268                 \{
269                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
270                     
271                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
272                     \{
273                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
274                     
275 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
276 \textcolor{preprocessor}{                                inout( TILE\_B[ki][ni] ) \(\backslash\)}
277 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
278 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
279 \textcolor{preprocessor}{                                label( dtrmm )}
280                         cblas\_dtrmm( CblasRowMajor,
281                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
282                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
283                                      ( CBLAS\_DIAG ) DIAG,
284                                      tile\_size\_k, 
285                                      tile\_size\_n,
286                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
287                                             TILE\_B[ki][ni], tile\_size\_n );
288                         
289                         \textcolor{keywordflow}{for} ( mi = 0; mi < ki; mi++ ) 
290                         \{
291                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
292                             
293 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
294 \textcolor{preprocessor}{                                    in( TILE\_B[mi][ni] ) \(\backslash\)}
295 \textcolor{preprocessor}{                                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
296 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
297 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
298 \textcolor{preprocessor}{                                    label( dgemm )}
299                             cblas\_dgemm( CblasRowMajor,
300                                          CblasTrans, CblasNoTrans,
301                                          tile\_size\_k, 
302                                          tile\_size\_n, 
303                                          tile\_size\_m,
304                                          ALPHA, TILE\_A[mi][ki],  tile\_size\_k,
305                                                 TILE\_B[mi][ni],  tile\_size\_n,
306                                          1.0,   TILE\_B[ki][ni],  tile\_size\_n );
307                         \}
308                     \}
309                 \}
310                 
311             \}
312         \}
313         \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = NoTrans--  }
314         \textcolor{keywordflow}{else} 
315         \{
316             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans ) 
317             \{
318                 \textcolor{keywordflow}{for} ( ki = mt-1; ki > -1; ki-- ) 
319                 \{
320                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
321                     
322                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
323                     \{
324                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
325                         
326 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
327 \textcolor{preprocessor}{                                inout( TILE\_B[ki][ni] ) \(\backslash\)}
328 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
329 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
330 \textcolor{preprocessor}{                                label( dtrmm )}
331                         cblas\_dtrmm( CblasRowMajor,
332                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
333                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
334                                      ( CBLAS\_DIAG ) DIAG,
335                                      tile\_size\_k, 
336                                      tile\_size\_n,
337                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
338                                             TILE\_B[ki][ni], tile\_size\_n );
339                         
340                         \textcolor{keywordflow}{for} ( mi = 0; mi < ki; mi++ ) 
341                         \{   
342                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
343                             
344 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
345 \textcolor{preprocessor}{                                    in( TILE\_B[mi][ni] ) \(\backslash\)}
346 \textcolor{preprocessor}{                                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
347 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
348 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
349 \textcolor{preprocessor}{                                    label( dgemm )}
350                             cblas\_dgemm( CblasRowMajor,
351                                          CblasNoTrans, CblasNoTrans,
352                                          tile\_size\_k, 
353                                          tile\_size\_n, 
354                                          tile\_size\_m,
355                                          ALPHA, TILE\_A[ki][mi],  tile\_size\_m,
356                                                 TILE\_B[mi][ni],  tile\_size\_n,
357                                          1.0,   TILE\_B[ki][ni],  tile\_size\_n );
358                         \}
359                     \}
360                 \}
361                 
362             \}
363             \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = Trans--    }
364             \textcolor{keywordflow}{else} 
365             \{       
366                 \textcolor{keywordflow}{for} ( ki = 0; ki < mt; ki++ ) 
367                 \{
368                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
369                     
370                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
371                     \{
372                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
373                                             
374 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
375 \textcolor{preprocessor}{                                inout( TILE\_B[ki][ni] ) \(\backslash\)}
376 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
377 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
378 \textcolor{preprocessor}{                                label( dtrmm )}
379                         cblas\_dtrmm( CblasRowMajor,
380                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
381                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
382                                      ( CBLAS\_DIAG ) DIAG,
383                                      tile\_size\_k, 
384                                      tile\_size\_n,
385                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
386                                             TILE\_B[ki][ni], tile\_size\_n );
387                         
388                         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ ) 
389                         \{   
390                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
391                             
392 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
393 \textcolor{preprocessor}{                                    in( TILE\_B[mi][ni] ) \(\backslash\)}
394 \textcolor{preprocessor}{                                    inout( TILE\_B[ki][ni] ) \(\backslash\)}
395 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
396 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
397 \textcolor{preprocessor}{                                    label( dgemm )}
398                             cblas\_dgemm( CblasRowMajor,
399                                          CblasTrans, CblasNoTrans,
400                                          tile\_size\_k, 
401                                          tile\_size\_n, 
402                                          tile\_size\_m,
403                                          ALPHA, TILE\_A[mi][ki],  tile\_size\_k,
404                                                 TILE\_B[mi][ni],  tile\_size\_n,
405                                          1.0,   TILE\_B[ki][ni],  tile\_size\_n );
406                         \}
407                     \}
408                 \}
409             \}
410         \}
411     \}
412     \textcolor{comment}{// --SIDE = Right & UPLO = Upper & TRANS\_A = NoTrans--   }
413     \textcolor{keywordflow}{else}
414     \{
415         \textcolor{keywordflow}{if} ( UPLO == Upper )
416         \{
417             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
418             \{   
419                 \textcolor{keywordflow}{for} ( ki = nt-1; ki > -1; ki-- ) 
420                 \{
421                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
422                     
423                     \textcolor{keywordflow}{for} ( ni = 0; ni < mt; ni++ ) 
424                     \{
425                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ni );
426                             
427 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
428 \textcolor{preprocessor}{                                inout( TILE\_B[ni][ki] ) \(\backslash\)}
429 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
430 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
431 \textcolor{preprocessor}{                                label( dtrmm )}
432                         cblas\_dtrmm( CblasRowMajor,
433                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
434                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
435                                      ( CBLAS\_DIAG ) DIAG,
436                                      tile\_size\_n, 
437                                      tile\_size\_k,
438                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
439                                             TILE\_B[ni][ki], tile\_size\_k );
440                         
441                         \textcolor{keywordflow}{for} ( mi = 0; mi < ki; mi++ ) 
442                         \{   
443                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
444                             
445 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_B[ni][mi] ) \(\backslash\)}
446 \textcolor{preprocessor}{                                    in( TILE\_A[mi][ki] ) \(\backslash\)}
447 \textcolor{preprocessor}{                                    inout( TILE\_B[ni][ki] ) \(\backslash\)}
448 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
449 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
450 \textcolor{preprocessor}{                                    label( dgemm )}
451                             cblas\_dgemm( CblasRowMajor,
452                                          CblasNoTrans, CblasNoTrans,
453                                          tile\_size\_n, 
454                                          tile\_size\_k, 
455                                          tile\_size\_m,
456                                          ALPHA, TILE\_B[ni][mi],  tile\_size\_m,
457                                                 TILE\_A[mi][ki],  tile\_size\_k,
458                                          1.0,   TILE\_B[ni][ki],  tile\_size\_k );
459                         \}
460                     \}
461                 \}
462             \}
463             \textcolor{comment}{// --SIDE = Right & UPLO = Upper & TRANS\_A = Trans-- }
464             \textcolor{keywordflow}{else}
465             \{
466                 \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ ) 
467                 \{
468                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
469                     
470                     \textcolor{keywordflow}{for} ( ni = 0; ni < mt; ni++ ) 
471                     \{
472                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ni );
473                         
474 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
475 \textcolor{preprocessor}{                                inout( TILE\_B[ni][ki] ) \(\backslash\)}
476 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
477 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
478 \textcolor{preprocessor}{                                label( dtrmm )}
479                         cblas\_dtrmm( CblasRowMajor,
480                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
481                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
482                                      ( CBLAS\_DIAG ) DIAG,
483                                      tile\_size\_n, 
484                                      tile\_size\_k,
485                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
486                                             TILE\_B[ni][ki], tile\_size\_k );
487                         
488                         \textcolor{keywordflow}{for} ( mi = ki+1; mi < nt; mi++ ) 
489                         \{   
490                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
491                             
492 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_B[ni][mi] ) \(\backslash\)}
493 \textcolor{preprocessor}{                                    in( TILE\_A[ki][mi] ) \(\backslash\)}
494 \textcolor{preprocessor}{                                    inout( TILE\_B[ni][ki] ) \(\backslash\)}
495 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
496 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
497 \textcolor{preprocessor}{                                    label( dgemm )}
498                             cblas\_dgemm( CblasRowMajor,
499                                          CblasNoTrans, CblasTrans,
500                                          tile\_size\_n, 
501                                          tile\_size\_k, 
502                                          tile\_size\_m,
503                                          ALPHA, TILE\_B[ni][mi],  tile\_size\_m,
504                                                 TILE\_A[ki][mi],  tile\_size\_m,
505                                          1.0,   TILE\_B[ni][ki],  tile\_size\_k ); 
506                         \}
507                     \}
508                 \}
509             \}
510         \}
511         \textcolor{comment}{// --SIDE = Right & UPLO = Lower & TRANS\_A = NoTrans--  }
512         \textcolor{keywordflow}{else}
513         \{
514             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
515             \{
516                 \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ ) 
517                 \{
518                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
519                     
520                     \textcolor{keywordflow}{for} ( ni = 0; ni < mt; ni++ ) 
521                     \{
522                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ni );
523                         
524 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
525 \textcolor{preprocessor}{                                inout( TILE\_B[ni][ki] ) \(\backslash\)}
526 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
527 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
528 \textcolor{preprocessor}{                                label( dtrmm )}
529                         cblas\_dtrmm( CblasRowMajor,
530                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
531                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
532                                      ( CBLAS\_DIAG ) DIAG,
533                                      tile\_size\_n, 
534                                      tile\_size\_k,
535                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
536                                             TILE\_B[ni][ki], tile\_size\_k );
537                         
538                         \textcolor{keywordflow}{for} ( mi = ki+1; mi < nt; mi++ ) 
539                         \{
540                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
541                             
542 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_B[ni][mi] ) \(\backslash\)}
543 \textcolor{preprocessor}{                                    in( TILE\_A[mi][ki] ) \(\backslash\)}
544 \textcolor{preprocessor}{                                    inout( TILE\_B[ni][ki] ) \(\backslash\)}
545 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
546 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
547 \textcolor{preprocessor}{                                    label( dgemm )}
548                             cblas\_dgemm( CblasRowMajor,
549                                          CblasNoTrans, CblasNoTrans,
550                                          tile\_size\_n, 
551                                          tile\_size\_k, 
552                                          tile\_size\_m,
553                                          ALPHA, TILE\_B[ni][mi],  tile\_size\_m,
554                                                 TILE\_A[mi][ki],  tile\_size\_k,
555                                          1.0,   TILE\_B[ni][ki],  tile\_size\_k );
556                         \}
557                     \}
558                 \}
559             \}
560             \textcolor{comment}{// --SIDE = Right & UPLO = Lower & TRANS\_A = Trans--  }
561             \textcolor{keywordflow}{else} 
562             \{
563                 \textcolor{keywordflow}{for} ( ki = nt-1; ki > -1; ki-- ) 
564                 \{
565                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
566                     
567                     \textcolor{keywordflow}{for} ( ni = 0; ni < mt; ni++ ) 
568                     \{
569                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ni );
570                         
571 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
572 \textcolor{preprocessor}{                                inout( TILE\_B[ni][ki] ) \(\backslash\)}
573 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
574 \textcolor{preprocessor}{                                firstprivate( ki, ni ) \(\backslash\)}
575 \textcolor{preprocessor}{                                label( dtrmm )}
576                         cblas\_dtrmm( CblasRowMajor,
577                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
578                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
579                                      ( CBLAS\_DIAG ) DIAG,
580                                      tile\_size\_n, 
581                                      tile\_size\_k,
582                                      ALPHA, TILE\_A[ki][ki], tile\_size\_k,
583                                             TILE\_B[ni][ki], tile\_size\_k );
584                         
585                         \textcolor{keywordflow}{for} ( mi = 0; mi < ki; mi++ ) 
586                         \{
587                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
588                             
589 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_B[ni][mi] ) \(\backslash\)}
590 \textcolor{preprocessor}{                                    in( TILE\_A[ki][mi] ) \(\backslash\)}
591 \textcolor{preprocessor}{                                    inout( TILE\_B[ni][ki] ) \(\backslash\)}
592 \textcolor{preprocessor}{                                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
593 \textcolor{preprocessor}{                                    firstprivate( ki, mi, ni ) \(\backslash\)}
594 \textcolor{preprocessor}{                                    label( dgemm )}
595                             cblas\_dgemm( CblasRowMajor,
596                                          CblasNoTrans, CblasTrans,
597                                          tile\_size\_n, 
598                                          tile\_size\_k, 
599                                          tile\_size\_m,
600                                          ALPHA, TILE\_B[ni][mi],  tile\_size\_m,
601                                                 TILE\_A[ki][mi],  tile\_size\_m,
602                                          1.0,   TILE\_B[ni][ki],  tile\_size\_k );
603                         \}
604                     \}
605                 \}
606             \}
607         \}
608     \}
609 
610     \textcolor{comment}{/*********************************************}
611 \textcolor{comment}{     --From tiled data layout to flat data layout-- }
612 \textcolor{comment}{     *********************************************/}
613 
614     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( M, N, B, LDB, Bm, Bn, TILE\_B );
615 
616     \textcolor{comment}{// --Tile matrices free--}
617     free( TILE\_A );
618     free( TILE\_B );
619 
620     \textcolor{keywordflow}{return} Success;
621 
622 \}
\end{DoxyCode}
