\hypertarget{kdsymm_8c}{}\section{src/kdsymm.c File Reference}
\label{kdsymm_8c}\index{src/kdsymm.\+c@{src/kdsymm.\+c}}


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


{\ttfamily \#include \char`\"{}../include/lass.\+h\char`\"{}}\\*
Include dependency graph for kdsymm.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{kdsymm_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{kdsymm_8c_a90d0704ec71cf332ce1c55aa29904456}{kdsymm} (enum D\+D\+S\+S\+\_\+\+S\+I\+DE S\+I\+DE, enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int M, int N, 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 kdsymm 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}
2017-\/08-\/11   
\end{DoxyDate}


\subsection{Function Documentation}
\index{kdsymm.\+c@{kdsymm.\+c}!kdsymm@{kdsymm}}
\index{kdsymm@{kdsymm}!kdsymm.\+c@{kdsymm.\+c}}
\subsubsection[{\texorpdfstring{kdsymm(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, 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, const double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{kdsymm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdsymm (
\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[{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, }
\item[{const double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{kdsymm_8c_a90d0704ec71cf332ce1c55aa29904456}{}\label{kdsymm_8c_a90d0704ec71cf332ce1c55aa29904456}
Performs one of the matrix-\/matrix operations\+: \begin{DoxyVerb}C = ALPHA * A * B + BETA * C
\end{DoxyVerb}
 or \begin{DoxyVerb}C = ALPHA * B * A + BETA * C
\end{DoxyVerb}


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


A\+L\+P\+HA and B\+E\+TA are scalars, A is a symmetric matrix, and B and C are M by N matrices.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em S\+I\+DE} & enum D\+D\+S\+S\+\_\+\+S\+I\+DE. U\+P\+LO specifies the position of the symmetric A matrix in the operation\+:
\begin{DoxyItemize}
\item Left\+: C = A\+L\+P\+HA $\ast$ A $\ast$ B + B\+E\+TA $\ast$ C
\item Right\+: C = A\+L\+P\+HA $\ast$ B $\ast$ A + B\+E\+TA $\ast$ C
\end{DoxyItemize}\\
\hline
\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 M} & int. M specifies the number of rows of the matrix C. M must be equal or greater than zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix C. N must be equal or greater than zero.\\
\hline
\mbox{\tt in}  & {\em A\+L\+P\+HA} & double.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to a matrix of dimension Ma ( rows ) by Na (columns), where Ma is M and Na is M when S\+I\+DE = Left, and Ma is N and Na is N when S\+I\+DE = Right\\
\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, Na ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension M by N.\\
\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
\mbox{\tt in}  & {\em B\+E\+TA} & double.\\
\hline
\mbox{\tt in,out}  & {\em C} & double $\ast$. C is a pointer to a matrix of dimension M by N. On exit, C is overwritten by the M by N matrix.\\
\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} & sucessful exit \\
\hline
{\em No\+Success} & unsucessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a05b6048b892d062d5656ff6e2f57fed9}{ddss\+\_\+dgemm} 

ddss\+\_\+tile 

ddss\+\_\+flat2tiled 

ddss\+\_\+symflat2tiled 

ddss\+\_\+tiled2flat 

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


Definition at line 125 of file kdsymm.\+c.



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



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


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