\hypertarget{kdsyr2k_8c}{}\section{src/kdsyr2k.c File Reference}
\label{kdsyr2k_8c}\index{src/kdsyr2k.\+c@{src/kdsyr2k.\+c}}


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


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


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss kdsyr2k 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-\/02-\/21   
\end{DoxyDate}


\subsection{Function Documentation}
\index{kdsyr2k.\+c@{kdsyr2k.\+c}!kdsyr2k@{kdsyr2k}}
\index{kdsyr2k@{kdsyr2k}!kdsyr2k.\+c@{kdsyr2k.\+c}}
\subsubsection[{\texorpdfstring{kdsyr2k(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, int N, int K, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B, const double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{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)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdsyr2k (
\begin{DoxyParamCaption}
\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\+NS, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB, }
\item[{const double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{kdsyr2k_8c_a2ef29953763cd105a69a3c8db2adc1b3}{}\label{kdsyr2k_8c_a2ef29953763cd105a69a3c8db2adc1b3}
Performs one of the symmetric rank 2k operations\+: \begin{DoxyVerb}C = ALPHA * A * B**T + ALPHA * B * A**T + BETA * C or
C = ALPHA * A**T * B + ALPHA * B**T * A + BETA * C
\end{DoxyVerb}


A\+L\+P\+HA and B\+E\+TA are scalars, C is an N by N symmetric matrix and A and B are N by K matrices in the first case and K by N matrices in the second case. 
\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 in which C is stored\+:
\begin{DoxyItemize}
\item Lower\+: Lower triangular part of C is stored. The upper traingular part is not referenced.
\item Upper\+: Upper triangular part of C is stored. The lower triangular part is not referenced.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em T\+R\+A\+NS} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+NS specifies the operation to be performed as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: C = A\+L\+P\+HA $\ast$ A $\ast$ B$\ast$$\ast$T + A\+L\+P\+HA $\ast$ B $\ast$ A$\ast$$\ast$T + B\+E\+TA $\ast$ C
\item Trans\+: C = A\+L\+P\+HA $\ast$ A$\ast$$\ast$T $\ast$ B + A\+L\+P\+HA $\ast$ B$\ast$$\ast$T $\ast$ A + B\+E\+TA $\ast$ C
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the order of matrix C. N must be at least zero.\\
\hline
\mbox{\tt in}  & {\em K} & int. With T\+R\+A\+NS = No\+Trans, K specifies the number of columns of the matrices A and B, and with T\+R\+A\+NS = Trans, K specifies the number of rows of the matrices A and B. K 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 Na ( rows ) by Ka ( columns ), where Na is N and Ka is K when T\+R\+A\+NS = No\+Trans, and Na is K and Ka is N otherwise.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). When T\+R\+A\+NS = No\+Trans then L\+DA must be at least max( 1, K ), otherwise L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension Nb ( rows ) by Kb ( columns ), where Nb is N and Kb is K when T\+R\+A\+NS = No\+Trans, and Nb is K and Kb is N otherwise.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). When T\+R\+A\+NS = No\+Trans then L\+DB must be at least max( 1, K ), otherwise L\+DB must be at least max( 1, N ).\\
\hline
\mbox{\tt in}  & {\em B\+E\+TA} & double. B\+E\+TA specifies the scalar beta.\\
\hline
\mbox{\tt in,out}  & {\em C} & double $\ast$. C is a pointer to a matrix of dimension N by N. When U\+P\+LO = Uppper the strictly lower triangular part of C is not referenced. On exit, the upper triangular part of C is overwritten by the upper triangular part of the updated solution matrix C. When U\+P\+LO = Lower the strictly upper triangular part of C is not referenced. On exit, the lower triangular part of C is overwritten by the lower triangular part of the updated solution matrix C.\\
\hline
\mbox{\tt in}  & {\em L\+DC} & int. L\+DC specifies the number of columns of C ( row-\/major order ). L\+DC 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} 

\hyperlink{lass_8h_a7a0f7b98f2430148a5f99fc403309816}{ddss\+\_\+dsymtiled2flat} 
\end{DoxySeeAlso}


Definition at line 124 of file kdsyr2k.\+c.



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



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


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