\hypertarget{lass_8h}{}\section{include/lass.h File Reference}
\label{lass_8h}\index{include/lass.\+h@{include/lass.\+h}}


L\+A\+Ss header definition.  


{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include $<$string.\+h$>$}\\*
{\ttfamily \#include $<$assert.\+h$>$}\\*
{\ttfamily \#include $<$float.\+h$>$}\\*
{\ttfamily \#include $<$sys/time.\+h$>$}\\*
{\ttfamily \#include $<$math.\+h$>$}\\*
{\ttfamily \#include $<$time.\+h$>$}\\*
{\ttfamily \#include $<$unistd.\+h$>$}\\*
{\ttfamily \#include $<$cblas.\+h$>$}\\*
{\ttfamily \#include $<$lapacke.\+h$>$}\\*
{\ttfamily \#include \char`\"{}../mmsparse/mm\+\_\+io.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}lass\+\_\+macros.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}lass\+\_\+types.\+h\char`\"{}}\\*
Include dependency graph for lass.\+h\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{lass_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{lass_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{lass_8h_a05b6048b892d062d5656ff6e2f57fed9}{ddss\+\_\+dgemm} (enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+B, int M, int N, int K, double A\+L\+P\+HA, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB, double B\+E\+TA, double $\ast$C, int L\+DC)
\item 
int \hyperlink{lass_8h_ac44ec86fd98b217ac8a71c84b1aa5f14}{ddss\+\_\+dsymm} (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, double A\+L\+P\+HA, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB, double B\+E\+TA, double $\ast$C, int L\+DC)
\item 
int \hyperlink{lass_8h_a0f0421e7581b000ae1833415b7e0efc5}{ddss\+\_\+dtrsm} (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)
\item 
int \hyperlink{lass_8h_ac418e7d435cba3c169e5e75ad42ffbdd}{ddss\+\_\+dtrmm} (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)
\item 
int \hyperlink{lass_8h_a60f62b1e38c14cf41be017ce9597eec4}{ddss\+\_\+dsyrk} (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, int N, int K, const double A\+L\+P\+HA, double $\ast$A, int L\+DA, const double B\+E\+TA, double $\ast$C, int L\+DC)
\item 
int \hyperlink{lass_8h_a0bd18e3495c9d8ab6ae463389a2b00bf}{ddss\+\_\+dsyr2k} (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)
\item 
int \hyperlink{lass_8h_a665c631275c07b1dc9554d982e493a5e}{ddss\+\_\+dnpgetrf} (int M, int N, double $\ast$A, int L\+DA)
\item 
int \hyperlink{lass_8h_ad21539b1f38a7441366db0c1ebabf96b}{ddss\+\_\+dnpgesv} (int N, int N\+R\+HS, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB)
\item 
int \hyperlink{lass_8h_a2a27faa0f25c3984472766a8a310d923}{ddss\+\_\+dtpgetrf} (int M, int N, double $\ast$A, int L\+DA, int $\ast$ipiv)
\item 
int \hyperlink{lass_8h_adcc6575c28b21fe5c6486fff97d90aa9}{ddss\+\_\+dtpgesv} (int N, int N\+R\+HS, double $\ast$A, int L\+DA, int $\ast$I\+P\+IV, double $\ast$B, int L\+DB)
\item 
int \hyperlink{lass_8h_a7b849eccd797212a1ce50ee598bde5e2}{ddss\+\_\+dpotrf} (enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int N, double $\ast$A, int L\+DA)
\item 
int \hyperlink{lass_8h_ae6277290e221b3626ae93091fede2d5f}{ddss\+\_\+dposv} (enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int N, int N\+R\+HS, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a1b27a37a58ea181d1e5f7eb91c6e0b58}{kdgemm} (enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS T\+R\+A\+N\+S\+\_\+B, int M, 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)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_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)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_addfda795c19230c16da674648de83a5c}{kdtrsm} (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)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_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)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a8ffc4fc508b14a7ccda98be54ded18bc}{kdsyrk} (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, int N, int K, const double A\+L\+P\+HA, double $\ast$A, int L\+DA, const double B\+E\+TA, double $\ast$C, int L\+DC)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_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)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_aad8c6b9542e74c481faff1ff5e03850f}{kdnpgetrf} (int M, int N, double $\ast$A, int L\+DA)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a4ca30528b6350dafb182059e8ef46a97}{kdnpgesv} (int N, int N\+R\+HS, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a78d204c4ad618df9e1d81e0668bc2149}{kdtpgetrf} (int M, int N, double $\ast$A, int L\+DA, int $\ast$ipiv)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_aa8b24e76e50652c68471955338c4e1b9}{kdtpgesv} (int N, int N\+R\+HS, double $\ast$A, int L\+DA, int $\ast$I\+P\+IV, double $\ast$B, int L\+DB)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a561483d08d424c9a13076e0ae998cabd}{kdpotrf} (enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int N, double $\ast$A, int L\+DA)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_ad9d439560ff8b96c5fdd6aa4ead8176f}{kdposv} (enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO, int N, int N\+R\+HS, double $\ast$A, int L\+DA, double $\ast$B, int L\+DB)
\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN \hyperlink{lass_8h_a90f43bdc154edb1979f7ffce22e142ff}{dnpgetrf} (int M, int N, double $\ast$A, int L\+DA)
\item 
int \hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} (int M, int MT)
\item 
void \hyperlink{lass_8h_ab411e9b05a203c7905f0285ef4200a9e}{ddss\+\_\+dflat2tiled} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]})
\item 
void \hyperlink{lass_8h_a7a0f7b98f2430148a5f99fc403309816}{ddss\+\_\+dsymtiled2flat} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]}, enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO)
\item 
void \hyperlink{lass_8h_a441af0ede62f194937af25f0c8f18736}{ddss\+\_\+dgather\+\_\+tile} (int M, int N, double $\ast$A, int L\+DA, double $\ast$T\+I\+L\+E\+\_\+A, int M\+ID, int N\+ID)
\item 
void \hyperlink{lass_8h_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\+\_\+dtiled2flat} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]})
\item 
void \hyperlink{lass_8h_adb1f9312d77184467236d25bc73f21b0}{ddss\+\_\+dtiled2flat\+\_\+nb} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]})
\item 
void \hyperlink{lass_8h_afc5c48ad2172946afab6c9e989c4e81a}{ddss\+\_\+dsymflat2tiled} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]}, enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO)
\item 
void \hyperlink{lass_8h_a9089190fbb27ac8ceaaaa558ab2f5e37}{ddss\+\_\+dsymtiled2flat\+\_\+nb} (int M, int N, double $\ast$A, int L\+DA, int MT, int NT, double($\ast$T\+I\+L\+E\+\_\+A)\mbox{[}NT\mbox{]}\mbox{[}T\+I\+L\+E\+\_\+\+S\+I\+ZE $\ast$T\+I\+L\+E\+\_\+\+S\+I\+ZE\mbox{]}, enum D\+D\+S\+S\+\_\+\+U\+P\+LO U\+P\+LO)
\item 
void \hyperlink{lass_8h_a7f57f81b35bf76a41998f387c9afd541}{ddss\+\_\+dscatter\+\_\+tile} (int M, int N, double $\ast$A, int L\+DA, double $\ast$T\+I\+L\+E\+\_\+A, int M\+ID, int N\+ID)
\item 
int {\bfseries dsss\+\_\+dgtsv} (int N, double $\ast$DL, double $\ast$D, double $\ast$DU, double $\ast$R\+HS)\hypertarget{lass_8h_a93543321ff9c0661080a08df60302f4a}{}\label{lass_8h_a93543321ff9c0661080a08df60302f4a}

\item 
int {\bfseries dsss\+\_\+dspmv} (int M, int N, double A\+L\+P\+HA, const double $\ast$V\+A\+L\+\_\+A, const int $\ast$R\+O\+W\+\_\+\+P\+T\+R\+\_\+A, const int $\ast$C\+O\+L\+\_\+\+I\+N\+D\+\_\+A, const double $\ast$X, double B\+E\+TA, double $\ast$Y)\hypertarget{lass_8h_aec548f997a33fae17175ee88cd96d2c1}{}\label{lass_8h_aec548f997a33fae17175ee88cd96d2c1}

\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN {\bfseries kdgtsv} (int N, double $\ast$DL, double $\ast$D, double $\ast$DU, double $\ast$R\+HS)\hypertarget{lass_8h_a198121a06ceca30f8289bc2cdb1f3ba6}{}\label{lass_8h_a198121a06ceca30f8289bc2cdb1f3ba6}

\item 
enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN {\bfseries kdspmv} (int M, int N, double A\+L\+P\+HA, const double $\ast$V\+A\+L\+\_\+A, const int $\ast$R\+O\+W\+\_\+\+P\+T\+R\+\_\+A, const int $\ast$C\+O\+L\+\_\+\+I\+N\+D\+\_\+A, const double $\ast$X, double B\+E\+TA, double $\ast$Y)\hypertarget{lass_8h_a43b0af9ec233d09d10ea268d78188f85}{}\label{lass_8h_a43b0af9ec233d09d10ea268d78188f85}

\item 
void {\bfseries dgtsvseq} (int N, double $\ast$DL, double $\ast$D, double $\ast$DU, double $\ast$R\+HS)\hypertarget{lass_8h_a805150c07fa2f30ea8e296bf4b8d748e}{}\label{lass_8h_a805150c07fa2f30ea8e296bf4b8d748e}

\item 
void \hyperlink{lass_8h_a370e9cd2de50f704173265423d33d289}{dspmvseq} (int M, int N, double A\+L\+P\+HA, const double $\ast$V\+A\+L\+\_\+A, const int $\ast$R\+O\+W\+\_\+\+P\+T\+R\+\_\+A, const int $\ast$C\+O\+L\+\_\+\+I\+N\+D\+\_\+A, const double $\ast$X, double B\+E\+TA, double $\ast$Y)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
L\+A\+Ss header definition. 

L\+A\+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-\/09-\/07   
\end{DoxyDate}


\subsection{Function Documentation}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dflat2tiled@{ddss\+\_\+dflat2tiled}}
\index{ddss\+\_\+dflat2tiled@{ddss\+\_\+dflat2tiled}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dflat2tiled(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE])}{ddss_dflat2tiled(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dflat2tiled (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_ab411e9b05a203c7905f0285ef4200a9e}{}\label{lass_8h_ab411e9b05a203c7905f0285ef4200a9e}
ddss\+\_\+dflat2tiled\+: Performs the change of the data layout from flat layout to tiled layout according to row-\/major order.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in,out}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{ddss\+\_\+dgather\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 68 of file ddss\+\_\+flat2tiled.\+c.



References ddss\+\_\+dgather\+\_\+tile().



Referenced by kdgemm(), kdnpgesv(), kdnpgetrf(), kdposv(), kdsymm(), kdsyr2k(), kdsyrk(), kdtpgesv(), kdtpgetrf(), kdtrmm(), and kdtrsm().


\begin{DoxyCode}
70 \{
71     
72     \textcolor{comment}{// Local variables}
73     \textcolor{keywordtype}{int} m, n;
74     
75     \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
76     \{
77         \textcolor{keywordflow}{for} ( n = 0; n < NT; n++ )
78         \{
79 \textcolor{preprocessor}{            #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
80 \textcolor{preprocessor}{            label( dflat2tiled )}
81             \{ 
82                 \hyperlink{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{ddss\_dgather\_tile}( M, N, &A[m * TILE\_SIZE * N + n * TILE\_SIZE], 
83                     LDA, TILE\_A[m][n], m, n );
84             \}
85         \}
86     \}
87 
88 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dgather\+\_\+tile@{ddss\+\_\+dgather\+\_\+tile}}
\index{ddss\+\_\+dgather\+\_\+tile@{ddss\+\_\+dgather\+\_\+tile}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dgather\+\_\+tile(int M, int N, double $\ast$\+A, int L\+D\+A, double $\ast$\+T\+I\+L\+E\+\_\+\+A, int M\+I\+D, int N\+I\+D)}{ddss_dgather_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dgather\+\_\+tile (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{T\+I\+L\+E\+\_\+A, }
\item[{int}]{M\+ID, }
\item[{int}]{N\+ID}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a441af0ede62f194937af25f0c8f18736}{}\label{lass_8h_a441af0ede62f194937af25f0c8f18736}
ddss\+\_\+dgather\+\_\+tile\+: Performs the copy of a tile from the flat matrix A to the tile matrix T\+I\+L\+E\+\_\+A for the MT, NT tile.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in,out}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\hline
\mbox{\tt in}  & {\em M\+ID} & int. M\+ID specifies the row id of the tile.\\
\hline
\mbox{\tt in}  & {\em N\+ID} & int. N\+ID specifies the column id of the tile.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 

\hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\+\_\+dflat2tiled} 
\end{DoxySeeAlso}


Definition at line 238 of file ddss\+\_\+flat2tiled.\+c.



References ddss\+\_\+tile\+\_\+size().



Referenced by ddss\+\_\+dflat2tiled(), and ddss\+\_\+dsymflat2tiled().


\begin{DoxyCode}
240 \{
241 
242     \textcolor{comment}{//Local variables}
243     \textcolor{keywordtype}{int} i, j;
244     \textcolor{keywordtype}{int} tile\_size\_m, tile\_size\_n;
245      
246     tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, MID );
247     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, NID );
248 
249     \textcolor{keywordflow}{for} ( i = 0; i < tile\_size\_m; i++ )
250     \{
251         \textcolor{keywordflow}{for} ( j = 0; j < tile\_size\_n; j++ )
252         \{
253             TILE\_A[i * tile\_size\_n + j] = A[i * LDA + j];
254         \}
255     \}
256 
257 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dgemm@{ddss\+\_\+dgemm}}
\index{ddss\+\_\+dgemm@{ddss\+\_\+dgemm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dgemm(enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+B, int M, int N, int K, double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B, double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{ddss_dgemm(enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B, int M, int N, int K, double ALPHA, double *A, int LDA, double *B, int LDB, double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dgemm (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+A, }
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+B, }
\item[{int}]{M, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB, }
\item[{double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a05b6048b892d062d5656ff6e2f57fed9}{}\label{lass_8h_a05b6048b892d062d5656ff6e2f57fed9}
Performs the matrix-\/matrix operation\+: \begin{DoxyVerb}C = ALPHA * op( A ) * op( B ) + 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, and A, B and C are matrices, with op( A ) an M by K matrix, op( B ) a K by N matrix and C an M by N matrix.


\begin{DoxyParams}[1]{Parameters}
\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 in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( A ) = A.
\item Trans\+: op( A ) = A$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em T\+R\+A\+N\+S\+\_\+B} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+B specifies the form of op( B ) to be used in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( B ) = B.
\item Trans\+: op( B ) = B$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A and the number of rows of the matrix C. M must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix B and the number of columns of the matrix C. N must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em K} & int. K specifies the number of columns of the matrix A and the number of rows of the matrix B. K must be 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 Ka ( columns ), where Ma is M and Ka is K when T\+R\+A\+N\+S\+\_\+A = No\+Trans, and Ma is K and Ka is M 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\+N\+S\+\_\+A = No\+Trans then L\+DA must be at least max( 1, K ), otherwise L\+DA must be at least max( 1, M ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension Kb ( rows ) by Nb ( columns ), where Kb is K and Nb is N when T\+R\+A\+N\+S\+\_\+B = No\+Trans, and Kb is N and Nb is K 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\+N\+S\+\_\+B = No\+Trans then L\+DB must be at least max( 1, N ), otherwise L\+DB must be at least max( 1, K ).\\
\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 ( A\+L\+P\+H\+A$\ast$op( A )$\ast$op( B ) + B\+E\+T\+A$\ast$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}
\hyperlink{lass_8h_a1b27a37a58ea181d1e5f7eb91c6e0b58}{kdgemm} 
\end{DoxySeeAlso}


Definition at line 128 of file ddss\+\_\+dgemm.\+c.



References kdgemm().


\begin{DoxyCode}
133 \{
134     
135     \textcolor{comment}{// Local variables}
136     \textcolor{keywordtype}{int} An, Bn;  
137     
138     \textcolor{comment}{// Argument checking}
139     \textcolor{keywordflow}{if} ( ( TRANS\_A != NoTrans ) && ( TRANS\_A != Trans ) )
140     \{
141         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_A, in ddss\_dgemm code\(\backslash\)n"} );
142         \textcolor{keywordflow}{return} NoSuccess;
143     \}
144 
145     \textcolor{keywordflow}{if} ( ( TRANS\_B != NoTrans ) && ( TRANS\_B != Trans ) )
146     \{
147         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_B, in ddss\_dgemm code\(\backslash\)n"} );
148         \textcolor{keywordflow}{return} NoSuccess;
149     \}
150 
151     \textcolor{keywordflow}{if} ( M < 0 )
152     \{
153         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dgemm code\(\backslash\)n"} );
154         \textcolor{keywordflow}{return} NoSuccess;
155     \}
156     
157     \textcolor{keywordflow}{if} ( N < 0 )
158     \{
159         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dgemm code\(\backslash\)n"} );
160         \textcolor{keywordflow}{return} NoSuccess;
161     \}
162     
163     \textcolor{keywordflow}{if} ( K < 0 )
164     \{
165         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of K, in ddss\_dgemm code\(\backslash\)n"} );
166         \textcolor{keywordflow}{return} NoSuccess;
167     \}
168     
169     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
170     \{
171         An = K;
172     \}   
173     \textcolor{keywordflow}{else}
174     \{
175         An = M;
176     \}
177 
178     \textcolor{keywordflow}{if} ( LDA < MAX( 1, An ) )
179     \{
180         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dgemm code\(\backslash\)n"} );    
181         \textcolor{keywordflow}{return} NoSuccess;
182     \}
183 
184     \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
185     \{
186         Bn = N;
187     \}   
188     \textcolor{keywordflow}{else}
189     \{
190         Bn = K;
191     \}
192 
193     \textcolor{keywordflow}{if} ( LDB < MAX( 1, Bn ) )
194     \{
195         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dgemm code\(\backslash\)n"} );    
196         \textcolor{keywordflow}{return} NoSuccess;
197     \}
198 
199     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) )
200     \{
201         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dgemm code\(\backslash\)n"} );    
202         \textcolor{keywordflow}{return} NoSuccess;
203     \}
204 
205     \textcolor{comment}{// Quick return}
206     \textcolor{keywordflow}{if} ( M == 0 || N == 0 || ( ( ALPHA == 0.0 || K == 0 ) && BETA == 1.0 ) )
207     \{
208         \textcolor{keywordflow}{return} Success;
209     \}   
210 
211     \textcolor{keywordflow}{return} \hyperlink{kdgemm_8c_a1b27a37a58ea181d1e5f7eb91c6e0b58}{kdgemm}( TRANS\_A, TRANS\_B, M, N, K, 
212                     (\textcolor{keyword}{const} \textcolor{keywordtype}{double}) ALPHA, A, LDA, 
213                                           B, LDB, 
214                     (\textcolor{keyword}{const} \textcolor{keywordtype}{double})  BETA, C, LDC );
215     
216 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dnpgesv@{ddss\+\_\+dnpgesv}}
\index{ddss\+\_\+dnpgesv@{ddss\+\_\+dnpgesv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dnpgesv(int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{ddss_dnpgesv(int N, int NRHS, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dnpgesv (
\begin{DoxyParamCaption}
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_ad21539b1f38a7441366db0c1ebabf96b}{}\label{lass_8h_ad21539b1f38a7441366db0c1ebabf96b}
Solves a system of linear equations A  X = B, where A is a N-\/by-\/N general matrix and X and B are N-\/by-\/\+N\+R\+HS matrices. The matrix A is factorized using the LU descomposition without pivoting. The matrix A is descomposed as\+: \begin{DoxyVerb}A = L * U
\end{DoxyVerb}


where L is a lower triangular matrix with unit diagonal elements and U is an upper triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em N} & int. N specifies the order of the square matrix A. N $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N\+R\+HS} & int. N\+R\+HS specifies the number of right-\/hand-\/sides (number of columns of B). N\+R\+HS $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension N-\/by-\/\+L\+DA. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension N by N\+R\+HS, which stores the right-\/hand-\/sides of the systems of linear equations. (row-\/major order). On exit, if return value is Success, the matrix B is overwriten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N\+R\+H\+S ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a4ca30528b6350dafb182059e8ef46a97}{kdnpgesv} 
\end{DoxySeeAlso}


Definition at line 84 of file ddss\+\_\+dnpgesv.\+c.



References kdnpgesv().


\begin{DoxyCode}
87 \{
88 
89     \textcolor{comment}{// Argument checking}
90     \textcolor{keywordflow}{if} ( N < 0 )
91     \{
92         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dnpgesv code\(\backslash\)n"} );
93         \textcolor{keywordflow}{return} NoSuccess;
94     \}
95     
96     \textcolor{keywordflow}{if} ( NRHS < 0 )
97     \{
98         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of NRHS, in ddss\_dnpgesv code\(\backslash\)n"} );
99         \textcolor{keywordflow}{return} NoSuccess;
100     \}
101 
102     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
103     \{
104         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dnpgesv code\(\backslash\)n"} );
105         \textcolor{keywordflow}{return} NoSuccess;
106     \}
107 
108     \textcolor{keywordflow}{if} ( LDB < MAX( 1, NRHS ) )
109     \{
110         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dnpgesv code\(\backslash\)n"} );
111         \textcolor{keywordflow}{return} NoSuccess;
112     \}
113 
114     \textcolor{comment}{// Quick return}
115     \textcolor{keywordflow}{if} ( MAX( N, 0 ) == 0 || MAX( NRHS, 0 ) == 0 )
116     \{
117         \textcolor{keywordflow}{return} Success;
118     \}
119     
120     \textcolor{keywordflow}{return} \hyperlink{kdnpgesv_8c_a4ca30528b6350dafb182059e8ef46a97}{kdnpgesv}( N, NRHS, A, LDA, B, LDB );
121     
122 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dnpgetrf@{ddss\+\_\+dnpgetrf}}
\index{ddss\+\_\+dnpgetrf@{ddss\+\_\+dnpgetrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dnpgetrf(int M, int N, double $\ast$\+A, int L\+D\+A)}{ddss_dnpgetrf(int M, int N, double *A, int LDA)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dnpgetrf (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a665c631275c07b1dc9554d982e493a5e}{}\label{lass_8h_a665c631275c07b1dc9554d982e493a5e}
Performs the LU factorization without pivoting of a general M-\/by-\/N matrix A\+: \begin{DoxyVerb}A = L * U
\end{DoxyVerb}


where L is a lower triangular ( lower trapezoidal if M $>$ N ) matrix with unit diagonal elements and U is an upper triangular ( upper trapezoidal if M $<$ N ) matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A. M $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix A. N $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension M-\/by-\/N. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\end{DoxyParams}

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


Definition at line 70 of file ddss\+\_\+dnpgetrf.\+c.



References kdnpgetrf().


\begin{DoxyCode}
71 \{
72 
73     \textcolor{comment}{// Argument checking}
74     \textcolor{keywordflow}{if} ( M < 0 )
75     \{
76         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dnpgetrf code\(\backslash\)n"} );
77         \textcolor{keywordflow}{return} NoSuccess;
78     \}
79 
80     \textcolor{keywordflow}{if} ( N < 0 )
81     \{
82         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dnpgetrf code\(\backslash\)n"} );
83         \textcolor{keywordflow}{return} NoSuccess;
84     \}
85 
86     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
87     \{
88         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dnpgetrf code\(\backslash\)n"} );
89         \textcolor{keywordflow}{return} NoSuccess;
90     \}
91 
92     \textcolor{comment}{// Qick return}
93     \textcolor{keywordflow}{if} ( MIN( M, N ) == 0 )
94     \{
95         \textcolor{keywordflow}{return} Success;
96     \}
97 
98     \textcolor{keywordflow}{return} \hyperlink{kdnpgetrf_8c_aad8c6b9542e74c481faff1ff5e03850f}{kdnpgetrf}( M, N, A, LDA );
99 
100 \} 
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dposv@{ddss\+\_\+dposv}}
\index{ddss\+\_\+dposv@{ddss\+\_\+dposv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dposv(enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{ddss_dposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dposv (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_ae6277290e221b3626ae93091fede2d5f}{}\label{lass_8h_ae6277290e221b3626ae93091fede2d5f}
Solves a system of linear equations A  X = B, where A is a m-\/by-\/m simmetric positive definite matrix and X and B are m-\/by-\/nrhs matrices. The matrix A is descomposed as\+: \begin{DoxyVerb}A = L \times L^T
or
A = U^T \times U
\end{DoxyVerb}


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


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

\begin{DoxyRetVals}{Return values}
{\em Success} & sucessful exit \\
\hline
{\em No\+Success} & unsucessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_ad9d439560ff8b96c5fdd6aa4ead8176f}{kdposv} 
\end{DoxySeeAlso}


Definition at line 92 of file ddss\+\_\+dposv.\+c.



References kdposv().


\begin{DoxyCode}
96 \{
97 
98     \textcolor{comment}{// Argument checking}
99     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) )
100     \{
101         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dposv code\(\backslash\)n"} );
102         \textcolor{keywordflow}{return} NoSuccess;
103     \}
104     
105     \textcolor{keywordflow}{if} ( N < 0 )
106     \{
107         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dposv code\(\backslash\)n"} );
108         \textcolor{keywordflow}{return} NoSuccess;
109     \}
110     
111     \textcolor{keywordflow}{if} ( NRHS < 0 )
112     \{
113         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of NRHS, in ddss\_dposv code\(\backslash\)n"} );
114         \textcolor{keywordflow}{return} NoSuccess;
115     \}
116 
117     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
118     \{
119         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dposv code\(\backslash\)n"} );
120         \textcolor{keywordflow}{return} NoSuccess;
121     \}
122 
123     \textcolor{keywordflow}{if} ( LDB < MAX( 1, NRHS ) )
124     \{
125         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dposv code\(\backslash\)n"} );
126         \textcolor{keywordflow}{return} NoSuccess;
127     \}
128 
129     \textcolor{comment}{// Quick return}
130     \textcolor{keywordflow}{if} ( MAX( N, 0 ) == 0 || MAX( NRHS, 0 ) == 0 )
131     \{
132         \textcolor{keywordflow}{return} Success;
133     \}
134     
135     \textcolor{keywordflow}{return} \hyperlink{kdposv_8c_ad9d439560ff8b96c5fdd6aa4ead8176f}{kdposv}( UPLO, N, NRHS, A, LDA, B, LDB );
136     
137 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dpotrf@{ddss\+\_\+dpotrf}}
\index{ddss\+\_\+dpotrf@{ddss\+\_\+dpotrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dpotrf(enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, int N, double $\ast$\+A, int L\+D\+A)}{ddss_dpotrf(enum DDSS_UPLO UPLO, int N, double *A, int LDA)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dpotrf (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a7b849eccd797212a1ce50ee598bde5e2}{}\label{lass_8h_a7b849eccd797212a1ce50ee598bde5e2}
Performs the Cholesky factorization of a symmetric positive definite matrix A\+: \begin{DoxyVerb}A = L \times L^T
or
A = U^T \times U
\end{DoxyVerb}


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


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

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a561483d08d424c9a13076e0ae998cabd}{kdpotrf} 
\end{DoxySeeAlso}


Definition at line 74 of file ddss\+\_\+dpotrf.\+c.



References kdpotrf().


\begin{DoxyCode}
75 \{
76 
77     \textcolor{comment}{// Argument checking}
78     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) )
79     \{
80         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dportf code\(\backslash\)n"} );
81         \textcolor{keywordflow}{return} NoSuccess;
82     \}
83     
84     \textcolor{keywordflow}{if} ( N < 0 )
85     \{
86         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dportf code\(\backslash\)n"} );
87         \textcolor{keywordflow}{return} NoSuccess;
88     \}
89 
90     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
91     \{
92         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dportf code\(\backslash\)n"} );
93         \textcolor{keywordflow}{return} NoSuccess;
94     \}
95 
96     \textcolor{comment}{// Quick return}
97     \textcolor{keywordflow}{if} ( MAX( N, 0 ) == 0 )
98     \{
99         \textcolor{keywordflow}{return} Success;
100     \}
101     
102     \textcolor{keywordflow}{return} \hyperlink{kdpotrf_8c_a561483d08d424c9a13076e0ae998cabd}{kdpotrf}( UPLO, N, A, LDA );
103     
104 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dscatter\+\_\+tile@{ddss\+\_\+dscatter\+\_\+tile}}
\index{ddss\+\_\+dscatter\+\_\+tile@{ddss\+\_\+dscatter\+\_\+tile}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dscatter\+\_\+tile(int M, int N, double $\ast$\+A, int L\+D\+A, double $\ast$\+T\+I\+L\+E\+\_\+\+A, int M\+I\+D, int N\+I\+D)}{ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dscatter\+\_\+tile (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{T\+I\+L\+E\+\_\+A, }
\item[{int}]{M\+ID, }
\item[{int}]{N\+ID}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a7f57f81b35bf76a41998f387c9afd541}{}\label{lass_8h_a7f57f81b35bf76a41998f387c9afd541}
ddss\+\_\+dscatter\+\_\+tile\+: Performs the copy of a tile from the tile matrix T\+I\+L\+E\+\_\+A to the flat matrix A for the MT, NT tile.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\hline
\mbox{\tt in}  & {\em M\+ID} & int. M\+ID specifies the row id of the tile.\\
\hline
\mbox{\tt in}  & {\em N\+ID} & int. N\+ID specifies the column id of the tile.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 

\hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\+\_\+dtiled2flat} 
\end{DoxySeeAlso}


Definition at line 414 of file ddss\+\_\+tiled2flat.\+c.



References ddss\+\_\+tile\+\_\+size().



Referenced by ddss\+\_\+dsymtiled2flat(), ddss\+\_\+dsymtiled2flat\+\_\+nb(), ddss\+\_\+dtiled2flat(), and ddss\+\_\+dtiled2flat\+\_\+nb().


\begin{DoxyCode}
416 \{
417 
418     \textcolor{comment}{//Local variables}
419     \textcolor{keywordtype}{int} i, j;
420     \textcolor{keywordtype}{int} tile\_size\_m, tile\_size\_n;
421      
422     tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, MID );
423     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, NID );
424 
425     \textcolor{keywordflow}{for} ( i = 0; i < tile\_size\_m; i++ )
426     \{
427         \textcolor{keywordflow}{for} ( j = 0; j < tile\_size\_n; j++ )
428         \{
429             A[i * LDA + j] = TILE\_A[i * tile\_size\_n + j];
430         \}
431     \}
432 
433 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsymflat2tiled@{ddss\+\_\+dsymflat2tiled}}
\index{ddss\+\_\+dsymflat2tiled@{ddss\+\_\+dsymflat2tiled}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsymflat2tiled(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE], enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O)}{ddss_dsymflat2tiled(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dsymflat2tiled (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}, }
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_afc5c48ad2172946afab6c9e989c4e81a}{}\label{lass_8h_afc5c48ad2172946afab6c9e989c4e81a}
ddss\+\_\+dsymflat2tiled\+: Performs the change of the data layout from flat layout to tiled layout for symmetric matrices according to row-\/major order.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in,out}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\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
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{ddss\+\_\+dgather\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 147 of file ddss\+\_\+flat2tiled.\+c.



References ddss\+\_\+dgather\+\_\+tile().



Referenced by kdposv(), kdpotrf(), kdsymm(), kdsyr2k(), kdsyrk(), kdtrmm(), and kdtrsm().


\begin{DoxyCode}
149 \{
150     
151     \textcolor{comment}{// Local variables}
152     \textcolor{keywordtype}{int} m, n;
153 
154     \textcolor{keywordflow}{if} ( UPLO == Upper )
155     \{
156         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
157         \{
158             \textcolor{keywordflow}{for} ( n = NT-1; n >= m; n-- )
159             \{
160 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
161 \textcolor{preprocessor}{                label( dsymmflat2tiled )}
162                 \{ 
163                     \hyperlink{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{ddss\_dgather\_tile}( M, N, 
164                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], 
165                         LDA, TILE\_A[m][n], m, n );
166                 \}
167             \}
168         \}
169     \}
170     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ( UPLO == Lower )
171     \{
172         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
173         \{
174             \textcolor{keywordflow}{for} ( n = 0; n <= m; n++ )
175             \{
176 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
177 \textcolor{preprocessor}{                label( dsymmflat2tiled )}
178                 \{ 
179                     \hyperlink{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{ddss\_dgather\_tile}( M, N, 
180                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], 
181                         LDA, TILE\_A[m][n], m, n );
182                 \}
183             \}
184         \}
185     \}
186 
187 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsymm@{ddss\+\_\+dsymm}}
\index{ddss\+\_\+dsymm@{ddss\+\_\+dsymm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsymm(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, double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B, double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{ddss_dsymm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, int M, int N, double ALPHA, double *A, int LDA, double *B, int LDB, double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dsymm (
\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[{double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB, }
\item[{double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_ac44ec86fd98b217ac8a71c84b1aa5f14}{}\label{lass_8h_ac44ec86fd98b217ac8a71c84b1aa5f14}
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} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a90d0704ec71cf332ce1c55aa29904456}{kdsymm} 
\end{DoxySeeAlso}


Definition at line 120 of file ddss\+\_\+dsymm.\+c.



References kdsymm().


\begin{DoxyCode}
125 \{
126 
127     \textcolor{comment}{// Local variables}
128     \textcolor{keywordtype}{int} nA;
129 
130     \textcolor{comment}{// Argument checking}
131     \textcolor{keywordflow}{if} ( ( SIDE != Left ) && ( SIDE != Right ) )
132     \{
133         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of SIDE, in ddss\_dsymm code\(\backslash\)n"} );
134         \textcolor{keywordflow}{return} NoSuccess;
135     \}
136     
137     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) )
138     \{
139         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dsymm code\(\backslash\)n"} );
140         \textcolor{keywordflow}{return} NoSuccess;
141     \}
142 
143     \textcolor{keywordflow}{if} ( M < 0 )
144     \{
145         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dsymm code\(\backslash\)n"} );
146         \textcolor{keywordflow}{return} NoSuccess;
147     \}
148     
149     \textcolor{keywordflow}{if} ( N < 0 )
150     \{
151         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dsymm code\(\backslash\)n"} );
152         \textcolor{keywordflow}{return} NoSuccess;
153     \}
154 
155     \textcolor{comment}{// Quick return}
156     \textcolor{keywordflow}{if} ( M == 0 || N == 0 || ( ALPHA == 0.0 && BETA == 1.0 ) )
157     \{
158         \textcolor{keywordflow}{return} Success;
159     \}
160 
161     \textcolor{keywordflow}{if} ( SIDE == Left )
162     \{
163         nA = M;
164     \}
165     \textcolor{keywordflow}{else}
166     \{
167         nA = N;
168     \}   
169 
170     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) )
171     \{
172         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dsymm code\(\backslash\)n"} );    
173         \textcolor{keywordflow}{return} NoSuccess;
174     \}
175 
176     \textcolor{keywordflow}{if} ( LDB < MAX( 1, N ) )
177     \{
178         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dsymm code\(\backslash\)n"} );    
179         \textcolor{keywordflow}{return} NoSuccess;
180     \}
181     
182     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) )
183     \{
184         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dsymm code\(\backslash\)n"} );    
185         \textcolor{keywordflow}{return} NoSuccess;
186     \}
187     
188     \textcolor{keywordflow}{return} \hyperlink{kdsymm_8c_a90d0704ec71cf332ce1c55aa29904456}{kdsymm}( SIDE, UPLO, M, N,
189                     ( \textcolor{keyword}{const} \textcolor{keywordtype}{double} ) ALPHA, A, LDA,
190                                             B, LDB,
191                     ( \textcolor{keyword}{const} \textcolor{keywordtype}{double} )  BETA, C, LDC );
192 
193 \} 
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsymtiled2flat@{ddss\+\_\+dsymtiled2flat}}
\index{ddss\+\_\+dsymtiled2flat@{ddss\+\_\+dsymtiled2flat}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsymtiled2flat(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE], enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O)}{ddss_dsymtiled2flat(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dsymtiled2flat (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}, }
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a7a0f7b98f2430148a5f99fc403309816}{}\label{lass_8h_a7a0f7b98f2430148a5f99fc403309816}
ddss\+\_\+dsymtiled2flat\+: Performs the change of the data layout from tile layout to flat layout for symmetric matrices according to row-\/major order.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\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
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\+\_\+dscatter\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 223 of file ddss\+\_\+tiled2flat.\+c.



References ddss\+\_\+dscatter\+\_\+tile().



Referenced by kdpotrf(), kdsyr2k(), and kdsyrk().


\begin{DoxyCode}
225 \{
226 
227     \textcolor{comment}{// Local variables}
228     \textcolor{keywordtype}{int} m, n;
229     
230     \textcolor{keywordflow}{if} ( UPLO == Upper )
231     \{
232         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
233         \{
234             \textcolor{keywordflow}{for} ( n = NT-1; n >= m; n-- )
235             \{
236 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
237 \textcolor{preprocessor}{                label( dsymmtiled2flat )}
238                 \{ 
239                     \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N, 
240                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA, 
241                         TILE\_A[m][n], m, n );
242                 \}
243             \}
244         \}
245     \}   
246     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ( UPLO == Lower )
247     \{
248         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
249         \{
250             \textcolor{keywordflow}{for} ( n = 0; n <= m; n++ )
251             \{
252 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
253 \textcolor{preprocessor}{                label( dsymmtiled2flat )}
254                 \{ 
255                     \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N, 
256                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA, 
257                         TILE\_A[m][n], m, n );
258                 \}
259             \}
260         \}
261     \}       
262 
263 \textcolor{preprocessor}{    #pragma oss taskwait    }
264 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsymtiled2flat\+\_\+nb@{ddss\+\_\+dsymtiled2flat\+\_\+nb}}
\index{ddss\+\_\+dsymtiled2flat\+\_\+nb@{ddss\+\_\+dsymtiled2flat\+\_\+nb}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsymtiled2flat\+\_\+nb(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE], enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O)}{ddss_dsymtiled2flat_nb(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE], enum DDSS_UPLO UPLO)}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dsymtiled2flat\+\_\+nb (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}, }
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a9089190fbb27ac8ceaaaa558ab2f5e37}{}\label{lass_8h_a9089190fbb27ac8ceaaaa558ab2f5e37}
ddss\+\_\+dsymtiled2flat\+\_\+nb\+: Performs the change of the data layout from tile layout to flat layout for symmetric matrices according to row-\/major order in a non-\/blocking execution mode.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\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
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\+\_\+dscatter\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 324 of file ddss\+\_\+tiled2flat.\+c.



References ddss\+\_\+dscatter\+\_\+tile().



Referenced by kdposv().


\begin{DoxyCode}
326 \{
327 
328     \textcolor{comment}{// Local variables}
329     \textcolor{keywordtype}{int} m, n;
330 
331     \textcolor{keywordflow}{if} ( UPLO == Upper )
332     \{
333         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
334         \{
335             \textcolor{keywordflow}{for} ( n = NT-1; n >= m; n-- )
336             \{
337 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
338 \textcolor{preprocessor}{                label( dsymmtiled2flat\_nb )}
339                 \{
340                     \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N,
341                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA,
342                         TILE\_A[m][n], m, n );
343                 \}
344             \}
345         \}
346     \}
347     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ( UPLO == Lower )
348     \{
349         \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
350         \{
351             \textcolor{keywordflow}{for} ( n = 0; n <= m; n++ )
352             \{
353 \textcolor{preprocessor}{                #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
354 \textcolor{preprocessor}{                label( dsymmtiled2flat\_nb )}
355                 \{
356                     \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N,
357                         &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA,
358                         TILE\_A[m][n], m, n );
359                 \}
360             \}
361         \}
362     \}
363 
364 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsyr2k@{ddss\+\_\+dsyr2k}}
\index{ddss\+\_\+dsyr2k@{ddss\+\_\+dsyr2k}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsyr2k(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)}{ddss_dsyr2k(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dsyr2k (
\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{lass_8h_a0bd18e3495c9d8ab6ae463389a2b00bf}{}\label{lass_8h_a0bd18e3495c9d8ab6ae463389a2b00bf}
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{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a2ef29953763cd105a69a3c8db2adc1b3}{kdsyr2k} 
\end{DoxySeeAlso}


Definition at line 114 of file ddss\+\_\+dsyr2k.\+c.



References kdsyr2k().


\begin{DoxyCode}
119 \{
120     \textcolor{comment}{// Local variables}
121     \textcolor{keywordtype}{int} nA, nB;
122     
123     \textcolor{comment}{// Argument checking}
124     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) ) 
125     \{
126         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dsyr2k code\(\backslash\)n"} );
127         \textcolor{keywordflow}{return} NoSuccess;
128     \}
129     
130     \textcolor{keywordflow}{if} ( ( TRANS != NoTrans ) && ( TRANS != Trans ) )
131     \{
132         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS, in ddss\_dsyr2k code\(\backslash\)n"} );
133         \textcolor{keywordflow}{return} NoSuccess;
134     \}
135     
136     \textcolor{keywordflow}{if} ( N < 0 )
137     \{
138         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dsyr2k code\(\backslash\)n"} );
139         \textcolor{keywordflow}{return} NoSuccess;
140     \}
141         
142     \textcolor{keywordflow}{if} ( K < 0 )
143     \{
144         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of K, in ddss\_dsyr2k code\(\backslash\)n"} );
145         \textcolor{keywordflow}{return} NoSuccess;
146     \}
147     
148     \textcolor{keywordflow}{if} ( TRANS == NoTrans ) 
149     \{
150         nA = nB = K;
151     \} 
152     \textcolor{keywordflow}{else} 
153     \{
154         nA = nB = N;
155     \}
156 
157     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) ) 
158     \{
159         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dsyr2k code\(\backslash\)n"} );
160         \textcolor{keywordflow}{return} NoSuccess;
161     \}
162     
163     \textcolor{keywordflow}{if} ( LDB < MAX( 1, nB ) ) 
164     \{
165         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dsyr2k code\(\backslash\)n"} );
166         \textcolor{keywordflow}{return} NoSuccess;
167     \}
168 
169     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) ) 
170     \{
171         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dsyr2k code\(\backslash\)n"} );
172         \textcolor{keywordflow}{return} NoSuccess;
173     \}
174     
175     \textcolor{comment}{// Quick return}
176      \textcolor{keywordflow}{if} ( N == 0 || ( ( ALPHA == 0.0 || K == 0 ) && BETA == 1.0 ) )
177      \{
178          \textcolor{keywordflow}{return} Success;
179      \}
180     
181     \textcolor{keywordflow}{return} \hyperlink{kdsyr2k_8c_a2ef29953763cd105a69a3c8db2adc1b3}{kdsyr2k}( UPLO, TRANS,
182                     N, K,
183                     ALPHA, A, LDA,
184                            B, LDB,
185                     BETA,  C, LDC );
186 
187 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dsyrk@{ddss\+\_\+dsyrk}}
\index{ddss\+\_\+dsyrk@{ddss\+\_\+dsyrk}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dsyrk(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, int N, int K, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, const double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{ddss_dsyrk(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, int N, int K, const double ALPHA, double *A, int LDA, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dsyrk (
\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\+N\+S\+\_\+A, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{const double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a60f62b1e38c14cf41be017ce9597eec4}{}\label{lass_8h_a60f62b1e38c14cf41be017ce9597eec4}
Performs one of the symmetric rank k operations\+: \begin{DoxyVerb}C = ALPHA * A * op( A ) + BETA * C  or
C = ALPHA * op( A ) * A + BETA * C
\end{DoxyVerb}


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


A\+L\+P\+HA and B\+E\+TA are scalars, C is an N by N symmetric matrix and A is an N by K matrix in the first case and a K by N matrix 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\+N\+S\+\_\+A} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+A specifies the operation to be performed as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: C = A\+L\+P\+HA $\ast$ A $\ast$ A$\ast$$\ast$T + B\+E\+TA $\ast$ C
\item Trans\+: C = A\+L\+P\+HA $\ast$ A$\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\+N\+S\+\_\+A = No\+Trans, K specifies the number of columns of the matrix A, and with T\+R\+A\+N\+S\+\_\+A = Trans, K specifies the number of rows of the matrix A. 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\+N\+S\+\_\+A = 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\+N\+S\+\_\+A = 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\+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{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a8ffc4fc508b14a7ccda98be54ded18bc}{kdsyrk} 
\end{DoxySeeAlso}


Definition at line 106 of file ddss\+\_\+dsyrk.\+c.



References kdsyrk().


\begin{DoxyCode}
110 \{
111 
112     \textcolor{comment}{// Local variables}
113     \textcolor{keywordtype}{int} nA;
114     
115     \textcolor{comment}{// Argument checking}
116     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) ) 
117     \{
118         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dsyrk code\(\backslash\)n"} );
119         \textcolor{keywordflow}{return} NoSuccess;
120     \}
121     
122     \textcolor{keywordflow}{if} ( ( TRANS\_A != NoTrans ) && ( TRANS\_A != Trans ) )
123     \{
124         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_A, in ddss\_dsyrk code\(\backslash\)n"} );
125         \textcolor{keywordflow}{return} NoSuccess;
126     \}
127     
128     \textcolor{keywordflow}{if} ( N < 0 )
129     \{
130         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dsyrk code\(\backslash\)n"} );
131         \textcolor{keywordflow}{return} NoSuccess;
132     \}
133         
134     \textcolor{keywordflow}{if} ( K < 0 )
135     \{
136         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of K, in ddss\_dsyrk code\(\backslash\)n"} );
137         \textcolor{keywordflow}{return} NoSuccess;
138     \}
139     
140     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans ) 
141     \{
142         nA = K;
143     \} 
144     \textcolor{keywordflow}{else} 
145     \{
146         nA = N;
147     \}
148 
149     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) ) 
150     \{
151         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dsyrk code\(\backslash\)n"} );
152         \textcolor{keywordflow}{return} NoSuccess;
153     \}
154 
155     \textcolor{keywordflow}{if} ( LDC < MAX( 1, N ) ) 
156     \{
157         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDC, in ddss\_dsyrk code\(\backslash\)n"} );
158         \textcolor{keywordflow}{return} NoSuccess;
159     \}
160     
161     \textcolor{comment}{// Quick return}
162      \textcolor{keywordflow}{if} ( N == 0 || ( ( ALPHA == 0.0 || K == 0 ) && BETA == 1.0 ) )
163      \{
164          \textcolor{keywordflow}{return} Success;
165      \}
166     
167     \textcolor{keywordflow}{return} \hyperlink{kdsyrk_8c_a8ffc4fc508b14a7ccda98be54ded18bc}{kdsyrk}( UPLO, TRANS\_A,
168                    N, K,
169                    ALPHA, A, LDA,
170                    BETA,  C, LDC );
171     
172 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtiled2flat@{ddss\+\_\+dtiled2flat}}
\index{ddss\+\_\+dtiled2flat@{ddss\+\_\+dtiled2flat}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtiled2flat(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE])}{ddss_dtiled2flat(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dtiled2flat (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_aeeb6b69c6b4db8333c660ef6824cdf6a}{}\label{lass_8h_aeeb6b69c6b4db8333c660ef6824cdf6a}
ddss\+\_\+dtiled2flat\+: Performs the change of the data layout from tile layout to flat layout according to row-\/major order.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\+\_\+dscatter\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 68 of file ddss\+\_\+tiled2flat.\+c.



References ddss\+\_\+dscatter\+\_\+tile().



Referenced by kdgemm(), kdnpgesv(), kdnpgetrf(), kdposv(), kdsymm(), kdtpgesv(), kdtpgetrf(), kdtrmm(), and kdtrsm().


\begin{DoxyCode}
70 \{
71 
72     \textcolor{comment}{// Local variables}
73     \textcolor{keywordtype}{int} m, n;
74 
75     \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
76     \{
77         \textcolor{keywordflow}{for} ( n = 0; n < NT; n++ )
78         \{
79 \textcolor{preprocessor}{            #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
80 \textcolor{preprocessor}{            label( dtiled2flat)}
81             \{
82                 \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N, 
83                     &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA, 
84                     TILE\_A[m][n], m, n );
85             \}
86         \}
87     \}
88 
89 \textcolor{preprocessor}{    #pragma oss taskwait}
90 
91 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtiled2flat\+\_\+nb@{ddss\+\_\+dtiled2flat\+\_\+nb}}
\index{ddss\+\_\+dtiled2flat\+\_\+nb@{ddss\+\_\+dtiled2flat\+\_\+nb}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtiled2flat\+\_\+nb(int M, int N, double $\ast$\+A, int L\+D\+A, int M\+T, int N\+T, double($\ast$\+T\+I\+L\+E\+\_\+\+A)[NT][T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+ZE])}{ddss_dtiled2flat_nb(int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])}}]{\setlength{\rightskip}{0pt plus 5cm}void ddss\+\_\+dtiled2flat\+\_\+nb (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int}]{MT, }
\item[{int}]{NT, }
\item[{double($\ast$)}]{T\+I\+L\+E\+\_\+A\mbox{[}\+N\+T\mbox{]}\mbox{[}\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E $\ast$\+T\+I\+L\+E\+\_\+\+S\+I\+Z\+E\mbox{]}}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_adb1f9312d77184467236d25bc73f21b0}{}\label{lass_8h_adb1f9312d77184467236d25bc73f21b0}
ddss\+\_\+dtiled2flat\+\_\+nb\+: Performs the change of the data layout from tile layout to flat layout according to row-\/major order in a non-\/blocking execution mode.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the flat matrix.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the flat matrix.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to the flat matrix.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns ( row-\/major order ) of matrix A.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the number of rows of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em NT} & int. NT specifies the number of columns of the matrix T\+I\+L\+E\+\_\+A.\\
\hline
\mbox{\tt in}  & {\em T\+I\+L\+E\+\_\+A} & double $\ast$. T\+I\+L\+E\+\_\+A is a pointer to the tile matrix.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\+\_\+dscatter\+\_\+tile} 

\hyperlink{lass_8h_a931442adba78807015ff9a076fb2ae49}{ddss\+\_\+tile\+\_\+size} 
\end{DoxySeeAlso}


Definition at line 142 of file ddss\+\_\+tiled2flat.\+c.



References ddss\+\_\+dscatter\+\_\+tile().



Referenced by kdnpgesv().


\begin{DoxyCode}
144 \{
145 
146     \textcolor{comment}{// Local variables}
147     \textcolor{keywordtype}{int} m, n;
148 
149     \textcolor{keywordflow}{for} ( m = 0; m < MT; m++ )
150     \{
151         \textcolor{keywordflow}{for} ( n = 0; n < NT; n++ )
152         \{
153 \textcolor{preprocessor}{            #pragma oss task inout(TILE\_A[m][n]) \(\backslash\)}
154 \textcolor{preprocessor}{            label( dtiled2flat)}
155             \{
156                 \hyperlink{ddss__tiled2flat_8c_a7f57f81b35bf76a41998f387c9afd541}{ddss\_dscatter\_tile}( M, N, 
157                     &A[m * TILE\_SIZE * N + n * TILE\_SIZE], LDA, 
158                     TILE\_A[m][n], m, n );
159             \}
160         \}
161     \}
162 
163 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtpgesv@{ddss\+\_\+dtpgesv}}
\index{ddss\+\_\+dtpgesv@{ddss\+\_\+dtpgesv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtpgesv(int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, int $\ast$\+I\+P\+I\+V, double $\ast$\+B, int L\+D\+B)}{ddss_dtpgesv(int N, int NRHS, double *A, int LDA, int *IPIV, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dtpgesv (
\begin{DoxyParamCaption}
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int $\ast$}]{I\+P\+IV, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_adcc6575c28b21fe5c6486fff97d90aa9}{}\label{lass_8h_adcc6575c28b21fe5c6486fff97d90aa9}
Solves a system of linear equations A  X = B, where A is a N-\/by-\/N general matrix and X and B are N-\/by-\/\+N\+R\+HS matrices. The matrix A is factorized using the LU descomposition with tiled-\/pivoting. The matrix A is descomposed as\+: \begin{DoxyVerb}A = P * L * U
\end{DoxyVerb}


where P is a permutation matrix, L is a lower triangular matrix with unit diagonal elements and U is an upper triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em N} & int. N specifies the order of the square matrix A. N $>$= 0.\\
\hline
\end{DoxyParams}
N\+R\+HS int. N\+R\+HS specifies the number of right-\/hand-\/sides (number of columns of B). N\+R\+HS $>$= 0.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension N-\/by-\/\+L\+DA. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt out}  & {\em I\+P\+IV} & int $\ast$. ipiv is a pointer to an array of dimesion at least max( 1, min ( M, N ) ). ipiv( i ) = j, 1 $<$= i $<$= min( M, N ) implies that rows i and j have been interchanged.\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension N by N\+R\+HS, which stores the right-\/hand-\/sides of the systems of linear equations. (row-\/major order). On exit, if return value is Success, the matrix B is overwriten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N\+R\+H\+S ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_aa8b24e76e50652c68471955338c4e1b9}{kdtpgesv} 
\end{DoxySeeAlso}


Definition at line 89 of file ddss\+\_\+dtpgesv.\+c.



References kdtpgesv().


\begin{DoxyCode}
93 \{
94 
95     \textcolor{comment}{// Argument checking}
96     \textcolor{keywordflow}{if} ( N < 0 )
97     \{
98         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dtpgesv code\(\backslash\)n"} );
99         \textcolor{keywordflow}{return} NoSuccess;
100     \}
101 
102     \textcolor{keywordflow}{if} ( NRHS < 0 )
103     \{
104         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of NRHS, in ddss\_dtpgesv code\(\backslash\)n"} );
105         \textcolor{keywordflow}{return} NoSuccess;
106     \}
107 
108     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
109     \{
110         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dtpgesv code\(\backslash\)n"} );
111         \textcolor{keywordflow}{return} NoSuccess;
112     \}
113 
114     \textcolor{keywordflow}{if} ( LDB < MAX( 1, NRHS ) )
115     \{
116         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dtpgesv code\(\backslash\)n"} );
117         \textcolor{keywordflow}{return} NoSuccess;
118     \}
119 
120     \textcolor{comment}{// Quick return}
121     \textcolor{keywordflow}{if} ( MAX( N, 0 ) == 0 || MAX( NRHS, 0 ) == 0 )
122     \{
123         \textcolor{keywordflow}{return} Success;
124     \}
125 
126     \textcolor{keywordflow}{return} \hyperlink{kdtpgesv_8c_aa8b24e76e50652c68471955338c4e1b9}{kdtpgesv}( N, NRHS, A, LDA, IPIV, B, LDB );
127 
128 \} 
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtpgetrf@{ddss\+\_\+dtpgetrf}}
\index{ddss\+\_\+dtpgetrf@{ddss\+\_\+dtpgetrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtpgetrf(int M, int N, double $\ast$\+A, int L\+D\+A, int $\ast$ipiv)}{ddss_dtpgetrf(int M, int N, double *A, int LDA, int *ipiv)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dtpgetrf (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int $\ast$}]{I\+P\+IV}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a2a27faa0f25c3984472766a8a310d923}{}\label{lass_8h_a2a27faa0f25c3984472766a8a310d923}
Performs the LU factorization with tiled pivoting ( row interchanges ) of a general M-\/by-\/N matrix A\+: \begin{DoxyVerb}A = P * L * U
\end{DoxyVerb}


where P is a permutation matrix, L is a lower triangular ( lower trapezoidal if M $>$ N ) matrix with unit diagonal elements and U is an upper triangular ( upper trapezoidal if M $<$ N ) matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A. M $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix A. N $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension M-\/by-\/N. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt out}  & {\em I\+P\+IV} & int $\ast$. ipiv is a pointer to an array of dimesion at least max( 1, min ( M, N ) ). ipiv( i ) = j, 1 $<$= i $<$= min( M, N ) implies that rows i and j have been interchanged.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a78d204c4ad618df9e1d81e0668bc2149}{kdtpgetrf} 
\end{DoxySeeAlso}


Definition at line 77 of file ddss\+\_\+dtpgetrf.\+c.



References kdtpgetrf().


\begin{DoxyCode}
78 \{
79 
80     \textcolor{comment}{// Argument checking}
81     \textcolor{keywordflow}{if} ( M < 0 )
82     \{
83         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dtpgetrf code\(\backslash\)n"} );
84         \textcolor{keywordflow}{return} NoSuccess;
85     \}
86 
87     \textcolor{keywordflow}{if} ( N < 0 )
88     \{
89         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dtpgetrf code\(\backslash\)n"} );
90         \textcolor{keywordflow}{return} NoSuccess;
91     \}
92 
93     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
94     \{
95         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dtpgetrf code\(\backslash\)n"} );
96         \textcolor{keywordflow}{return} NoSuccess;
97     \}
98 
99     \textcolor{comment}{// Qick return}
100     \textcolor{keywordflow}{if} ( MIN( M, N ) == 0 )
101     \{
102         \textcolor{keywordflow}{return} Success;
103     \}
104 
105     \textcolor{keywordflow}{return} \hyperlink{kdtpgetrf_8c_aa6fc273b5c4ac8c9875d3f398763fab9}{kdtpgetrf}( M, N, A, LDA, IPIV );
106 
107 \} 
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtrmm@{ddss\+\_\+dtrmm}}
\index{ddss\+\_\+dtrmm@{ddss\+\_\+dtrmm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtrmm(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)}{ddss_dtrmm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dtrmm (
\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{lass_8h_ac418e7d435cba3c169e5e75ad42ffbdd}{}\label{lass_8h_ac418e7d435cba3c169e5e75ad42ffbdd}
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{DoxySeeAlso}{See also}
\hyperlink{lass_8h_afff986820ff4c554e2b217e99b49c143}{kdtrmm} 
\end{DoxySeeAlso}


Definition at line 113 of file ddss\+\_\+dtrmm.\+c.



References kdtrmm().


\begin{DoxyCode}
118 \{
119 
120     \textcolor{comment}{// Local variables}
121     \textcolor{keywordtype}{int} nA;
122     
123     \textcolor{comment}{// Argument checking}
124     \textcolor{keywordflow}{if} ( ( SIDE != Left ) && ( SIDE != Right ) ) 
125     \{
126         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of SIDE, in ddss\_dtrmm code\(\backslash\)n"} );
127         \textcolor{keywordflow}{return} NoSuccess;
128     \}
129 
130     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) ) 
131     \{
132         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dtrmm code\(\backslash\)n"} );
133         \textcolor{keywordflow}{return} NoSuccess;
134     \}
135 
136     \textcolor{keywordflow}{if} ( ( TRANS\_A != NoTrans ) && ( TRANS\_A != Trans ) ) 
137     \{
138         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_A, in ddss\_dtrmm code\(\backslash\)n"} );
139         \textcolor{keywordflow}{return} NoSuccess;
140     \}
141 
142     \textcolor{keywordflow}{if} ( ( DIAG != Unit ) && ( DIAG != NonUnit ) ) 
143     \{
144         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of DIAG, in ddss\_dtrmm code\(\backslash\)n"} );
145         \textcolor{keywordflow}{return} NoSuccess;
146     \}
147 
148     \textcolor{keywordflow}{if} ( M < 0 ) 
149     \{
150         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dtrmm code\(\backslash\)n"} );
151         \textcolor{keywordflow}{return} NoSuccess;
152     \}
153 
154     \textcolor{keywordflow}{if} ( N < 0 ) 
155     \{
156         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dtrmm code\(\backslash\)n"} );
157         \textcolor{keywordflow}{return} NoSuccess;
158     \}
159 
160     \textcolor{keywordflow}{if} ( SIDE == Left ) 
161     \{
162         nA = M;
163     \} 
164     \textcolor{keywordflow}{else} 
165     \{
166         nA = N;
167     \}
168 
169     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) ) 
170     \{
171         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dtrmm code\(\backslash\)n"} );
172         \textcolor{keywordflow}{return} NoSuccess;
173     \}
174 
175     \textcolor{keywordflow}{if} ( LDB < MAX( 1, N ) ) 
176     \{
177         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dtrmm code\(\backslash\)n"} );
178         \textcolor{keywordflow}{return} NoSuccess;
179     \}
180     
181     \textcolor{comment}{// Quick return}
182     \textcolor{keywordflow}{if} ( M == 0 || N == 0 )
183     \{
184         \textcolor{keywordflow}{return} Success;
185     \}   
186 
187     \textcolor{keywordflow}{return} \hyperlink{kdtrmm_8c_afff986820ff4c554e2b217e99b49c143}{kdtrmm}( SIDE, UPLO, 
188                    TRANS\_A, DIAG, 
189                    M, N, 
190                    ALPHA, A, LDA, 
191                           B, LDB );
192 
193 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+dtrsm@{ddss\+\_\+dtrsm}}
\index{ddss\+\_\+dtrsm@{ddss\+\_\+dtrsm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+dtrsm(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)}{ddss_dtrsm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+dtrsm (
\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{lass_8h_a0f0421e7581b000ae1833415b7e0efc5}{}\label{lass_8h_a0f0421e7581b000ae1833415b7e0efc5}
Solves one of the matrix equations\+: \begin{DoxyVerb}op( A ) * X = ALPHA * B, or X * op( A ) = ALPHA * B
\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, X and B are M by N matrices, A is a unit, or non-\/unit, upper or lower triangular matrix. The matrix X is overwritten on B


\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\+: op( A ) $\ast$ X = A\+L\+P\+HA $\ast$ B.
\item Right\+: X $\ast$ op( A ) = A\+L\+P\+HA $\ast$ B.
\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 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 solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N ).\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_addfda795c19230c16da674648de83a5c}{kdtrsm} 
\end{DoxySeeAlso}


Definition at line 113 of file ddss\+\_\+dtrsm.\+c.



References kdtrsm().


\begin{DoxyCode}
118 \{
119 
120     \textcolor{comment}{// Local variables}
121     \textcolor{keywordtype}{int} nA;
122     
123     \textcolor{comment}{// Argument checking}
124     \textcolor{keywordflow}{if} ( ( SIDE != Left ) && ( SIDE != Right ) ) 
125     \{
126         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of SIDE, in ddss\_dtrsm code\(\backslash\)n"} );
127         \textcolor{keywordflow}{return} NoSuccess;
128     \}
129 
130     \textcolor{keywordflow}{if} ( ( UPLO != Upper ) && ( UPLO != Lower ) ) 
131     \{
132         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of UPLO, in ddss\_dtrsm code\(\backslash\)n"} );
133         \textcolor{keywordflow}{return} NoSuccess;
134     \}
135 
136     \textcolor{keywordflow}{if} ( ( TRANS\_A != NoTrans ) && ( TRANS\_A != Trans ) ) 
137     \{
138         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of TRANS\_A, in ddss\_dtrsm code\(\backslash\)n"} );
139         \textcolor{keywordflow}{return} NoSuccess;
140     \}
141 
142     \textcolor{keywordflow}{if} ( ( DIAG != Unit ) && ( DIAG != NonUnit ) ) 
143     \{
144         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of DIAG, in ddss\_dtrsm code\(\backslash\)n"} );
145         \textcolor{keywordflow}{return} NoSuccess;
146     \}
147 
148     \textcolor{keywordflow}{if} ( M < 0 ) 
149     \{
150         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in ddss\_dtrsm code\(\backslash\)n"} );
151         \textcolor{keywordflow}{return} NoSuccess;
152     \}
153 
154     \textcolor{keywordflow}{if} ( N < 0 ) 
155     \{
156         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in ddss\_dtrsm code\(\backslash\)n"} );
157         \textcolor{keywordflow}{return} NoSuccess;
158     \}
159 
160     \textcolor{keywordflow}{if} ( SIDE == Left ) 
161     \{
162         nA = M;
163     \} 
164     \textcolor{keywordflow}{else} 
165     \{
166         nA = N;
167     \}
168 
169     \textcolor{keywordflow}{if} ( LDA < MAX( 1, nA ) ) 
170     \{
171         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in ddss\_dtrsm code\(\backslash\)n"} );
172         \textcolor{keywordflow}{return} NoSuccess;
173     \}
174 
175     \textcolor{keywordflow}{if} ( LDB < MAX( 1, N ) ) 
176     \{
177         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDB, in ddss\_dtrsm code\(\backslash\)n"} );
178         \textcolor{keywordflow}{return} NoSuccess;
179     \}
180 
181     \textcolor{comment}{// Quick return}
182     \textcolor{keywordflow}{if} ( M == 0 || N == 0 )
183     \{
184         \textcolor{keywordflow}{return} Success;
185     \}
186 
187     \textcolor{keywordflow}{return} \hyperlink{kdtrsm_8c_addfda795c19230c16da674648de83a5c}{kdtrsm}( SIDE, UPLO, 
188                    TRANS\_A, DIAG, 
189                    M, N, 
190                    ALPHA, A, LDA, 
191                           B, LDB );
192 
193 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!ddss\+\_\+tile\+\_\+size@{ddss\+\_\+tile\+\_\+size}}
\index{ddss\+\_\+tile\+\_\+size@{ddss\+\_\+tile\+\_\+size}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{ddss\+\_\+tile\+\_\+size(int M, int M\+T)}{ddss_tile_size(int M, int MT)}}]{\setlength{\rightskip}{0pt plus 5cm}int ddss\+\_\+tile\+\_\+size (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{MT}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a931442adba78807015ff9a076fb2ae49}{}\label{lass_8h_a931442adba78807015ff9a076fb2ae49}
tile\+\_\+size\+: Computes the size of the tile passed as parameter.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the size ( rows of columns ) of the matrix.\\
\hline
\mbox{\tt in}  & {\em MT} & int. MT specifies the id of the tile.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em int} & size of the tile passed as parameter.\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
ddss\+\_\+gather\+\_\+tile 
\end{DoxySeeAlso}


Definition at line 52 of file ddss\+\_\+tile.\+c.



Referenced by ddss\+\_\+dgather\+\_\+tile(), ddss\+\_\+dscatter\+\_\+tile(), kdgemm(), kdnpgesv(), kdnpgetrf(), kdposv(), kdpotrf(), kdsymm(), kdsyr2k(), kdsyrk(), kdtpgesv(), kdtpgetrf(), kdtrmm(), and kdtrsm().


\begin{DoxyCode}
53 \{
54 
55     \textcolor{keywordflow}{if} ( M - ( MT * TILE\_SIZE ) > TILE\_SIZE )
56         \textcolor{keywordflow}{return} TILE\_SIZE;
57     \textcolor{keywordflow}{else}
58         \textcolor{keywordflow}{return} M - ( MT * TILE\_SIZE );
59 
60 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!dnpgetrf@{dnpgetrf}}
\index{dnpgetrf@{dnpgetrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{dnpgetrf(int M, int N, double $\ast$\+A, int L\+D\+A)}{dnpgetrf(int M, int N, double *A, int LDA)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN dnpgetrf (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a90f43bdc154edb1979f7ffce22e142ff}{}\label{lass_8h_a90f43bdc154edb1979f7ffce22e142ff}
Performs the LU factorization without pivoting of a general M-\/by-\/N matrix A\+: \begin{DoxyVerb}A = L * U
\end{DoxyVerb}


where L is a lower triangular ( lower trapezoidal if M $>$ N ) matrix with unit diagonal elements and U is an upper triangular ( upper trapezoidal if M $<$ N ) matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A. M $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix A. N $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension M-\/by-\/N. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_aad8c6b9542e74c481faff1ff5e03850f}{kdnpgetrf} 
\end{DoxySeeAlso}


Definition at line 70 of file dnpgetrf.\+c.



Referenced by kdnpgesv(), and kdnpgetrf().


\begin{DoxyCode}
71 \{
72 
73     \textcolor{comment}{// Local variable}
74     \textcolor{keywordtype}{double} alpha;
75     \textcolor{keywordtype}{double} sfmin;
76     \textcolor{keywordtype}{int} i, j, k;
77     \textcolor{keywordtype}{int} info = 0;
78 
79     \textcolor{comment}{// Argument checking}
80     \textcolor{keywordflow}{if} ( M < 0 )
81     \{
82         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of M, in dnpgetrf code\(\backslash\)n"} );
83         \textcolor{keywordflow}{return} NoSuccess;
84     \}
85 
86     \textcolor{keywordflow}{if} ( N < 0 )
87     \{
88         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of N, in dnpgetrf code\(\backslash\)n"} );
89         \textcolor{keywordflow}{return} NoSuccess;
90     \}
91 
92     \textcolor{keywordflow}{if} ( LDA < MAX( 1, N ) )
93     \{
94         fprintf( stderr, \textcolor{stringliteral}{"Illegal value of LDA, in dnpgetrf code\(\backslash\)n"} );
95         \textcolor{keywordflow}{return} NoSuccess;
96     \}
97 
98     \textcolor{comment}{// Qick return}
99     \textcolor{keywordflow}{if} ( MIN( M, N ) == 0 )
100     \{
101         \textcolor{keywordflow}{return} Success;
102     \}
103     
104     \textcolor{comment}{/****************}
105 \textcolor{comment}{    --DNPGETRF tile--}
106 \textcolor{comment}{    ****************/}   
107 
108     \textcolor{comment}{// Minimum value in double precision    }
109     sfmin = LAPACKE\_dlamch\_work( \textcolor{charliteral}{'S'} );
110     k = MIN( M, N );
111     
112     \textcolor{keywordflow}{for} ( i = 0; i < k; i++ ) 
113     \{
114         alpha = A[i * LDA + i];
115         \textcolor{keywordflow}{if} ( alpha != ( \textcolor{keywordtype}{double} )0.0 ) 
116         \{
117             \textcolor{comment}{// Compute elements from J+1 to M of the J-th column}
118             \textcolor{keywordflow}{if} ( i < M ) 
119             \{   
120                 \textcolor{keywordflow}{if} ( fabs( alpha ) > fabs( sfmin ) )
121                 \{
122                     alpha = 1.0 / alpha;  
123                     cblas\_dscal( M - i - 1, alpha, 
124                         &( A[( i + 1 ) * LDA + i] ), LDA );
125                 \} 
126                 \textcolor{keywordflow}{else} 
127                 \{
128                     \textcolor{keywordflow}{for}( j= i + 1; j < M; j++ )
129                     \{   
130                         A[j * LDA + i] = A[j * LDA + i] / alpha;
131                     \}
132                 \}
133             \}
134         \} 
135         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ( info == 0 ) 
136         \{
137             info = i;       
138         \}
139         \textcolor{keywordflow}{if} ( i < k ) 
140         \{
141             cblas\_dger( CblasRowMajor,
142                         M - i - 1, N - i - 1, 
143                         -1.0,
144                         &A[( i + 1 ) * LDA + i], LDA,
145                         &A[ i * LDA + ( i + 1 )], 1,
146                         &A[( i + 1 ) * LDA + ( i + 1 ) ], LDA );        
147         \}
148     \}
149     
150     \textcolor{keywordflow}{return} Success;
151 
152 \} 
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!dspmvseq@{dspmvseq}}
\index{dspmvseq@{dspmvseq}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{dspmvseq(int M, int N, double A\+L\+P\+H\+A, const double $\ast$\+V\+A\+L\+\_\+\+A, const int $\ast$\+R\+O\+W\+\_\+\+P\+T\+R\+\_\+\+A, const int $\ast$\+C\+O\+L\+\_\+\+I\+N\+D\+\_\+\+A, const double $\ast$\+X, double B\+E\+T\+A, double $\ast$\+Y)}{dspmvseq(int M, int N, double ALPHA, const double *VAL_A, const int *ROW_PTR_A, const int *COL_IND_A, const double *X, double BETA, double *Y)}}]{\setlength{\rightskip}{0pt plus 5cm}void dspmvseq (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double}]{A\+L\+P\+HA, }
\item[{const double $\ast$}]{V\+A\+L\+\_\+A, }
\item[{const int $\ast$}]{R\+O\+W\+\_\+\+P\+T\+R\+\_\+A, }
\item[{const int $\ast$}]{C\+O\+L\+\_\+\+I\+N\+D\+\_\+A, }
\item[{const double $\ast$}]{X, }
\item[{double}]{B\+E\+TA, }
\item[{double $\ast$}]{Y}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a370e9cd2de50f704173265423d33d289}{}\label{lass_8h_a370e9cd2de50f704173265423d33d289}
Performs the sparse matrix-\/vector operation\+: \begin{DoxyVerb}Y = ALPHA * A * X + BETA * Y
\end{DoxyVerb}


where A\+L\+P\+HA and B\+E\+TA are scalars, X and Y are vectors, and A is a sparse matrix stored in thhe next three vectors V\+A\+L\+\_\+A, C\+O\+L\+\_\+\+I\+N\+D\+\_\+A and R\+O\+W\+\_\+\+P\+T\+R\+\_\+A according to C\+SR format.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of A.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of A.\\
\hline
\mbox{\tt in}  & {\em A\+L\+P\+HA} & double.\\
\hline
\mbox{\tt in}  & {\em V\+A\+L\+\_\+A} & double $\ast$. V\+A\+L\+\_\+A is a pointer to a vector which specifies the non-\/zero values of the original matrix A.\\
\hline
\mbox{\tt in}  & {\em C\+O\+L\+\_\+\+I\+N\+D\+\_\+A} & unsigned int $\ast$. C\+O\+L\+\_\+\+I\+N\+D\+\_\+A is a pointer to a vector which specifies the column of each value of A in the original matrix.\\
\hline
\mbox{\tt in}  & {\em R\+O\+W\+\_\+\+P\+T\+R\+\_\+A} & unsigned int $\ast$. R\+O\+W\+\_\+\+P\+T\+R\+\_\+A is a pointer to a vector which specifies the number of values that A contains in each row of the original matrix.\\
\hline
\mbox{\tt in}  & {\em X} & double $\ast$. X is a pointer to a vector of dimension N.\\
\hline
\mbox{\tt in}  & {\em B\+E\+TA} & double .\\
\hline
\mbox{\tt in,out}  & {\em Y} & double $\ast$. Y is a pointer to a vector of dimension M. On exit, Y is overwritten by the sparse matrix-\/vector result.\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & sucessful exit \\
\hline
{\em No\+Success} & unsucessful exit \\
\hline
\end{DoxyRetVals}


Definition at line 84 of file dspmv.\+c.


\begin{DoxyCode}
90 \{
91 
92     \textcolor{comment}{// Local variables}
93     \textcolor{keywordtype}{double} svalue = 0.0, value = 0.0;
94     \textcolor{keywordtype}{int} max = 0, col = 0;
95     \textcolor{keywordtype}{int} i, x;
96 
97     \textcolor{keywordflow}{for} ( x = 0; x < M; x++ )
98     \{
99         svalue = 0.0;
100         max = ROW\_PTR\_A[x + 1] - ROW\_PTR\_A[x];
101 
102         \textcolor{keywordflow}{for}( i = 0; i < max; i++ )
103         \{
104             value = VAL\_A[ROW\_PTR\_A[x] + i];
105             col = COL\_IND\_A[ROW\_PTR\_A[x] + i];
106             svalue += value * X[col] * ALPHA;
107 
108 
109         \}
110 
111         Y[x] = svalue + Y[x] * BETA;
112 
113     \}
114 
115 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdgemm@{kdgemm}}
\index{kdgemm@{kdgemm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdgemm(enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+A, enum D\+D\+S\+S\+\_\+\+T\+R\+A\+N\+S T\+R\+A\+N\+S\+\_\+\+B, int M, 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)}{kdgemm(enum DDSS_TRANS TRANS_A, enum DDSS_TRANS TRANS_B, int M, int N, int K, const double ALPHA, double *A, int LDA, double *B, int LDB, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdgemm (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+A, }
\item[{enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS}]{T\+R\+A\+N\+S\+\_\+B, }
\item[{int}]{M, }
\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{lass_8h_a1b27a37a58ea181d1e5f7eb91c6e0b58}{}\label{lass_8h_a1b27a37a58ea181d1e5f7eb91c6e0b58}
Performs the matrix-\/matrix operation\+: \begin{DoxyVerb}C = ALPHA * op( A ) * op( B ) + 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, and A, B and C are matrices, with op( A ) an M by K matrix, op( B ) a K by N matrix and C an M by N matrix.


\begin{DoxyParams}[1]{Parameters}
\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 in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( A ) = A.
\item Trans\+: op( A ) = A$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em T\+R\+A\+N\+S\+\_\+B} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+B specifies the form of op( B ) to be used in the matrix multiplication as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: op( B ) = B.
\item Trans\+: op( B ) = B$\ast$$\ast$T.
\end{DoxyItemize}\\
\hline
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A and of the matrix C. M must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix B and the number of columns of the matrix C. N must be greater than zero.\\
\hline
\mbox{\tt in}  & {\em K} & int. K specifies the number of columns of the matrix A and the number of rows of the matrix B. K must be 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 Ka ( columns ), where Ma is M and Ka is K when T\+R\+A\+N\+S\+\_\+A = No\+Trans, and Ma is K and Ka is M 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\+N\+S\+\_\+A = No\+Trans then L\+DA must be at least max( 1, K ), otherwise L\+DA must be at least max( 1, M ).\\
\hline
\mbox{\tt in}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension Kb ( rows ) by Nb ( columns ), where Kb is K and Nb is N when T\+R\+A\+N\+S\+\_\+B = No\+Trans, and Kb is N and Nb is K 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\+N\+S\+\_\+B = No\+Trans then L\+DB must be at least max( 1, N ), otherwise L\+DB must be at least max( 1, K ).\\
\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 L\+DC by N. On exit, C is overwritten by the M by N matrix ( A\+L\+P\+H\+A$\ast$op( A )$\ast$op( B ) + B\+E\+T\+A$\ast$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, M )\\
\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\+\_\+tiled2flat 
\end{DoxySeeAlso}


Definition at line 131 of file kdgemm.\+c.



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



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


\begin{DoxyCode}
136 \{
137 
138     \textcolor{comment}{// Local variables}
139     \textcolor{keywordtype}{int} mt, kt, nt;
140     \textcolor{keywordtype}{int} mi, ki, ni;
141     \textcolor{keywordtype}{int} Am, An;
142     \textcolor{keywordtype}{int} Bm, Bn;
143     \textcolor{keywordtype}{int} tile\_size\_m;
144     \textcolor{keywordtype}{int} tile\_size\_n;
145     \textcolor{keywordtype}{int} tile\_size\_k;
146     \textcolor{keywordtype}{int} k\_check;
147     \textcolor{keywordtype}{double} betat;
148 
149     \textcolor{comment}{// Number of tiles}
150     \textcolor{keywordflow}{if} ( M % TILE\_SIZE == 0 )
151     \{
152         mt = M / TILE\_SIZE;
153     \}
154     \textcolor{keywordflow}{else}
155     \{
156         mt = ( M / TILE\_SIZE ) + 1;
157     \}
158 
159     \textcolor{keywordflow}{if} ( K % TILE\_SIZE == 0 )
160     \{
161         kt = K / TILE\_SIZE;
162     \}
163     \textcolor{keywordflow}{else}
164     \{
165         kt = ( K / TILE\_SIZE ) + 1;
166     \}
167 
168     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
169     \{
170         nt = N / TILE\_SIZE;
171     \}
172     \textcolor{keywordflow}{else}
173     \{
174         nt = ( N / TILE\_SIZE ) + 1;
175     \}
176     
177     \textcolor{comment}{/****************************}
178 \textcolor{comment}{    --Tile matrices declaration--}
179 \textcolor{comment}{    ****************************/}
180 
181     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
182     \{
183         Am = mt;
184         An = kt;
185     \}
186     \textcolor{keywordflow}{else}
187     \{
188         Am = kt;
189         An = mt;
190     \}
191         
192     \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
193     \{
194         Bm = kt;
195         Bn = nt;
196     \}
197     \textcolor{keywordflow}{else}
198     \{
199         Bm = nt;
200         Bn = kt;
201     \}
202 
203     \textcolor{comment}{/***************************}
204 \textcolor{comment}{    --Tile matrices allocation--}
205 \textcolor{comment}{    ***************************/}
206     
207     double (*TILE\_A)[An][TILE\_SIZE * TILE\_SIZE] = malloc ( Am * An * 
208         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
209 
210     \textcolor{keywordflow}{if} ( TILE\_A == NULL)
211     \{
212         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdgemm for matrix TILE\_A\(\backslash\)n"} );
213         \textcolor{keywordflow}{return} NoSuccess;
214     \}
215 
216     double (*TILE\_B)[Bn][TILE\_SIZE * TILE\_SIZE] = malloc ( Bm * Bn * 
217         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
218     
219     \textcolor{keywordflow}{if} ( TILE\_B == NULL)
220     \{
221         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdgemm for matrix TILE\_B\(\backslash\)n"} );
222         \textcolor{keywordflow}{return} NoSuccess;
223     \}
224 
225     double (*TILE\_C)[nt][TILE\_SIZE * TILE\_SIZE] = malloc ( mt * nt * 
226         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
227 
228     \textcolor{keywordflow}{if} ( TILE\_C == NULL)
229     \{
230         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdgemm for matrix TILE\_C\(\backslash\)n"} );
231         \textcolor{keywordflow}{return} NoSuccess;
232     \}
233 
234     \textcolor{comment}{/*********************************************}
235 \textcolor{comment}{    --From flat data layout to tiled data layout--  }
236 \textcolor{comment}{    *********************************************/}
237 
238     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
239     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
240     \{
241         \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, K, A, LDA, mt, kt, TILE\_A );
242     \}
243     \textcolor{keywordflow}{else}
244     \{
245         \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( K, M, A, LDA, kt, mt, TILE\_A );
246     \}
247 
248     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
249     \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
250     \{
251         \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( K, N, B, LDB, kt, nt, TILE\_B );
252     \}
253     \textcolor{keywordflow}{else}
254     \{
255         \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, K, B, LDB, nt, kt, TILE\_B );
256     \}
257     
258     \textcolor{comment}{// From flat matrix C to tile matrix TILE\_C }
259     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, N, C, LDC, mt, nt, TILE\_C );
260 
261     \textcolor{comment}{/*************}
262 \textcolor{comment}{    --DGEMM tile--}
263 \textcolor{comment}{    *************/}  
264     
265     \textcolor{keywordflow}{for} ( mi = 0; mi < mt; mi++ )
266     \{
267         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
268         \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ )
269         \{
270             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
271             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
272             \{
273                 k\_check = K;
274             \}
275             \textcolor{keywordflow}{else}
276             \{
277                 k\_check = M;
278             \}
279             \textcolor{comment}{// --Scale on C ( C = BETA * C )--  }
280             \textcolor{keywordflow}{if} ( ( ALPHA == 0.0 ) || ( k\_check == 0 ) )
281             \{
282 \textcolor{preprocessor}{                #pragma oss task inout( TILE\_C[mi][ni] ) \(\backslash\)}
283 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B, TILE\_C ) \(\backslash\)}
284 \textcolor{preprocessor}{                    firstprivate( mi, ni ) \(\backslash\)}
285 \textcolor{preprocessor}{                    no\_copy\_deps}
286                 cblas\_dgemm( CblasRowMajor, 
287                             ( CBLAS\_TRANSPOSE ) TRANS\_A,
288                             ( CBLAS\_TRANSPOSE ) TRANS\_B,
289                             tile\_size\_m, 
290                             tile\_size\_n, 
291                                       0,
292                             ALPHA,   TILE\_A[0][0], 1, 
293                                      TILE\_B[0][0], 1, 
294                              BETA, TILE\_C[mi][ni], tile\_size\_n );
295             \}
296             \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
297             \{
298                 \textcolor{comment}{// --TRANS\_A = NoTrans & TRANS\_B = NoTrans--    }
299                 \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
300                 \{
301                     \textcolor{keywordflow}{for} ( ki = 0; ki < kt; ki++ )
302                     \{
303                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ki );
304                         \textcolor{keywordflow}{if} (ki == 0)
305                         \{
306                             betat = BETA;
307                         \}
308                         \textcolor{keywordflow}{else} 
309                         \{
310                             betat = 1.0;
311                         \}  
312                         
313 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
314 \textcolor{preprocessor}{                            in( TILE\_B[ki][ni] ) \(\backslash\)}
315 \textcolor{preprocessor}{                            inout( TILE\_C[mi][ni] ) \(\backslash\)}
316 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B, TILE\_C ) \(\backslash\)}
317 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki, betat ) \(\backslash\)}
318 \textcolor{preprocessor}{                            no\_copy\_deps}
319                         cblas\_dgemm( CblasRowMajor, 
320                                     ( CBLAS\_TRANSPOSE ) TRANS\_A,
321                                     ( CBLAS\_TRANSPOSE ) TRANS\_B,
322                                     tile\_size\_m, 
323                                     tile\_size\_n, 
324                                     tile\_size\_k,
325                                     ALPHA, TILE\_A[mi][ki], tile\_size\_k,
326                                            TILE\_B[ki][ni], tile\_size\_n,
327                                     betat, TILE\_C[mi][ni], tile\_size\_n );
328                     \}
329                 \}
330                 \textcolor{comment}{// --TRANS\_A = NoTrans & TRANS\_B = Trans--  }
331                 \textcolor{keywordflow}{else}
332                 \{
333                     \textcolor{keywordflow}{for} ( ki = 0; ki < kt; ki++ )
334                     \{
335                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ki );
336                         \textcolor{keywordflow}{if} (ki == 0)
337                         \{
338                             betat = BETA;
339                         \}
340                         \textcolor{keywordflow}{else} 
341                         \{
342                             betat = 1.0;
343                         \}  
344                             
345 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
346 \textcolor{preprocessor}{                            in( TILE\_B[ni][ki] ) \(\backslash\)}
347 \textcolor{preprocessor}{                            inout( TILE\_C[mi][ni] ) \(\backslash\)}
348 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B, TILE\_C ) \(\backslash\)}
349 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki, betat )}
350                         cblas\_dgemm( CblasRowMajor, 
351                                     ( CBLAS\_TRANSPOSE ) TRANS\_A,
352                                     ( CBLAS\_TRANSPOSE ) TRANS\_B,
353                                     tile\_size\_m, 
354                                     tile\_size\_n, 
355                                     tile\_size\_k,
356                                     ALPHA,  TILE\_A[mi][ki], tile\_size\_k,
357                                             TILE\_B[ni][ki], tile\_size\_k,
358                                     betat,  TILE\_C[mi][ni], tile\_size\_n );
359                     \}
360                 \}
361             \}
362             \textcolor{keywordflow}{else}
363             \{
364                 \textcolor{comment}{// --TRANS\_A = Trans & TRANS\_B = NoTrans--  }
365                 \textcolor{keywordflow}{if} ( TRANS\_B == NoTrans )
366                 \{
367                     \textcolor{keywordflow}{for} ( ki = 0; ki < kt; ki++ )
368                     \{
369                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ki );
370                         \textcolor{keywordflow}{if} (ki == 0)
371                         \{
372                             betat = BETA;
373                         \}
374                         \textcolor{keywordflow}{else} 
375                         \{
376                             betat = 1.0;
377                         \}  
378 
379 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
380 \textcolor{preprocessor}{                            in( TILE\_B[ki][ni] ) \(\backslash\)}
381 \textcolor{preprocessor}{                            inout( TILE\_C[mi][ni] ) \(\backslash\)}
382 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B, TILE\_C ) \(\backslash\)}
383 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki, betat )}
384                         cblas\_dgemm( CblasRowMajor, 
385                                     ( CBLAS\_TRANSPOSE ) TRANS\_A,
386                                     ( CBLAS\_TRANSPOSE ) TRANS\_B,
387                                     tile\_size\_m, 
388                                     tile\_size\_n, 
389                                     tile\_size\_k,
390                                     ALPHA,  TILE\_A[ki][mi], tile\_size\_m,
391                                             TILE\_B[ki][ni], tile\_size\_n,
392                                     betat,  TILE\_C[mi][ni], tile\_size\_n );
393                     \}
394                 \}   
395                 \textcolor{comment}{// --TRANS\_A = Trans & TRANS\_B = Trans--    }
396                 \textcolor{keywordflow}{else}
397                 \{
398                     \textcolor{keywordflow}{for} ( ki = 0; ki < kt; ki++ )
399                     \{
400                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ki );
401                         \textcolor{keywordflow}{if} (ki == 0)
402                         \{
403                             betat = BETA;
404                         \}
405                         \textcolor{keywordflow}{else} 
406                         \{
407                             betat = 1.0;
408                         \}  
409                         
410 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
411 \textcolor{preprocessor}{                            in( TILE\_B[ni][ki] ) \(\backslash\)}
412 \textcolor{preprocessor}{                            inout( TILE\_C[mi][ni] ) \(\backslash\)}
413 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B, TILE\_C ) \(\backslash\)}
414 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki, betat )}
415                         cblas\_dgemm( CblasRowMajor, 
416                                     ( CBLAS\_TRANSPOSE ) TRANS\_A,
417                                     ( CBLAS\_TRANSPOSE ) TRANS\_B,
418                                     tile\_size\_m, 
419                                     tile\_size\_n, 
420                                     tile\_size\_k,
421                                     ALPHA,  TILE\_A[ki][mi], tile\_size\_m,
422                                             TILE\_B[ni][ki], tile\_size\_k,
423                                     betat,  TILE\_C[mi][ni], tile\_size\_n );
424                     \}
425                 \}
426             \}
427         \}
428     \}
429     
430     \textcolor{comment}{/************************************************}
431 \textcolor{comment}{    // --From tiled data layout to flat data layout--   }
432 \textcolor{comment}{    ************************************************/}
433     
434     \textcolor{comment}{// From tile matrix TILE\_C to flat matrix C }
435     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( M, N, C, LDC, mt, nt, TILE\_C );
436 
437     \textcolor{comment}{// --Tile matrices free--}
438     free( TILE\_A );
439     free( TILE\_B );
440     free( TILE\_C );
441 
442     \textcolor{keywordflow}{return} Success;
443 
444 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdnpgesv@{kdnpgesv}}
\index{kdnpgesv@{kdnpgesv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdnpgesv(int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{kdnpgesv(int N, int NRHS, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdnpgesv (
\begin{DoxyParamCaption}
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a4ca30528b6350dafb182059e8ef46a97}{}\label{lass_8h_a4ca30528b6350dafb182059e8ef46a97}
Solves a system of linear equations A  X = B, where A is a N-\/by-\/N general matrix and X and B are N-\/by-\/\+N\+R\+HS matrices. The matrix A is factorized using the LU descomposition without pivoting. The matrix A is descomposed as\+: \begin{DoxyVerb}A = L * U
\end{DoxyVerb}


where L is a lower triangular matrix with unit diagonal elements and U is an upper triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em N} & int. N specifies the order of the square matrix A. N $>$= 0.\\
\hline
\end{DoxyParams}
N\+R\+HS int. N\+R\+HS specifies the number of right-\/hand-\/sides (number of columns of B). N\+R\+HS $>$= 0.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension N-\/by-\/\+L\+DA. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension N by N\+R\+HS, which stores the right-\/hand-\/sides of the systems of linear equations. (row-\/major order). On exit, if return value is Success, the matrix B is overwriten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N\+R\+H\+S ).\\
\hline
\end{DoxyParams}

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

ddss\+\_\+tile 

ddss\+\_\+flat2tiled 

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


Definition at line 86 of file kdnpgesv.\+c.



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



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


\begin{DoxyCode}
89 \{
90 
91     \textcolor{comment}{// Local variables}
92     \textcolor{keywordtype}{int} nt, nrhst;
93     \textcolor{keywordtype}{int} mi, mmi, ki, ni, nni;
94     \textcolor{keywordtype}{int} tile\_size\_m;
95     \textcolor{keywordtype}{int} tile\_size\_mm;
96     \textcolor{keywordtype}{int} tile\_size\_n;
97     \textcolor{keywordtype}{int} tile\_size\_nn;
98     \textcolor{keywordtype}{int} tile\_size\_k;
99 
100     \textcolor{comment}{// Number of tiles}
101     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
102     \{
103         nt = N / TILE\_SIZE;
104     \}
105     \textcolor{keywordflow}{else}
106     \{
107         nt = ( N / TILE\_SIZE ) + 1;
108     \}
109 
110     \textcolor{keywordflow}{if} ( NRHS % TILE\_SIZE == 0 )
111     \{
112         nrhst = NRHS / TILE\_SIZE;
113     \}
114     \textcolor{keywordflow}{else}
115     \{
116         nrhst = ( NRHS / TILE\_SIZE ) + 1;
117     \}
118 
119     \textcolor{comment}{/***************************}
120 \textcolor{comment}{    --Tile matrices allocation--}
121 \textcolor{comment}{    ***************************/}
122         
123     double (*TILE\_A)[nt][TILE\_SIZE * TILE\_SIZE] = malloc ( nt * nt * 
124         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
125     
126     \textcolor{keywordflow}{if} ( TILE\_A == NULL )
127     \{
128         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdnpgesv for matrix TILE\_A\(\backslash\)n"} );
129         \textcolor{keywordflow}{return} NoSuccess;
130     \}
131     
132     double ( *TILE\_B )[nrhst][TILE\_SIZE * TILE\_SIZE] = malloc(
133              nt * nrhst * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
134 
135     \textcolor{keywordflow}{if} ( TILE\_B == NULL ) 
136     \{
137         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdnpgesv for matrix TILE\_B\(\backslash\)n"} );
138         \textcolor{keywordflow}{return} NoSuccess;
139     \}
140     
141     \textcolor{comment}{/************************************************}
142 \textcolor{comment}{    // --From flat data layout to tiled data layout--   }
143 \textcolor{comment}{    ************************************************/}
144 
145     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
146     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, N, A, LDA, nt, nt, TILE\_A );
147     
148     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
149     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
150 
151     \textcolor{comment}{/****************}
152 \textcolor{comment}{    --DNPGESV tile--}
153 \textcolor{comment}{    ****************/}   
154 
155     \textcolor{comment}{// LU descomposition without pivoting}
156     \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
157     \{
158         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
159         
160 \textcolor{preprocessor}{        #if defined(LASs\_WITH\_MKL)}
161         
162 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
163 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
164 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
165 \textcolor{preprocessor}{                label( mkl\_dgetrfnpi )}
166         LAPACKE\_mkl\_dgetrfnpi( CblasRowMajor,
167                                tile\_size\_k, tile\_size\_k,
168                                tile\_size\_k,
169                                TILE\_A[ki][ki], tile\_size\_k );
170 
171 \textcolor{preprocessor}{        #else}
172 
173 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
174 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
175 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
176 \textcolor{preprocessor}{                label( dnpgetrf )}
177         \hyperlink{dnpgetrf_8c_a90f43bdc154edb1979f7ffce22e142ff}{dnpgetrf}( tile\_size\_k, tile\_size\_k,
178                   TILE\_A[ki][ki],
179                   tile\_size\_k );
180 
181 \textcolor{preprocessor}{        #endif}
182             
183         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
184         \{
185             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
186             
187 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
188 \textcolor{preprocessor}{                    inout(TILE\_A[mi][ki]) \(\backslash\)}
189 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
190 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
191 \textcolor{preprocessor}{                    label( dnpgetrf\_dtrsm\_below )}
192             cblas\_dtrsm( CblasRowMajor, 
193                          ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Upper, 
194                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) NonUnit, 
195                          tile\_size\_m, tile\_size\_k, 
196                          1.0, TILE\_A[ki][ki], tile\_size\_k, 
197                               TILE\_A[mi][ki], tile\_size\_k );
198         \}
199         \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ )
200         \{
201             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
202             
203 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
204 \textcolor{preprocessor}{                    inout(TILE\_A[ki][ni]) \(\backslash\)}
205 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
206 \textcolor{preprocessor}{                    firstprivate( ni, ki ) \(\backslash\)}
207 \textcolor{preprocessor}{                    label( dnpgetrf\_dtrsm\_right )}
208             cblas\_dtrsm( CblasRowMajor, 
209                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower, 
210                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) Unit, 
211                          tile\_size\_k, tile\_size\_n, 
212                          1.0, TILE\_A[ki][ki], tile\_size\_k, 
213                               TILE\_A[ki][ni], tile\_size\_n );
214             
215             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < nt; mmi++ )
216             \{
217                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mmi );
218                                 
219 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
220 \textcolor{preprocessor}{                        in( TILE\_A[ki][ni] ) \(\backslash\)}
221 \textcolor{preprocessor}{                        inout( TILE\_A[mmi][ni] ) \(\backslash\)}
222 \textcolor{preprocessor}{                        shared( TILE\_A ) \(\backslash\)}
223 \textcolor{preprocessor}{                        firstprivate( ni, mmi, ki ) \(\backslash\)}
224 \textcolor{preprocessor}{                        label( dnpgetrf\_dgemm )}
225                 cblas\_dgemm( CblasRowMajor, 
226                              ( CBLAS\_TRANSPOSE ) NoTrans,
227                              ( CBLAS\_TRANSPOSE ) NoTrans,
228                              tile\_size\_mm, 
229                              tile\_size\_n, 
230                              TILE\_SIZE,
231                              -1.0, TILE\_A[mmi][ki], tile\_size\_k,
232                                    TILE\_A[ki][ni],  tile\_size\_n,
233                               1.0, TILE\_A[mmi][ni], tile\_size\_n );
234             \}
235         \}
236     \}
237     
238     \textcolor{comment}{/*********************************************}
239 \textcolor{comment}{    --From tiled data layout to flat data layout--  }
240 \textcolor{comment}{    *********************************************/}
241     \hyperlink{ddss__tiled2flat_8c_adb1f9312d77184467236d25bc73f21b0}{ddss\_dtiled2flat\_nb}( N, N, A, LDA, nt, nt, TILE\_A );
242 
243     \textcolor{comment}{// Triandular solve}
244     \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = NoTrans & Unit-- }
245     \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
246     \{
247         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
248 
249         \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )
250         \{
251             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
252                         
253 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
254 \textcolor{preprocessor}{                inout(  TILE\_B[ki][ni] ) \(\backslash\)}
255 \textcolor{preprocessor}{                shared( TILE\_A, TILE\_B ) \(\backslash\)}
256 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
257 \textcolor{preprocessor}{                label( dtrsm\_dtrsm1 )}
258             cblas\_dtrsm( CblasRowMajor,
259                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower,
260                          ( CBLAS\_TRANSPOSE ) NoTrans,
261                          ( CBLAS\_DIAG ) Unit,
262                          tile\_size\_k,
263                          tile\_size\_n,
264                          1.0, TILE\_A[ki][ki], tile\_size\_k,
265                               TILE\_B[ki][ni], tile\_size\_n );
266         \}
267         \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ ) 
268         \{
269             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
270                 
271             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
272             \{
273                     
274 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
275 \textcolor{preprocessor}{                    in( TILE\_B[ki][nni] ) \(\backslash\)}
276 \textcolor{preprocessor}{                    inout( TILE\_B[mi][nni] ) \(\backslash\)}
277 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
278 \textcolor{preprocessor}{                    firstprivate( ki, mi, nni ) \(\backslash\)}
279 \textcolor{preprocessor}{                    label( dtrsm\_dgemm1 )}
280                 cblas\_dgemm( CblasRowMajor,
281                              CblasNoTrans, CblasNoTrans,
282                              tile\_size\_k,
283                              tile\_size\_nn,
284                              tile\_size\_k,
285                              -1.0,  TILE\_A[mi][ki],  tile\_size\_k,
286                                    TILE\_B[ki][nni], tile\_size\_nn,
287                               1.0, TILE\_B[mi][nni], tile\_size\_nn );
288             \}
289         \}
290     \}
291 
292     \textcolor{comment}{// Triandular solve}
293     \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = NoTrans & NonUnit--}
294     \textcolor{keywordflow}{for} ( ki = nt - 1; ki >= 0; ki-- ) 
295     \{
296         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
297         
298         \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ ) 
299         \{
300             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
301 
302 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
303 \textcolor{preprocessor}{                inout( TILE\_B[ki][ni] ) \(\backslash\)}
304 \textcolor{preprocessor}{                shared( TILE\_A, TILE\_B ) \(\backslash\)}
305 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
306 \textcolor{preprocessor}{                label( dtrsmi\_dtrsm2 )}
307             cblas\_dtrsm( CblasRowMajor,
308                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Upper,
309                          ( CBLAS\_TRANSPOSE ) NoTrans,
310                          ( CBLAS\_DIAG ) NonUnit,
311                          tile\_size\_k, 
312                          tile\_size\_n,
313                          1.0, TILE\_A[ki][ki], tile\_size\_k,
314                               TILE\_B[ki][ni], tile\_size\_n );
315         \}
316 
317         \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- ) 
318         \{
319             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
320             
321             \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ ) 
322             \{
323                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
324 
325 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
326 \textcolor{preprocessor}{                    in( TILE\_B[ki][nni] ) \(\backslash\)}
327 \textcolor{preprocessor}{                    inout( TILE\_B[mi][nni] ) \(\backslash\)}
328 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
329 \textcolor{preprocessor}{                    firstprivate( ki, mi, nni ) \(\backslash\)}
330 \textcolor{preprocessor}{                    label( dtrsm\_dgemm2 )}
331                 cblas\_dgemm( CblasRowMajor,
332                              CblasNoTrans, CblasNoTrans,
333                              tile\_size\_m, 
334                              tile\_size\_nn, 
335                              tile\_size\_k,
336                              -1.0, TILE\_A[mi][ki],  tile\_size\_k,
337                                    TILE\_B[ki][nni], tile\_size\_nn,
338                               1.0, TILE\_B[mi][nni], tile\_size\_nn );
339             \}
340         \}
341     \}
342 
343     \textcolor{comment}{/*********************************************}
344 \textcolor{comment}{    --From tiled data layout to flat data layout--  }
345 \textcolor{comment}{    *********************************************/}
346     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
347     
348     \textcolor{comment}{// --Tile A and B matrices free--}
349     free( TILE\_A );
350     free( TILE\_B );
351     
352     \textcolor{keywordflow}{return} Success;
353 
354 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdnpgetrf@{kdnpgetrf}}
\index{kdnpgetrf@{kdnpgetrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdnpgetrf(int M, int N, double $\ast$\+A, int L\+D\+A)}{kdnpgetrf(int M, int N, double *A, int LDA)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdnpgetrf (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_aad8c6b9542e74c481faff1ff5e03850f}{}\label{lass_8h_aad8c6b9542e74c481faff1ff5e03850f}
Performs the LU factorization without pivoting of a general M-\/by-\/N matrix A\+: \begin{DoxyVerb}A = L * U
\end{DoxyVerb}


where L is a lower triangular ( lower trapezoidal if M $>$ N ) matrix with unit diagonal elements and U is an upper triangular ( upper trapezoidal if M $<$ N ) matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A. M $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix A. N $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension M-\/by-\/N. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\end{DoxyParams}

\begin{DoxyRetVals}{Return values}
{\em Success} & successful exit \\
\hline
{\em No\+Success} & unsuccessful exit\\
\hline
\end{DoxyRetVals}
\begin{DoxySeeAlso}{See also}
\hyperlink{lass_8h_a90f43bdc154edb1979f7ffce22e142ff}{dnpgetrf} 

tune\+\_\+dnpgetrf 

smart\+\_\+dnpgetrf 

ddss\+\_\+tile 

ddss\+\_\+flat2tiled 

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


Definition at line 74 of file kdnpgetrf.\+c.



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



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


\begin{DoxyCode}
75 \{
76 
77     \textcolor{comment}{// Local variables}
78     \textcolor{keywordtype}{int} mt, nt;
79     \textcolor{keywordtype}{int} mi, mmi, ki, ni, nni, li;
80     \textcolor{keywordtype}{int} tile\_size\_m;
81     \textcolor{keywordtype}{int} tile\_size\_mm;
82     \textcolor{keywordtype}{int} tile\_size\_n;
83     \textcolor{keywordtype}{int} tile\_size\_nn;
84     \textcolor{keywordtype}{int} tile\_size\_k;
85     \textcolor{keywordtype}{int} tile\_size\_km;
86     \textcolor{keywordtype}{int} tile\_size\_kn;
87 
88     \textcolor{comment}{// Number of tiles}
89     \textcolor{keywordflow}{if} ( M % TILE\_SIZE == 0 )
90     \{
91         mt = M / TILE\_SIZE;
92     \}
93     \textcolor{keywordflow}{else}
94     \{
95         mt = ( M / TILE\_SIZE ) + 1;
96     \}
97 
98     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
99     \{
100         nt = N / TILE\_SIZE;
101     \}
102     \textcolor{keywordflow}{else}
103     \{
104         nt = ( N / TILE\_SIZE ) + 1;
105     \}
106 
107     \textcolor{comment}{/***************************}
108 \textcolor{comment}{    --Tile A matrix allocation--}
109 \textcolor{comment}{    ***************************/}
110         
111     double (*TILE\_A)[nt][TILE\_SIZE * TILE\_SIZE] = malloc ( mt * nt * 
112         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
113     
114     \textcolor{keywordflow}{if} ( TILE\_A == NULL )
115     \{
116         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdnpgetrf for matrix TILE\_A\(\backslash\)n"} );
117         \textcolor{keywordflow}{return} NoSuccess;
118     \}
119 
120     \textcolor{comment}{/*********************************************}
121 \textcolor{comment}{    --From flat data layout to tiled data layout--  }
122 \textcolor{comment}{    *********************************************/}
123 
124     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, N, A, LDA, mt, nt, TILE\_A );
125 
126     \textcolor{comment}{/****************}
127 \textcolor{comment}{    --DNPGETRF tile--}
128 \textcolor{comment}{    ****************/}   
129     
130     \textcolor{keywordflow}{for} ( ki = 0; ki < MIN( mt, nt ); ki++ )
131     \{
132         tile\_size\_km = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
133         tile\_size\_kn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
134         
135 \textcolor{preprocessor}{        #if defined(LASs\_WITH\_MKL)}
136         
137         tile\_size\_k = MIN( tile\_size\_km, tile\_size\_kn );
138         
139 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
140 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
141 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
142 \textcolor{preprocessor}{                priority( nt ) \(\backslash\)}
143 \textcolor{preprocessor}{                label( mkl\_dgetrfnpi )}
144         LAPACKE\_mkl\_dgetrfnpi( CblasRowMajor,
145                                tile\_size\_km, tile\_size\_kn,
146                                tile\_size\_k,
147                                TILE\_A[ki][ki], tile\_size\_kn );
148 
149 \textcolor{preprocessor}{        #else}
150 
151 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
152 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
153 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
154 \textcolor{preprocessor}{                priority( nt ) \(\backslash\)}
155 \textcolor{preprocessor}{                label( dnpgetrf )}
156         \hyperlink{dnpgetrf_8c_a90f43bdc154edb1979f7ffce22e142ff}{dnpgetrf}( tile\_size\_km, tile\_size\_kn,
157                   TILE\_A[ki][ki],
158                   tile\_size\_kn );
159 
160 \textcolor{preprocessor}{        #endif}
161             
162         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ )
163         \{
164             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
165             
166 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
167 \textcolor{preprocessor}{                    inout(TILE\_A[mi][ki]) \(\backslash\)}
168 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
169 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
170 \textcolor{preprocessor}{                    priority( nt ) \(\backslash\)}
171 \textcolor{preprocessor}{                    label( dtrsm\_below )}
172             cblas\_dtrsm( CblasRowMajor, 
173                          ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Upper, 
174                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) NonUnit, 
175                          tile\_size\_m, tile\_size\_kn, 
176                          1.0, TILE\_A[ki][ki], tile\_size\_kn, 
177                               TILE\_A[mi][ki], tile\_size\_kn );
178         \}
179         \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ )
180         \{
181             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
182             
183 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
184 \textcolor{preprocessor}{                    inout(TILE\_A[ki][ni]) \(\backslash\)}
185 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
186 \textcolor{preprocessor}{                    firstprivate( ni, ki ) \(\backslash\)}
187 \textcolor{preprocessor}{                    priority( nt ) \(\backslash\)}
188 \textcolor{preprocessor}{                    label( dtrsm\_right )}
189             cblas\_dtrsm( CblasRowMajor, 
190                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower, 
191                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) Unit, 
192                          tile\_size\_km, tile\_size\_n, 
193                          1.0, TILE\_A[ki][ki], tile\_size\_kn, 
194                               TILE\_A[ki][ni], tile\_size\_n );
195         \}
196         
197         \textcolor{keywordflow}{for} ( nni = ki + 1; nni < nt; nni++ )
198         \{
199             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
200 
201             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < mt; mmi++ )
202             \{
203                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
204                                 
205 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
206 \textcolor{preprocessor}{                    in( TILE\_A[ki][nni] ) \(\backslash\)}
207 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][nni] ) \(\backslash\)}
208 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
209 \textcolor{preprocessor}{                    firstprivate( nni, mmi, ki ) \(\backslash\)}
210 \textcolor{preprocessor}{                    priority( nt - nni ) \(\backslash\)}
211 \textcolor{preprocessor}{                    label( dgemm )}
212                 cblas\_dgemm( CblasRowMajor, 
213                              ( CBLAS\_TRANSPOSE ) NoTrans,
214                              ( CBLAS\_TRANSPOSE ) NoTrans,
215                              tile\_size\_mm, 
216                              tile\_size\_nn, 
217                              TILE\_SIZE,
218                              -1.0, TILE\_A[mmi][ki],  tile\_size\_kn,
219                                    TILE\_A[ki][nni],  tile\_size\_nn,
220                               1.0, TILE\_A[mmi][nni], tile\_size\_nn );
221             \}
222         \}
223     \}
224 
225     \textcolor{comment}{// --From tile data layout to flat data layout--    }
226     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( M, N, A, LDA, mt, nt, TILE\_A );
227 
228     \textcolor{comment}{// --Tile A matrix free--}
229     free( TILE\_A );
230 
231     \textcolor{keywordflow}{return} Success;
232 
233 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdposv@{kdposv}}
\index{kdposv@{kdposv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdposv(enum D\+D\+S\+S\+\_\+\+U\+P\+L\+O U\+P\+L\+O, int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, double $\ast$\+B, int L\+D\+B)}{kdposv(enum DDSS_UPLO UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdposv (
\begin{DoxyParamCaption}
\item[{enum D\+D\+S\+S\+\_\+\+U\+P\+LO}]{U\+P\+LO, }
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_ad9d439560ff8b96c5fdd6aa4ead8176f}{}\label{lass_8h_ad9d439560ff8b96c5fdd6aa4ead8176f}
Solves a system of linear equations A  X = B, where A is a M-\/by-\/M simmetric positive definite matrix and X and B are M-\/by-\/\+N\+R\+HS matrices. The matrix A is descomposed as\+: \begin{DoxyVerb}A = L \times L^T
or
A = U^T \times U
\end{DoxyVerb}


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


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

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

ddss\+\_\+tile 

ddss\+\_\+symflat2tiled 

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


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



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



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


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


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


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

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

ddss\+\_\+tile 

ddss\+\_\+symflat2tiled 

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


Definition at line 78 of file kdpotrf.\+c.



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



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


\begin{DoxyCode}
79 \{
80 
81     \textcolor{comment}{// Local variables}
82     \textcolor{keywordtype}{int} nt;
83     \textcolor{keywordtype}{int} mi, mmi, ki, ni;
84     \textcolor{keywordtype}{int} Am;
85     \textcolor{keywordtype}{int} An;
86     \textcolor{keywordtype}{int} tile\_size\_m;
87     \textcolor{keywordtype}{int} tile\_size\_mm;
88     \textcolor{keywordtype}{int} tile\_size\_n;
89     \textcolor{keywordtype}{int} tile\_size\_k;
90     \textcolor{keywordtype}{int} k\_check;
91     \textcolor{keywordtype}{double} betat;
92 
93     \textcolor{comment}{// Number of tiles}
94     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
95     \{
96         nt = N / TILE\_SIZE;
97     \}
98     \textcolor{keywordflow}{else}
99     \{
100         nt = ( N / TILE\_SIZE ) + 1;
101     \}
102     
103     \textcolor{comment}{/****************************}
104 \textcolor{comment}{    --Tile A matrix declaration--}
105 \textcolor{comment}{    ****************************/}
106 
107     Am = nt;
108     An = nt;
109     
110     \textcolor{comment}{/***************************}
111 \textcolor{comment}{    --Tile A matrix allocation--}
112 \textcolor{comment}{    ***************************/}
113         
114     double (*TILE\_A)[An][TILE\_SIZE * TILE\_SIZE] = malloc ( Am * An * 
115         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
116     
117     \textcolor{keywordflow}{if} ( TILE\_A == NULL)
118     \{
119         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdpotrf for matrix TILE\_A\(\backslash\)n"} );
120         \textcolor{keywordflow}{return} NoSuccess;
121     \}
122 
123     \textcolor{comment}{/************************************************}
124 \textcolor{comment}{    // --From flat data layout to tiled data layout--   }
125 \textcolor{comment}{    ************************************************/}
126 
127     \hyperlink{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{ddss\_dsymflat2tiled}( N, N, A, LDA, nt, nt, TILE\_A, UPLO );
128 
129     \textcolor{comment}{/**************}
130 \textcolor{comment}{    --DPOTRF tile--}
131 \textcolor{comment}{    **************/} 
132 
133     \textcolor{keywordflow}{if} ( UPLO == Lower )
134     \{   
135         \textcolor{comment}{// --UPLO = Lower-- }
136         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
137         \{
138             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
139     
140 \textcolor{preprocessor}{            #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
141 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
142 \textcolor{preprocessor}{                label( dpotrf )}
143             LAPACKE\_dpotrf\_work( LAPACK\_ROW\_MAJOR, 
144                              \textcolor{charliteral}{'L'},
145                              tile\_size\_k, TILE\_A[ki][ki], tile\_size\_k );
146 
147             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
148             \{
149                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
150             
151 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
152 \textcolor{preprocessor}{                    inout(TILE\_A[mi][ki]) \(\backslash\)}
153 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
154 \textcolor{preprocessor}{                    label( dtrsm )}
155                 cblas\_dtrsm( CblasRowMajor, 
156                              ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Lower, 
157                              ( CBLAS\_TRANSPOSE ) Trans, ( CBLAS\_DIAG ) NonUnit, 
158                              tile\_size\_m, TILE\_SIZE, 
159                              1.0, TILE\_A[ki][ki], TILE\_SIZE, 
160                                   TILE\_A[mi][ki], TILE\_SIZE );
161             \}
162             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < nt; mmi++ )
163             \{
164                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mmi );
165             
166 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
167 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][mmi] ) \(\backslash\)}
168 \textcolor{preprocessor}{                    firstprivate( mmi, ki ) \(\backslash\)}
169 \textcolor{preprocessor}{                    label( dsyrk )}
170                 cblas\_dsyrk( CblasRowMajor, 
171                              ( CBLAS\_UPLO ) Lower, ( CBLAS\_TRANSPOSE ) NoTrans, 
172                              tile\_size\_mm, TILE\_SIZE, 
173                              -1.0,  TILE\_A[mmi][ki], TILE\_SIZE, 
174                               1.0, TILE\_A[mmi][mmi], tile\_size\_mm );
175             
176                 \textcolor{keywordflow}{for} ( ni = ki + 1; ni < mmi; ni++ )
177                 \{
178                 
179 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
180 \textcolor{preprocessor}{                        in( TILE\_A[ni][ki] ) \(\backslash\)}
181 \textcolor{preprocessor}{                        inout( TILE\_A[mmi][ni] ) \(\backslash\)}
182 \textcolor{preprocessor}{                        firstprivate( ni, mmi, ki ) \(\backslash\)}
183 \textcolor{preprocessor}{                        label( dgemm )}
184                         cblas\_dgemm( CblasRowMajor, 
185                                      ( CBLAS\_TRANSPOSE ) NoTrans,
186                                      ( CBLAS\_TRANSPOSE ) Trans,
187                                      TILE\_SIZE, 
188                                      TILE\_SIZE, 
189                                      TILE\_SIZE,
190                                      -1.0, TILE\_A[mmi][ki], TILE\_SIZE,
191                                             TILE\_A[ni][ki], TILE\_SIZE,
192                                       1.0, TILE\_A[mmi][ni], TILE\_SIZE );
193                 \}
194             \}
195         \}
196     \}
197     \textcolor{keywordflow}{else}
198     \{
199         \textcolor{comment}{// --UPLO = Upper-- }
200         \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
201         \{
202             tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
203             
204 \textcolor{preprocessor}{            #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
205 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
206 \textcolor{preprocessor}{                firstprivate( ki ) \(\backslash\)}
207 \textcolor{preprocessor}{                label( dpotrf )}
208             LAPACKE\_dpotrf\_work( LAPACK\_ROW\_MAJOR, 
209                              \textcolor{charliteral}{'U'},
210                              tile\_size\_k, TILE\_A[ki][ki], 
211                              tile\_size\_k );
212 
213             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
214             \{
215                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
216             
217 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
218 \textcolor{preprocessor}{                    inout(TILE\_A[ki][mi]) \(\backslash\)}
219 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
220 \textcolor{preprocessor}{                    firstprivate( mi, ki ) \(\backslash\)}
221 \textcolor{preprocessor}{                    label( dtrsm )}
222                 cblas\_dtrsm( CblasRowMajor, 
223                              ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Upper, 
224                              ( CBLAS\_TRANSPOSE ) Trans, ( CBLAS\_DIAG ) NonUnit, 
225                              TILE\_SIZE, tile\_size\_m, 
226                              1.0, TILE\_A[ki][ki], TILE\_SIZE, 
227                                   TILE\_A[ki][mi], tile\_size\_m );
228             \}
229             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < nt; mmi++ )
230             \{
231                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mmi );
232             
233 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[ki][mmi] ) \(\backslash\)}
234 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][mmi] ) \(\backslash\)}
235 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
236 \textcolor{preprocessor}{                    firstprivate( mmi, ki ) \(\backslash\)}
237 \textcolor{preprocessor}{                    label( dsyrk )}
238                 cblas\_dsyrk( CblasRowMajor, 
239                              ( CBLAS\_UPLO ) Upper, ( CBLAS\_TRANSPOSE ) Trans, 
240                              tile\_size\_mm, TILE\_SIZE, 
241                              -1.0,  TILE\_A[ki][mmi], tile\_size\_mm, 
242                               1.0, TILE\_A[mmi][mmi], tile\_size\_mm );
243             
244                 \textcolor{keywordflow}{for} ( ni = ki + 1; ni < mmi; ni++ )
245                 \{
246 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[ki][ni] ) \(\backslash\)}
247 \textcolor{preprocessor}{                        in( TILE\_A[ki][mmi] ) \(\backslash\)}
248 \textcolor{preprocessor}{                        inout( TILE\_A[ni][mmi] ) \(\backslash\)}
249 \textcolor{preprocessor}{                        shared( TILE\_A ) \(\backslash\)}
250 \textcolor{preprocessor}{                        firstprivate( ni, mmi, ki ) \(\backslash\)}
251 \textcolor{preprocessor}{                        label( dgemm )}
252                         cblas\_dgemm( CblasRowMajor, 
253                                      ( CBLAS\_TRANSPOSE ) Trans,
254                                      ( CBLAS\_TRANSPOSE ) NoTrans,
255                                      TILE\_SIZE, 
256                                      TILE\_SIZE, 
257                                      TILE\_SIZE,
258                                      -1.0, TILE\_A[ki][ni],  TILE\_SIZE,
259                                            TILE\_A[ki][mmi], TILE\_SIZE,
260                                       1.0, TILE\_A[ni][mmi], TILE\_SIZE );
261                 \}
262             \}
263         \}
264     \}
265 
266     \textcolor{comment}{// --From tile data layout to flat data layout--    }
267     \hyperlink{ddss__tiled2flat_8c_a7a0f7b98f2430148a5f99fc403309816}{ddss\_dsymtiled2flat}( N, N, A, LDA, nt, nt, TILE\_A, UPLO );
268 
269     \textcolor{comment}{// --Tile A matrix free--}
270     free( TILE\_A );
271 
272     \textcolor{keywordflow}{return} Success;
273 
274 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdsymm@{kdsymm}}
\index{kdsymm@{kdsymm}!lass.\+h@{lass.\+h}}
\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{lass_8h_a90d0704ec71cf332ce1c55aa29904456}{}\label{lass_8h_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}
\index{lass.\+h@{lass.\+h}!kdsyr2k@{kdsyr2k}}
\index{kdsyr2k@{kdsyr2k}!lass.\+h@{lass.\+h}}
\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{lass_8h_a2ef29953763cd105a69a3c8db2adc1b3}{}\label{lass_8h_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}
\index{lass.\+h@{lass.\+h}!kdsyrk@{kdsyrk}}
\index{kdsyrk@{kdsyrk}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdsyrk(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, int N, int K, const double A\+L\+P\+H\+A, double $\ast$\+A, int L\+D\+A, const double B\+E\+T\+A, double $\ast$\+C, int L\+D\+C)}{kdsyrk(enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, int N, int K, const double ALPHA, double *A, int LDA, const double BETA, double *C, int LDC)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdsyrk (
\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\+N\+S\+\_\+A, }
\item[{int}]{N, }
\item[{int}]{K, }
\item[{const double}]{A\+L\+P\+HA, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{const double}]{B\+E\+TA, }
\item[{double $\ast$}]{C, }
\item[{int}]{L\+DC}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a8ffc4fc508b14a7ccda98be54ded18bc}{}\label{lass_8h_a8ffc4fc508b14a7ccda98be54ded18bc}
Performs one of the symmetric rank k operations\+: \begin{DoxyVerb}C = ALPHA * A * op( A ) + BETA * C  or
C = ALPHA * op( A ) * A + BETA * C
\end{DoxyVerb}


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


A\+L\+P\+HA and B\+E\+TA are scalars, C is an N by N symmetric matrix and A is an N by K matrix in the first case and a K by N matrix 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\+N\+S\+\_\+A} & enum D\+D\+S\+S\+\_\+\+T\+R\+A\+NS. T\+R\+A\+N\+S\+\_\+A specifies the operation to be performed as follows\+:
\begin{DoxyItemize}
\item No\+Trans\+: C = A\+L\+P\+HA $\ast$ A $\ast$ A$\ast$$\ast$T + B\+E\+TA $\ast$ C
\item Trans\+: C = A\+L\+P\+HA $\ast$ A$\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\+N\+S\+\_\+A = No\+Trans, K specifies the number of columns of the matrix A, and with T\+R\+A\+N\+S\+\_\+A = Trans, K specifies the number of rows of the matrix A. 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\+N\+S\+\_\+A = 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\+N\+S\+\_\+A = 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\+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 117 of file kdsyrk.\+c.



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



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


\begin{DoxyCode}
121 \{
122     
123     \textcolor{comment}{// Local variables}
124     \textcolor{keywordtype}{int} nt, kt;
125     \textcolor{keywordtype}{int} mi, ni, ki;
126     \textcolor{keywordtype}{int} Am, An;
127     \textcolor{keywordtype}{int} Cm, Cn;
128     \textcolor{keywordtype}{int} tile\_size\_m;
129     \textcolor{keywordtype}{int} tile\_size\_n;
130     \textcolor{keywordtype}{int} tile\_size\_k;
131     \textcolor{keywordtype}{int} ka;
132     \textcolor{keywordtype}{double} beta;
133 
134     \textcolor{comment}{// Number of tiles}
135     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 ) 
136     \{
137         nt = N / TILE\_SIZE;
138     \}
139     \textcolor{keywordflow}{else}
140     \{
141         nt = ( N / TILE\_SIZE ) + 1;
142     \}
143 
144     \textcolor{keywordflow}{if} ( K % TILE\_SIZE == 0 )
145     \{
146         kt = K / TILE\_SIZE;
147     \}
148     \textcolor{keywordflow}{else}
149     \{
150         kt = ( K / TILE\_SIZE ) + 1;
151     \}
152 
153     \textcolor{comment}{/****************************}
154 \textcolor{comment}{     --Tile matrices declaration--}
155 \textcolor{comment}{     ****************************/}
156 
157     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
158     \{
159         Am = nt;
160         An = kt;
161         ka = N;
162     \}
163     \textcolor{keywordflow}{else}
164     \{
165         Am = kt;
166         An = nt;
167         ka = K;
168     \}
169     
170     Cm = Cn = nt;
171     
172     \textcolor{comment}{/***************************}
173 \textcolor{comment}{     --Tile matrices allocation--}
174 \textcolor{comment}{     ***************************/}
175 
176     double ( *TILE\_A )[An][TILE\_SIZE * TILE\_SIZE] = malloc(
177             Am * An * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
178 
179     \textcolor{keywordflow}{if} ( TILE\_A == NULL )
180     \{
181         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_A\(\backslash\)n"} );
182         \textcolor{keywordflow}{return} NoSuccess;
183     \}
184 
185     double ( *TILE\_C )[Cn][TILE\_SIZE * TILE\_SIZE] = malloc(
186             Cm * Cn * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
187 
188     \textcolor{keywordflow}{if} ( TILE\_C == NULL )
189     \{
190         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_C\(\backslash\)n"} );
191         \textcolor{keywordflow}{return} NoSuccess;
192     \}
193 
194     \textcolor{comment}{/*********************************************}
195 \textcolor{comment}{     --From flat data layout to tiled data layout-- }
196 \textcolor{comment}{     *********************************************/}
197     
198     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
199     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( ka, LDA, A, LDA, Am, An, TILE\_A );
200     
201     \textcolor{comment}{// From flat matrix C to tile matrix TILE\_C}
202     \hyperlink{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{ddss\_dsymflat2tiled}( N, N, C, LDC, Cm, Cn, TILE\_C, UPLO );
203 
204     \textcolor{comment}{/*************}
205 \textcolor{comment}{     --DSYRK tile--}
206 \textcolor{comment}{     *************/}
207     
208     \textcolor{comment}{// --TRANS\_A = NoTrans & UPLO = Upper-- }
209     \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
210     \{
211         \textcolor{keywordflow}{if} ( UPLO == Upper )
212         \{
213             \textcolor{keywordflow}{for} ( mi = 0; mi < nt; mi++ )
214             \{
215                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
216                 \textcolor{keywordflow}{for} ( ni = 0; ni < kt; ni++ )
217                 \{
218                     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ni );
219 
220                     \textcolor{keywordflow}{if} ( ni == 0 )
221                     \{
222                         beta = BETA;
223                     \}
224                     \textcolor{keywordflow}{else}
225                     \{
226                         beta = 1.0;
227                     \}
228 
229 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
230 \textcolor{preprocessor}{                        inout( TILE\_C[mi][mi] ) \(\backslash\)}
231 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_C ) \(\backslash\)}
232 \textcolor{preprocessor}{                        firstprivate( mi, ni ) \(\backslash\)}
233 \textcolor{preprocessor}{                        label( dsyrk )}
234                     cblas\_dsyrk( CblasRowMajor,
235                                  ( CBLAS\_UPLO ) UPLO, 
236                                  ( CBLAS\_TRANSPOSE ) TRANS\_A,
237                                  tile\_size\_m,
238                                  tile\_size\_n,
239                                  ALPHA, TILE\_A[mi][ni], tile\_size\_n,
240                                  beta,  TILE\_C[mi][mi], tile\_size\_m );
241 
242                     \textcolor{keywordflow}{for} ( ki = mi + 1; ki < nt; ki++ )
243                     \{
244                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
245 
246 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
247 \textcolor{preprocessor}{                            in( TILE\_A[ki][ni] ) \(\backslash\)}
248 \textcolor{preprocessor}{                            inout( TILE\_C[mi][ki] ) \(\backslash\)}
249 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_C ) \(\backslash\)}
250 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki ) \(\backslash\)}
251 \textcolor{preprocessor}{                            label( dgemm )}
252                         cblas\_dgemm( CblasRowMajor,
253                                      CblasNoTrans, CblasTrans,
254                                      tile\_size\_m,
255                                      tile\_size\_k,
256                                      tile\_size\_n,
257                                      ALPHA, TILE\_A[mi][ni], tile\_size\_n,
258                                             TILE\_A[ki][ni], tile\_size\_n,
259                                      beta,  TILE\_C[mi][ki], tile\_size\_k );
260                     \}
261 
262                 \}
263             \}
264         \}
265         \textcolor{comment}{// --TRANS\_A = NoTrans & UPLO = Lower-- }
266         \textcolor{keywordflow}{else}
267         \{
268             \textcolor{keywordflow}{for} ( mi = 0; mi < nt; mi++ ) 
269             \{
270                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
271                 \textcolor{keywordflow}{for} ( ni = 0; ni < kt; ni++ )
272                 \{
273                     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, ni );
274 
275                     \textcolor{keywordflow}{if} ( ni == 0 )
276                     \{
277                         beta = BETA;
278                     \} 
279                     \textcolor{keywordflow}{else} 
280                     \{
281                         beta = 1.0;
282                     \}
283 
284 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
285 \textcolor{preprocessor}{                        inout( TILE\_C[mi][mi] ) \(\backslash\)}
286 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_C ) \(\backslash\)}
287 \textcolor{preprocessor}{                        firstprivate( mi, ni ) \(\backslash\)}
288 \textcolor{preprocessor}{                        label( dsyrk )}
289                     cblas\_dsyrk( CblasRowMajor,
290                                  ( CBLAS\_UPLO ) UPLO, 
291                                  ( CBLAS\_TRANSPOSE ) TRANS\_A,
292                                  tile\_size\_m,
293                                  tile\_size\_n,
294                                  ALPHA, TILE\_A[mi][ni], tile\_size\_n,
295                                  beta,  TILE\_C[mi][mi], tile\_size\_m );
296 
297                     \textcolor{keywordflow}{for} ( ki = mi + 1; ki < nt; ki++ )
298                     \{
299                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
300 
301 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ni] ) \(\backslash\)}
302 \textcolor{preprocessor}{                            in( TILE\_A[mi][ni] ) \(\backslash\)}
303 \textcolor{preprocessor}{                            inout( TILE\_C[ki][mi] ) \(\backslash\)}
304 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_C ) \(\backslash\)}
305 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki ) \(\backslash\)}
306 \textcolor{preprocessor}{                            label( dgemm )}
307                         cblas\_dgemm( CblasRowMajor,
308                                      CblasNoTrans, CblasTrans,
309                                      tile\_size\_k,
310                                      tile\_size\_m,
311                                      tile\_size\_n,
312                                      ALPHA, TILE\_A[ki][ni], tile\_size\_n,
313                                             TILE\_A[mi][ni], tile\_size\_n,
314                                      beta,  TILE\_C[ki][mi], tile\_size\_m );
315                     \}
316 
317                 \}
318             \}
319         \}
320     \} 
321     \textcolor{comment}{// --TRANS\_A = Trans & UPLO = Upper-- }
322     \textcolor{keywordflow}{else}
323     \{
324         \textcolor{keywordflow}{if} ( UPLO == Upper )
325         \{
326             \textcolor{keywordflow}{for} ( mi = 0; mi < kt; mi++ )
327             \{
328                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, mi );
329                 \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ )
330                 \{
331                     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
332 
333                     \textcolor{keywordflow}{if} ( mi == 0 )
334                     \{
335                         beta = BETA;
336                     \}
337                     \textcolor{keywordflow}{else}
338                     \{
339                         beta = 1.0;
340                     \}
341 
342 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
343 \textcolor{preprocessor}{                        inout( TILE\_C[ni][ni] ) \(\backslash\)}
344 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_C ) \(\backslash\)}
345 \textcolor{preprocessor}{                        firstprivate( mi, ni ) \(\backslash\)}
346 \textcolor{preprocessor}{                        label( dsyrk )}
347                     cblas\_dsyrk( CblasRowMajor,
348                                  ( CBLAS\_UPLO ) UPLO, 
349                                  ( CBLAS\_TRANSPOSE ) TRANS\_A,
350                                  tile\_size\_n,
351                                  tile\_size\_m,
352                                  ALPHA, TILE\_A[mi][ni], tile\_size\_n,
353                                  beta,  TILE\_C[ni][ni], tile\_size\_n );
354 
355                     \textcolor{keywordflow}{for} ( ki = ni + 1; ki < nt; ki++ ) 
356                     \{
357                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
358 
359 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
360 \textcolor{preprocessor}{                            in( TILE\_A[mi][ki] ) \(\backslash\)}
361 \textcolor{preprocessor}{                            inout( TILE\_C[ni][ki] ) \(\backslash\)}
362 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_C ) \(\backslash\)}
363 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki ) \(\backslash\)}
364 \textcolor{preprocessor}{                            label( dgemm )}
365                         cblas\_dgemm( CblasRowMajor,
366                                      CblasTrans, CblasNoTrans,
367                                      tile\_size\_n,
368                                      tile\_size\_k,
369                                      tile\_size\_m,
370                                      ALPHA, TILE\_A[mi][ni], tile\_size\_n,
371                                             TILE\_A[mi][ki], tile\_size\_k,
372                                      beta,  TILE\_C[ni][ki], tile\_size\_k );
373                     \}
374                 \}
375             \}
376         \} 
377         \textcolor{comment}{// --TRANS\_A = Trans & UPLO = Lower-- }
378         \textcolor{keywordflow}{else} 
379         \{
380             \textcolor{keywordflow}{for} ( mi = 0; mi < kt; mi++ )
381             \{
382                 tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( K, mi );
383                 \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
384                 \{
385                     tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
386 
387                     \textcolor{keywordflow}{if} ( mi == 0 )
388                     \{
389                         beta = BETA;
390                     \} 
391                     \textcolor{keywordflow}{else}
392                     \{
393                         beta = 1.0;
394                     \}
395 
396 \textcolor{preprocessor}{                    #pragma oss task in( TILE\_A[mi][ni] ) \(\backslash\)}
397 \textcolor{preprocessor}{                        inout( TILE\_C[ni][ni] ) \(\backslash\)}
398 \textcolor{preprocessor}{                        shared( TILE\_A, TILE\_C ) \(\backslash\)}
399 \textcolor{preprocessor}{                        firstprivate( mi, ni ) \(\backslash\)}
400 \textcolor{preprocessor}{                        label( dsyrk )}
401                     cblas\_dsyrk( CblasRowMajor,
402                                  ( CBLAS\_UPLO ) UPLO, 
403                                  ( CBLAS\_TRANSPOSE ) TRANS\_A,
404                                  tile\_size\_n,
405                                  tile\_size\_m,
406                                  ALPHA, TILE\_A[mi][ni], tile\_size\_n,
407                                  beta,  TILE\_C[ni][ni], tile\_size\_n );
408 
409                     \textcolor{keywordflow}{for} ( ki = ni + 1; ki < nt; ki++ )
410                     \{
411                         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
412 
413 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
414 \textcolor{preprocessor}{                            in( TILE\_A[mi][ni] ) \(\backslash\)}
415 \textcolor{preprocessor}{                            inout( TILE\_C[ki][ni] ) \(\backslash\)}
416 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_C ) \(\backslash\)}
417 \textcolor{preprocessor}{                            firstprivate( mi, ni, ki ) \(\backslash\)}
418 \textcolor{preprocessor}{                            label( dgemm )}
419                         cblas\_dgemm( CblasRowMajor,
420                                      CblasTrans, CblasNoTrans,
421                                      tile\_size\_k,
422                                      tile\_size\_n,
423                                      tile\_size\_m,
424                                      ALPHA, TILE\_A[mi][ki], tile\_size\_k,
425                                             TILE\_A[mi][ni], tile\_size\_n,
426                                      beta,  TILE\_C[ki][ni], tile\_size\_n );
427                     \}
428                 \}
429             \}
430         \}
431     \}
432 
433     \textcolor{comment}{/*********************************************}
434 \textcolor{comment}{     --From tiled data layout to flat data layout-- }
435 \textcolor{comment}{     *********************************************/}
436     
437     \hyperlink{ddss__tiled2flat_8c_a7a0f7b98f2430148a5f99fc403309816}{ddss\_dsymtiled2flat}( N, N, C, LDC, Cm, Cn, TILE\_C, UPLO );
438 
439     \textcolor{comment}{// --Tile matrices free--}
440     free( TILE\_A );
441     free( TILE\_C );
442 
443     \textcolor{keywordflow}{return} Success;
444 
445 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdtpgesv@{kdtpgesv}}
\index{kdtpgesv@{kdtpgesv}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdtpgesv(int N, int N\+R\+H\+S, double $\ast$\+A, int L\+D\+A, int $\ast$\+I\+P\+I\+V, double $\ast$\+B, int L\+D\+B)}{kdtpgesv(int N, int NRHS, double *A, int LDA, int *IPIV, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdtpgesv (
\begin{DoxyParamCaption}
\item[{int}]{N, }
\item[{int}]{N\+R\+HS, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int $\ast$}]{I\+P\+IV, }
\item[{double $\ast$}]{B, }
\item[{int}]{L\+DB}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_aa8b24e76e50652c68471955338c4e1b9}{}\label{lass_8h_aa8b24e76e50652c68471955338c4e1b9}
Solves a system of linear equations A  X = B, where A is a N-\/by-\/N general matrix and X and B are N-\/by-\/\+N\+R\+HS matrices. The matrix A is factorized using the LU descomposition with tiled-\/pivoting. The matrix A is descomposed as\+: \begin{DoxyVerb}A = P * L * U
\end{DoxyVerb}


where P is a permutation matrix, L is a lower triangular matrix with unit diagonal elements and U is an upper triangular matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em N} & int. N specifies the order of the square matrix A. N $>$= 0.\\
\hline
\end{DoxyParams}
N\+R\+HS int. N\+R\+HS specifies the number of right-\/hand-\/sides (number of columns of B). N\+R\+HS $>$= 0.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension N-\/by-\/\+L\+DA. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt out}  & {\em I\+P\+IV} & int $\ast$. ipiv is a pointer to an array of dimesion at least max( 1, min ( M, N ) ). ipiv( i ) = j, 1 $<$= i $<$= min( M, N ) implies that rows i and j have been interchanged.\\
\hline
\mbox{\tt in,out}  & {\em B} & double $\ast$. B is a pointer to a matrix of dimension N by N\+R\+HS, which stores the right-\/hand-\/sides of the systems of linear equations. (row-\/major order). On exit, if return value is Success, the matrix B is overwriten by the solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N\+R\+H\+S ).\\
\hline
\end{DoxyParams}

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

ddss\+\_\+flat2tiled 

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


Definition at line 91 of file kdtpgesv.\+c.



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



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


\begin{DoxyCode}
95 \{
96 
97     \textcolor{comment}{// Local variables}
98     \textcolor{keywordtype}{int} i;
99     \textcolor{keywordtype}{int} nt, nrhst;
100     \textcolor{keywordtype}{int} ni, mi, nni, ki, nrhsi;
101     \textcolor{keywordtype}{int} tile\_size\_n;
102     \textcolor{keywordtype}{int} tile\_size\_m;
103     \textcolor{keywordtype}{int} tile\_size\_nn;
104     \textcolor{keywordtype}{int} tile\_size\_nrhs;
105     \textcolor{keywordtype}{int} tile\_size\_k;
106     \textcolor{keywordtype}{int} local\_ipiv\_size;
107     \textcolor{keywordtype}{int} current\_position;
108     \textcolor{keyword}{enum} LASS\_RETURN ret;
109     \textcolor{keywordtype}{int} *ipiv\_local;
110 
111     \textcolor{comment}{// Number of tiles}
112     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
113     \{
114         nt = N / TILE\_SIZE;
115     \}
116     \textcolor{keywordflow}{else}
117     \{
118         nt = ( N / TILE\_SIZE ) + 1;
119     \}
120 
121     \textcolor{keywordflow}{if} ( NRHS % TILE\_SIZE == 0 )
122     \{
123         nrhst = NRHS / TILE\_SIZE;
124     \}
125     \textcolor{keywordflow}{else}
126     \{
127         nrhst = ( NRHS / TILE\_SIZE ) + 1;
128     \}
129 
130     \textcolor{comment}{/***************************}
131 \textcolor{comment}{    --Tile matrices allocation--}
132 \textcolor{comment}{    ***************************/}
133         
134     double ( *TILE\_A )[nt][TILE\_SIZE * TILE\_SIZE] = malloc ( nt * nt * 
135         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
136     
137     \textcolor{keywordflow}{if} ( TILE\_A == NULL )
138     \{
139         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdtpgesv for matrix TILE\_A\(\backslash\)n"} );
140         \textcolor{keywordflow}{return} NoSuccess;
141     \}
142     
143     double ( *TILE\_B )[nrhst][TILE\_SIZE * TILE\_SIZE] = malloc(
144              nt * nrhst * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
145 
146     \textcolor{keywordflow}{if} ( TILE\_B == NULL ) 
147     \{
148         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdtpgesv for matrix TILE\_B\(\backslash\)n"} );
149         \textcolor{keywordflow}{return} NoSuccess;
150     \}
151 
152     ipiv\_local = ( \textcolor{keywordtype}{int}* ) malloc( N * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{int} ) );
153     
154     \textcolor{keywordflow}{if} ( ipiv\_local == NULL )
155     \{
156         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdtpgesv for ipiv\_local\(\backslash\)n"} );
157         \textcolor{keywordflow}{return} NoSuccess;
158     \}
159 
160     \textcolor{comment}{/************************************************}
161 \textcolor{comment}{    // --From flat data layout to tiled data layout--   }
162 \textcolor{comment}{    ************************************************/}
163     
164     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
165     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, N, A, LDA, nt, nt, TILE\_A );
166 
167     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
168     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
169     
170     \textcolor{comment}{/****************}
171 \textcolor{comment}{    --DGETRF tile--}
172 \textcolor{comment}{    ****************/}   
173     
174     current\_position = 0;
175     i = 0;
176     \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
177     \{
178         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
179         
180 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
181 \textcolor{preprocessor}{            inout( ipiv\_local ) \(\backslash\)}
182 \textcolor{preprocessor}{            inout( current\_position ) \(\backslash\)}
183 \textcolor{preprocessor}{            out( local\_ipiv\_size ) \(\backslash\)}
184 \textcolor{preprocessor}{            shared( TILE\_A ) \(\backslash\)}
185 \textcolor{preprocessor}{            firstprivate( ki, i ) \(\backslash\)}
186 \textcolor{preprocessor}{            label( dgetrf )}
187         \{
188             LAPACKE\_dgetrf( CblasRowMajor,
189                             tile\_size\_k, tile\_size\_k, 
190                             TILE\_A[ki][ki], tile\_size\_k,
191                             ipiv\_local + current\_position );
192             
193             \textcolor{comment}{// Update the global ipiv array}
194             local\_ipiv\_size = tile\_size\_k;
195             \textcolor{keywordflow}{for} ( i = 0; i < local\_ipiv\_size; i++ )
196             \{
197                 ( IPIV + current\_position )[i] =
198                         ( ipiv\_local + current\_position )[i] + current\_position;
199             \}
200             current\_position += local\_ipiv\_size;
201         \}
202         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
203         \{
204             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
205 
206 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
207 \textcolor{preprocessor}{                inout(TILE\_A[mi][ki]) \(\backslash\)}
208 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
209 \textcolor{preprocessor}{                firstprivate( mi, ki ) \(\backslash\)}
210 \textcolor{preprocessor}{                label( dtrsm\_below )}
211             cblas\_dtrsm( CblasRowMajor, 
212                          ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Upper, 
213                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) NonUnit, 
214                          tile\_size\_m, tile\_size\_k, 
215                          1.0, TILE\_A[ki][ki], tile\_size\_k, 
216                               TILE\_A[mi][ki], tile\_size\_k );
217         \}
218         \textcolor{keywordflow}{for} ( ni = 0; ni < ki; ni++ )
219         \{       
220             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
221             \textcolor{comment}{// Swap the tiles to the left of A[ki][ki]}
222 \textcolor{preprocessor}{            #pragma oss task in ( ipiv\_local ) \(\backslash\)}
223 \textcolor{preprocessor}{                in( current\_position ) \(\backslash\)}
224 \textcolor{preprocessor}{                in( local\_ipiv\_size ) \(\backslash\)}
225 \textcolor{preprocessor}{                inout( TILE\_A[ki][ni] ) \(\backslash\)}
226 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
227 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
228 \textcolor{preprocessor}{                label( dlaswp\_left )}
229             LAPACKE\_dlaswp( CblasRowMajor,
230                             tile\_size\_n, TILE\_A[ki][ni], tile\_size\_n,
231                             1, local\_ipiv\_size,
232                             ipiv\_local + current\_position - local\_ipiv\_size, 
233                             1 );
234             
235         \}
236         \textcolor{keywordflow}{for} ( nrhsi = 0; nrhsi < nrhst; nrhsi++ )
237         \{       
238             tile\_size\_nrhs = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nrhsi );
239             \textcolor{comment}{// Swap on the B[ki][nrhsi] tile}
240 \textcolor{preprocessor}{            #pragma oss task in ( ipiv\_local ) \(\backslash\)}
241 \textcolor{preprocessor}{                in( current\_position ) \(\backslash\)}
242 \textcolor{preprocessor}{                in( local\_ipiv\_size ) \(\backslash\)}
243 \textcolor{preprocessor}{                inout( TILE\_B[ki][nrhsi] ) \(\backslash\)}
244 \textcolor{preprocessor}{                shared( TILE\_B ) \(\backslash\)}
245 \textcolor{preprocessor}{                firstprivate( ki, nrhsi ) \(\backslash\)}
246 \textcolor{preprocessor}{                label( dlaswp\_on\_B )}
247             LAPACKE\_dlaswp( CblasRowMajor,
248                             tile\_size\_nrhs, TILE\_B[ki][nrhsi], tile\_size\_nrhs,
249                             1, local\_ipiv\_size,
250                             ipiv\_local + current\_position - local\_ipiv\_size, 
251                             1 );
252             
253         \}
254         \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ )
255         \{
256             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
257             \textcolor{comment}{// Swap the tiles to the right of A[ki][ki]}
258 \textcolor{preprocessor}{            #pragma oss task in ( ipiv\_local ) \(\backslash\)}
259 \textcolor{preprocessor}{                in( current\_position ) \(\backslash\)}
260 \textcolor{preprocessor}{                in( local\_ipiv\_size ) \(\backslash\)}
261 \textcolor{preprocessor}{                inout( TILE\_A[ki][ni] ) \(\backslash\)}
262 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
263 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
264 \textcolor{preprocessor}{                label( dlaswp\_right )}
265             LAPACKE\_dlaswp( CblasRowMajor,
266                             tile\_size\_n, TILE\_A[ki][ni], tile\_size\_n,
267                             1, local\_ipiv\_size,
268                             ipiv\_local + current\_position - local\_ipiv\_size, 
269                             1 );
270 
271 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
272 \textcolor{preprocessor}{                inout(TILE\_A[ki][ni]) \(\backslash\)}
273 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
274 \textcolor{preprocessor}{                firstprivate( ni, ki ) \(\backslash\)}
275 \textcolor{preprocessor}{                label( dtrsm\_right )}
276             cblas\_dtrsm( CblasRowMajor, 
277                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower, 
278                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) Unit, 
279                          tile\_size\_k, tile\_size\_n, 
280                          1.0, TILE\_A[ki][ki], tile\_size\_k, 
281                               TILE\_A[ki][ni], tile\_size\_n );
282                 
283             \textcolor{keywordflow}{for} ( nni = ki + 1; nni < nt; nni++ )
284             \{
285                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
286         
287 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[nni][ki] ) \(\backslash\)}
288 \textcolor{preprocessor}{                    in( TILE\_A[ki][ni] ) \(\backslash\)}
289 \textcolor{preprocessor}{                    inout( TILE\_A[nni][ni] ) \(\backslash\)}
290 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
291 \textcolor{preprocessor}{                    firstprivate( ni, nni, ki ) \(\backslash\)}
292 \textcolor{preprocessor}{                    label( dgemm )}
293                 cblas\_dgemm( CblasRowMajor, 
294                              ( CBLAS\_TRANSPOSE ) NoTrans,
295                              ( CBLAS\_TRANSPOSE ) NoTrans,
296                              tile\_size\_nn, 
297                              tile\_size\_n, 
298                              TILE\_SIZE,
299                              -1.0, TILE\_A[nni][ki], tile\_size\_k,
300                                    TILE\_A[ki][ni],  tile\_size\_n,
301                               1.0, TILE\_A[nni][ni], tile\_size\_n );          
302             \}
303         \}
304     \}
305         
306     \textcolor{comment}{// --From tile data layout to flat data layout--    }
307     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( N, N, A, LDA, nt, nt, TILE\_A );
308 
309     \textcolor{comment}{// Triandular solve}
310     \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = NoTrans & Unit-- }
311     \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
312     \{
313         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
314 
315         \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ )
316         \{
317             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
318                         
319 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
320 \textcolor{preprocessor}{                inout(  TILE\_B[ki][ni] ) \(\backslash\)}
321 \textcolor{preprocessor}{                shared( TILE\_A, TILE\_B ) \(\backslash\)}
322 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
323 \textcolor{preprocessor}{                label( dtrsm\_dtrsm1 )}
324             cblas\_dtrsm( CblasRowMajor,
325                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower,
326                          ( CBLAS\_TRANSPOSE ) NoTrans,
327                          ( CBLAS\_DIAG ) Unit,
328                          tile\_size\_k,
329                          tile\_size\_n,
330                          1.0, TILE\_A[ki][ki], tile\_size\_k,
331                               TILE\_B[ki][ni], tile\_size\_n );
332         \}
333         \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ ) 
334         \{
335             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
336                 
337             \textcolor{keywordflow}{for} ( mi = ki + 1; mi < nt; mi++ )
338             \{
339                     
340 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
341 \textcolor{preprocessor}{                    in( TILE\_B[ki][nni] ) \(\backslash\)}
342 \textcolor{preprocessor}{                    inout( TILE\_B[mi][nni] ) \(\backslash\)}
343 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
344 \textcolor{preprocessor}{                    firstprivate( ki, mi, nni ) \(\backslash\)}
345 \textcolor{preprocessor}{                    label( dtrsm\_dgemm1 )}
346                 cblas\_dgemm( CblasRowMajor,
347                              CblasNoTrans, CblasNoTrans,
348                              tile\_size\_k,
349                              tile\_size\_nn,
350                              tile\_size\_k,
351                              -1.0,  TILE\_A[mi][ki],  tile\_size\_k,
352                                    TILE\_B[ki][nni], tile\_size\_nn,
353                               1.0, TILE\_B[mi][nni], tile\_size\_nn );
354             \}
355         \}
356     \}
357 
358     \textcolor{comment}{// Triandular solve}
359     \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = NoTrans & NonUnit--}
360     \textcolor{keywordflow}{for} ( ki = nt - 1; ki >= 0; ki-- ) 
361     \{
362         tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
363         
364         \textcolor{keywordflow}{for} ( ni = 0; ni < nrhst; ni++ ) 
365         \{
366             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, ni );
367 
368 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
369 \textcolor{preprocessor}{                inout( TILE\_B[ki][ni] ) \(\backslash\)}
370 \textcolor{preprocessor}{                shared( TILE\_A, TILE\_B ) \(\backslash\)}
371 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
372 \textcolor{preprocessor}{                label( dtrsmi\_dtrsm2 )}
373             cblas\_dtrsm( CblasRowMajor,
374                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Upper,
375                          ( CBLAS\_TRANSPOSE ) NoTrans,
376                          ( CBLAS\_DIAG ) NonUnit,
377                          tile\_size\_k, 
378                          tile\_size\_n,
379                          1.0, TILE\_A[ki][ki], tile\_size\_k,
380                               TILE\_B[ki][ni], tile\_size\_n );
381         \}
382 
383         \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- ) 
384         \{
385             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, mi );
386             
387             \textcolor{keywordflow}{for} ( nni = 0; nni < nrhst; nni++ ) 
388             \{
389                 tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( NRHS, nni );
390 
391 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
392 \textcolor{preprocessor}{                    in( TILE\_B[ki][nni] ) \(\backslash\)}
393 \textcolor{preprocessor}{                    inout( TILE\_B[mi][nni] ) \(\backslash\)}
394 \textcolor{preprocessor}{                    shared( TILE\_A, TILE\_B ) \(\backslash\)}
395 \textcolor{preprocessor}{                    firstprivate( ki, mi, nni ) \(\backslash\)}
396 \textcolor{preprocessor}{                    label( dtrsm\_dgemm2 )}
397                 cblas\_dgemm( CblasRowMajor,
398                              CblasNoTrans, CblasNoTrans,
399                              tile\_size\_m, 
400                              tile\_size\_nn, 
401                              tile\_size\_k,
402                              -1.0, TILE\_A[mi][ki],  tile\_size\_k,
403                                    TILE\_B[ki][nni], tile\_size\_nn,
404                               1.0, TILE\_B[mi][nni], tile\_size\_nn );
405             \}
406         \}
407     \}
408 
409     \textcolor{comment}{/*********************************************}
410 \textcolor{comment}{    --From tiled data layout to flat data layout--  }
411 \textcolor{comment}{    *********************************************/}
412     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( N, NRHS, B, LDB, nt, nrhst, TILE\_B );
413 
414     \textcolor{comment}{// --Free--}
415     free( TILE\_A );
416     free( TILE\_B );
417     free( ipiv\_local );
418     
419     \textcolor{keywordflow}{return} Success;
420 
421 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdtpgetrf@{kdtpgetrf}}
\index{kdtpgetrf@{kdtpgetrf}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdtpgetrf(int M, int N, double $\ast$\+A, int L\+D\+A, int $\ast$ipiv)}{kdtpgetrf(int M, int N, double *A, int LDA, int *ipiv)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdtpgetrf (
\begin{DoxyParamCaption}
\item[{int}]{M, }
\item[{int}]{N, }
\item[{double $\ast$}]{A, }
\item[{int}]{L\+DA, }
\item[{int $\ast$}]{I\+P\+IV}
\end{DoxyParamCaption}
)}\hypertarget{lass_8h_a78d204c4ad618df9e1d81e0668bc2149}{}\label{lass_8h_a78d204c4ad618df9e1d81e0668bc2149}
Performs the LU factorization with tiled pivoting ( row interchanges ) of a general M-\/by-\/N matrix A\+: \begin{DoxyVerb}A = P * L * U
\end{DoxyVerb}


where P is a permutation matrix, L is a lower triangular ( lower trapezoidal if M $>$ N ) matrix with unit diagonal elements and U is an upper triangular ( upper trapezoidal if M $<$ N ) matrix.


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em M} & int. M specifies the number of rows of the matrix A. M $>$= 0.\\
\hline
\mbox{\tt in}  & {\em N} & int. N specifies the number of columns of the matrix A. N $>$= 0.\\
\hline
\mbox{\tt in,out}  & {\em A} & double $\ast$. A is a pointer to a regular matrix of dimension M-\/by-\/N. On exit, if return value is Success, the matrix A is overwriten by the factors L and U. The unit diagonal elements of L are not stored.\\
\hline
\mbox{\tt in}  & {\em L\+DA} & int. L\+DA specifies the number of columns of A ( row-\/major order ). L\+DA must be at least max( 1, N ).\\
\hline
\mbox{\tt out}  & {\em I\+P\+IV} & int $\ast$. ipiv is a pointer to an array of dimesion at least max( 1, min ( M, N ) ). ipiv( i ) = j, 1 $<$= i $<$= min( M, N ) implies that rows i and j have been interchanged.\\
\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 

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


Definition at line 80 of file kdtpgetrf.\+c.



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



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


\begin{DoxyCode}
81 \{
82 
83     \textcolor{comment}{// Local variables}
84     \textcolor{keywordtype}{int} i;
85     \textcolor{keywordtype}{int} mt, nt;
86     \textcolor{keywordtype}{int} mi, mmi, ki, ni;
87     \textcolor{keywordtype}{int} tile\_size\_m;
88     \textcolor{keywordtype}{int} tile\_size\_mm;
89     \textcolor{keywordtype}{int} tile\_size\_n;
90     \textcolor{keywordtype}{int} tile\_size\_km;
91     \textcolor{keywordtype}{int} tile\_size\_kn;
92     \textcolor{keywordtype}{int} local\_ipiv\_size;
93     \textcolor{keywordtype}{int} current\_position;
94     \textcolor{keyword}{enum} LASS\_RETURN ret;
95     \textcolor{keywordtype}{int} *ipiv\_local;
96 
97     \textcolor{comment}{// Number of tiles}
98     \textcolor{keywordflow}{if} ( M % TILE\_SIZE == 0 )
99     \{
100         mt = M / TILE\_SIZE;
101     \}
102     \textcolor{keywordflow}{else}
103     \{
104         mt = ( M / TILE\_SIZE ) + 1;
105     \}
106 
107     \textcolor{keywordflow}{if} ( N % TILE\_SIZE == 0 )
108     \{
109         nt = N / TILE\_SIZE;
110     \}
111     \textcolor{keywordflow}{else}
112     \{
113         nt = ( N / TILE\_SIZE ) + 1;
114     \}
115 
116     \textcolor{comment}{/***************************}
117 \textcolor{comment}{    --Tile A matrix allocation--}
118 \textcolor{comment}{    ***************************/}
119         
120     double ( *TILE\_A )[nt][TILE\_SIZE * TILE\_SIZE] = malloc ( mt * nt * 
121         TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
122     
123     \textcolor{keywordflow}{if} ( TILE\_A == NULL )
124     \{
125         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdnpgetrf for matrix TILE\_A\(\backslash\)n"} );
126         \textcolor{keywordflow}{return} NoSuccess;
127     \}
128 
129     ipiv\_local = ( \textcolor{keywordtype}{int}* ) malloc( MIN( M, N ) * \textcolor{keyword}{sizeof}( int ) );
130     
131     \textcolor{keywordflow}{if} ( ipiv\_local == NULL )
132     \{
133         fprintf( stderr, \textcolor{stringliteral}{"Failure in kdnpgetrf for ipiv\_local\(\backslash\)n"} );
134         \textcolor{keywordflow}{return} NoSuccess;
135     \}
136 
137     \textcolor{comment}{/************************************************}
138 \textcolor{comment}{    // --From flat data layout to tiled data layout--   }
139 \textcolor{comment}{    ************************************************/}
140     
141     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, N, A, LDA, mt, nt, TILE\_A );
142 
143     \textcolor{comment}{/****************}
144 \textcolor{comment}{    --DGETRF tile--}
145 \textcolor{comment}{    ****************/}   
146     
147     current\_position = 0;
148     i = 0;
149     \textcolor{keywordflow}{for} ( ki = 0; ki < MIN( mt, nt ); ki++ )
150     \{
151         tile\_size\_km = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
152         tile\_size\_kn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
153         
154 \textcolor{preprocessor}{        #pragma oss task inout( TILE\_A[ki][ki] ) \(\backslash\)}
155 \textcolor{preprocessor}{            inout( ipiv\_local ) \(\backslash\)}
156 \textcolor{preprocessor}{            inout( current\_position ) \(\backslash\)}
157 \textcolor{preprocessor}{            out( local\_ipiv\_size ) \(\backslash\)}
158 \textcolor{preprocessor}{            shared( TILE\_A ) \(\backslash\)}
159 \textcolor{preprocessor}{            firstprivate( ki, i ) \(\backslash\)}
160 \textcolor{preprocessor}{            label( dgetrf )}
161         \{
162             LAPACKE\_dgetrf( CblasRowMajor,
163                             tile\_size\_km, tile\_size\_kn, 
164                             TILE\_A[ki][ki], tile\_size\_kn,
165                             ipiv\_local + current\_position );
166             
167             \textcolor{comment}{// Update the global ipiv array}
168             local\_ipiv\_size = MIN( tile\_size\_km, tile\_size\_kn );
169             \textcolor{keywordflow}{for} ( i = 0; i < local\_ipiv\_size; i++ )
170             \{
171                 ( IPIV + current\_position )[i] =
172                         ( ipiv\_local + current\_position )[i] + current\_position;
173             \}
174             current\_position += local\_ipiv\_size;
175         \}
176         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ )
177         \{
178             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
179 
180 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
181 \textcolor{preprocessor}{                inout( TILE\_A[mi][ki] ) \(\backslash\)}
182 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
183 \textcolor{preprocessor}{                firstprivate( mi, ki ) \(\backslash\)}
184 \textcolor{preprocessor}{                label( dtrsm\_below )}
185             cblas\_dtrsm( CblasRowMajor, 
186                          ( CBLAS\_SIDE ) Right, ( CBLAS\_UPLO ) Upper, 
187                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) NonUnit, 
188                          tile\_size\_m, tile\_size\_kn, 
189                          1.0, TILE\_A[ki][ki], tile\_size\_kn, 
190                               TILE\_A[mi][ki], tile\_size\_kn );
191         \}
192         \textcolor{keywordflow}{for} ( ni = 0; ni < ki; ni++ )
193         \{       
194             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
195             \textcolor{comment}{// Swap the tiles to the left of A[ki][ki]}
196 \textcolor{preprocessor}{            #pragma oss task in( ipiv\_local ) \(\backslash\)}
197 \textcolor{preprocessor}{                in( current\_position ) \(\backslash\)}
198 \textcolor{preprocessor}{                in( local\_ipiv\_size ) \(\backslash\)}
199 \textcolor{preprocessor}{                inout( TILE\_A[ki][ni] ) \(\backslash\)}
200 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
201 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
202 \textcolor{preprocessor}{                label( dlaswp\_left )}
203             LAPACKE\_dlaswp( CblasRowMajor,
204                             tile\_size\_n, TILE\_A[ki][ni], tile\_size\_n,
205                             1, local\_ipiv\_size,
206                             ipiv\_local + current\_position - local\_ipiv\_size, 
207                             1 );
208             
209         \}
210         \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ )
211         \{
212             tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
213             \textcolor{comment}{// Swap the tiles to the right of A[ki][ki]}
214 \textcolor{preprocessor}{            #pragma oss task in( ipiv\_local ) \(\backslash\)}
215 \textcolor{preprocessor}{                in( current\_position ) \(\backslash\)}
216 \textcolor{preprocessor}{                in( local\_ipiv\_size ) \(\backslash\)}
217 \textcolor{preprocessor}{                inout( TILE\_A[ki][ni] ) \(\backslash\)}
218 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
219 \textcolor{preprocessor}{                firstprivate( ki, ni ) \(\backslash\)}
220 \textcolor{preprocessor}{                label( dlaswp\_right )}
221             LAPACKE\_dlaswp( CblasRowMajor,
222                             tile\_size\_n, TILE\_A[ki][ni], tile\_size\_n,
223                             1, local\_ipiv\_size,
224                             ipiv\_local + current\_position - local\_ipiv\_size, 
225                             1 );
226 
227 \textcolor{preprocessor}{            #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
228 \textcolor{preprocessor}{                inout( TILE\_A[ki][ni] ) \(\backslash\)}
229 \textcolor{preprocessor}{                shared( TILE\_A ) \(\backslash\)}
230 \textcolor{preprocessor}{                firstprivate( ni, ki ) \(\backslash\)}
231 \textcolor{preprocessor}{                label( dtrsm\_right )}
232             cblas\_dtrsm( CblasRowMajor, 
233                          ( CBLAS\_SIDE ) Left, ( CBLAS\_UPLO ) Lower, 
234                          ( CBLAS\_TRANSPOSE ) NoTrans, ( CBLAS\_DIAG ) Unit, 
235                          tile\_size\_km, tile\_size\_n, 
236                          1.0, TILE\_A[ki][ki], tile\_size\_kn, 
237                               TILE\_A[ki][ni], tile\_size\_n );
238                 
239             \textcolor{keywordflow}{for} ( mmi = ki + 1; mmi < mt; mmi++ )
240             \{
241                 tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
242         
243 \textcolor{preprocessor}{                #pragma oss task in( TILE\_A[mmi][ki] ) \(\backslash\)}
244 \textcolor{preprocessor}{                    in( TILE\_A[ki][ni] ) \(\backslash\)}
245 \textcolor{preprocessor}{                    inout( TILE\_A[mmi][ni] ) \(\backslash\)}
246 \textcolor{preprocessor}{                    shared( TILE\_A ) \(\backslash\)}
247 \textcolor{preprocessor}{                    firstprivate( ni, mmi, ki ) \(\backslash\)}
248 \textcolor{preprocessor}{                    label( dgemm )}
249                 cblas\_dgemm( CblasRowMajor, 
250                              ( CBLAS\_TRANSPOSE ) NoTrans,
251                              ( CBLAS\_TRANSPOSE ) NoTrans,
252                              tile\_size\_mm, 
253                              tile\_size\_n, 
254                              TILE\_SIZE,
255                              -1.0, TILE\_A[mmi][ki], tile\_size\_kn,
256                                    TILE\_A[ki][ni],  tile\_size\_n,
257                               1.0, TILE\_A[mmi][ni], tile\_size\_n );          
258             \}
259         \}
260     \}
261         
262     \textcolor{comment}{// --From tile data layout to flat data layout--    }
263     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( M, N, A, LDA, mt, nt, TILE\_A );
264 
265     \textcolor{comment}{// --Free--}
266     free( TILE\_A );
267     free( ipiv\_local );
268     
269     \textcolor{keywordflow}{return} Success;
270 
271 \}
\end{DoxyCode}
\index{lass.\+h@{lass.\+h}!kdtrmm@{kdtrmm}}
\index{kdtrmm@{kdtrmm}!lass.\+h@{lass.\+h}}
\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{lass_8h_afff986820ff4c554e2b217e99b49c143}{}\label{lass_8h_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}
\index{lass.\+h@{lass.\+h}!kdtrsm@{kdtrsm}}
\index{kdtrsm@{kdtrsm}!lass.\+h@{lass.\+h}}
\subsubsection[{\texorpdfstring{kdtrsm(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)}{kdtrsm(enum DDSS_SIDE SIDE, enum DDSS_UPLO UPLO, enum DDSS_TRANS TRANS_A, enum DDSS_DIAG DIAG, int M, int N, const double ALPHA, double *A, int LDA, double *B, int LDB)}}]{\setlength{\rightskip}{0pt plus 5cm}enum L\+A\+S\+S\+\_\+\+R\+E\+T\+U\+RN kdtrsm (
\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{lass_8h_addfda795c19230c16da674648de83a5c}{}\label{lass_8h_addfda795c19230c16da674648de83a5c}
Solves one of the matrix equations\+: \begin{DoxyVerb}op( A ) * X = ALPHA * B, or X * op( A ) = ALPHA * B
\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, X and B are M by N matrices, A is a unit, or non-\/unit, upper or lower triangular matrix. The matrix X is overwritten on B


\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\+: op( A ) $\ast$ X = A\+L\+P\+HA $\ast$ B.
\item Right\+: X $\ast$ op( A ) = A\+L\+P\+HA $\ast$ B.
\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 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 solution matrix X.\\
\hline
\mbox{\tt in}  & {\em L\+DB} & int. L\+DB specifies the number of columns of B ( row-\/major order ). L\+DB must be at least max( 1, N ).\\
\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 kdtrsm.\+c.



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



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


\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\_mm;
138     \textcolor{keywordtype}{int} tile\_size\_n;
139     \textcolor{keywordtype}{int} tile\_size\_nn;
140     \textcolor{keywordtype}{int} tile\_size\_k;
141     \textcolor{keywordtype}{double} alpha;
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{comment}{/****************************}
163 \textcolor{comment}{     --Tile matrices declaration--}
164 \textcolor{comment}{     ****************************/}
165 
166     \textcolor{keywordflow}{if} ( SIDE == Left ) 
167     \{
168         Am = An = mt;
169         k = M;
170     \} 
171     \textcolor{keywordflow}{else} 
172     \{
173         Am = An = nt;
174         k = N;
175     \}
176 
177     Bm = mt;
178     Bn = nt;
179 
180     \textcolor{comment}{/***************************}
181 \textcolor{comment}{     --Tile matrices allocation--}
182 \textcolor{comment}{     ***************************/}
183 
184     double ( *TILE\_A )[An][TILE\_SIZE * TILE\_SIZE] = malloc(
185              Am * An * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
186 
187     \textcolor{keywordflow}{if} ( TILE\_A == NULL ) 
188     \{
189         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_A\(\backslash\)n"} );
190         \textcolor{keywordflow}{return} NoSuccess;
191     \}
192 
193     double ( *TILE\_B )[Bn][TILE\_SIZE * TILE\_SIZE] = malloc(
194              Bm * Bn * TILE\_SIZE * TILE\_SIZE * \textcolor{keyword}{sizeof}( \textcolor{keywordtype}{double} ) );
195 
196     \textcolor{keywordflow}{if} ( TILE\_B == NULL ) 
197     \{
198         fprintf( stderr, \textcolor{stringliteral}{"Failure in ddss\_dtile\_alloc for matrix TILE\_B\(\backslash\)n"} );
199         \textcolor{keywordflow}{return} NoSuccess;
200     \}
201 
202     \textcolor{comment}{/*********************************************}
203 \textcolor{comment}{     --From flat data layout to tiled data layout-- }
204 \textcolor{comment}{     *********************************************/}
205 
206     \textcolor{comment}{// From flat matrix A to tile matrix TILE\_A}
207     \hyperlink{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{ddss\_dsymflat2tiled}( k, k, A, LDA, Am, An, TILE\_A, UPLO );
208 
209     \textcolor{comment}{// From flat matrix B to tile matrix TILE\_B }
210     \hyperlink{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{ddss\_dflat2tiled}( M, N, B, LDB, Bm, Bn, TILE\_B );
211 
212     \textcolor{comment}{/*************}
213 \textcolor{comment}{     --DTRSM tile--}
214 \textcolor{comment}{     *************/}
215 
216     \textcolor{keywordflow}{if} ( SIDE == Left ) 
217     \{
218         \textcolor{keywordflow}{if} ( UPLO == Upper ) 
219         \{
220             \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = NoTrans-- }
221             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans ) 
222             \{
223                 \textcolor{keywordflow}{for} ( ki = mt - 1; ki >= 0; ki-- ) 
224                 \{
225                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
226                     \textcolor{keywordflow}{if} ( ki == mt - 1 ) 
227                     \{
228                         alpha = ALPHA;
229                     \}
230                     \textcolor{keywordflow}{else} 
231                     \{
232                         alpha = 1.0;    
233                     \}
234 
235                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
236                     \{
237                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
238 
239 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
240 \textcolor{preprocessor}{                            inout( TILE\_B[ki][ni] ) \(\backslash\)}
241 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
242 \textcolor{preprocessor}{                            firstprivate( ki, ni ) \(\backslash\)}
243 \textcolor{preprocessor}{                            label( dtrsm )}
244                         cblas\_dtrsm( CblasRowMajor,
245                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
246                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
247                                      ( CBLAS\_DIAG ) DIAG,
248                                      tile\_size\_k, 
249                                      tile\_size\_n,
250                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
251                                             TILE\_B[ki][ni], tile\_size\_n );
252                     \}
253 
254                     \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- ) 
255                     \{
256                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
257                         \textcolor{keywordflow}{for} ( nni = 0; nni < nt; nni++ ) 
258                         \{
259                             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
260 
261 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
262 \textcolor{preprocessor}{                                in( TILE\_B[ki][nni] ) \(\backslash\)}
263 \textcolor{preprocessor}{                                inout( TILE\_B[mi][nni] ) \(\backslash\)}
264 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
265 \textcolor{preprocessor}{                                firstprivate( ki, mi, nni ) \(\backslash\)}
266 \textcolor{preprocessor}{                                label( dgemm )}
267                             cblas\_dgemm( CblasRowMajor,
268                                          CblasNoTrans, CblasNoTrans,
269                                          tile\_size\_m, 
270                                          tile\_size\_nn, 
271                                          tile\_size\_k,
272                                          -1.0,  TILE\_A[mi][ki],  tile\_size\_k,
273                                                 TILE\_B[ki][nni], tile\_size\_nn,
274                                          alpha, TILE\_B[mi][nni], tile\_size\_nn );
275                         \}
276                     \}
277                 \}
278             \}
279 
280             \textcolor{comment}{// --SIDE = Left & UPLO = Upper & TRANS\_A = Trans-- }
281             \textcolor{keywordflow}{else} 
282             \{
283                 \textcolor{keywordflow}{for} ( ki = 0; ki < mt; ki++ ) 
284                 \{
285                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
286                     \textcolor{keywordflow}{if} ( ki == 0 ) 
287                     \{
288                         alpha = ALPHA;
289                     \} 
290                     \textcolor{keywordflow}{else} 
291                     \{
292                         alpha = 1.0;
293                     \}
294 
295                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ ) 
296                     \{
297                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
298 
299 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
300 \textcolor{preprocessor}{                            inout( TILE\_B[ki][ni] ) \(\backslash\)}
301 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
302 \textcolor{preprocessor}{                            firstprivate( ki, ni ) \(\backslash\)}
303 \textcolor{preprocessor}{                            label( dtrsm )}
304                         cblas\_dtrsm( CblasRowMajor,
305                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
306                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
307                                      ( CBLAS\_DIAG ) DIAG,
308                                      tile\_size\_k, 
309                                      tile\_size\_n,
310                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
311                                             TILE\_B[ki][ni], tile\_size\_n );
312                     \}
313 
314                     \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ )
315                     \{   
316                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
317                         \textcolor{keywordflow}{for} ( nni = 0; nni < nt; nni++ ) 
318                         \{
319                             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
320                 
321 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][mi]) \(\backslash\)}
322 \textcolor{preprocessor}{                                in( TILE\_B[ki][nni] ) \(\backslash\)}
323 \textcolor{preprocessor}{                                inout(  TILE\_B[mi][nni] ) \(\backslash\)}
324 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
325 \textcolor{preprocessor}{                                firstprivate( ki, mi, nni ) \(\backslash\)}
326 \textcolor{preprocessor}{                                label( dgemm )}
327                             cblas\_dgemm( CblasRowMajor,
328                                          CblasTrans, CblasNoTrans,
329                                          tile\_size\_m, 
330                                          tile\_size\_nn, 
331                                          tile\_size\_k,
332                                          -1.0,  TILE\_A[ki][mi],  tile\_size\_m,
333                                                 TILE\_B[ki][nni], tile\_size\_nn,
334                                          alpha, TILE\_B[mi][nni], tile\_size\_nn );
335                         \}
336                     \}
337                 \}
338             \}
339         \}
340 
341         \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = NoTrans--  }
342         \textcolor{keywordflow}{else} 
343         \{
344             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans ) 
345             \{
346                 \textcolor{keywordflow}{for} ( ki = 0; ki < mt; ki++ )
347                 \{
348                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
349                     \textcolor{keywordflow}{if} ( ki == 0 )
350                     \{
351                         alpha = ALPHA;      
352                     \} 
353                     \textcolor{keywordflow}{else} 
354                     \{
355                         alpha = 1.0;    
356                     \}
357 
358                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ )
359                     \{
360                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
361 
362 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
363 \textcolor{preprocessor}{                            inout(  TILE\_B[ki][ni] ) \(\backslash\)}
364 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
365 \textcolor{preprocessor}{                            firstprivate( ki, ni ) \(\backslash\)}
366 \textcolor{preprocessor}{                            label( dtrsm )}
367                         cblas\_dtrsm( CblasRowMajor,
368                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
369                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
370                                      ( CBLAS\_DIAG ) DIAG,
371                                      tile\_size\_k,
372                                      tile\_size\_n,
373                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
374                                             TILE\_B[ki][ni], tile\_size\_n );
375 
376                     \}
377                     \textcolor{keywordflow}{for} ( nni = 0; nni < nt; nni++ ) 
378                     \{
379                         tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
380             
381                         \textcolor{keywordflow}{for} ( mi = ki + 1; mi < mt; mi++ )
382                         \{
383                         
384                             tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
385                         
386 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[mi][ki] ) \(\backslash\)}
387 \textcolor{preprocessor}{                                in( TILE\_B[ki][nni] ) \(\backslash\)}
388 \textcolor{preprocessor}{                                inout( TILE\_B[mi][nni] ) \(\backslash\)}
389 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
390 \textcolor{preprocessor}{                                firstprivate( ki, mi, nni ) \(\backslash\)}
391 \textcolor{preprocessor}{                                label( dgemm )}
392                             cblas\_dgemm( CblasRowMajor,
393                                          CblasNoTrans, CblasNoTrans,
394                                          tile\_size\_m,
395                                          tile\_size\_nn,
396                                          tile\_size\_k,
397                                          -1.0,   TILE\_A[mi][ki],  tile\_size\_k,
398                                                 TILE\_B[ki][nni], tile\_size\_nn,
399                                          alpha, TILE\_B[mi][nni], tile\_size\_nn );
400                         \}
401                     \}
402                 \}
403             \}
404 
405             \textcolor{comment}{// --SIDE = Left & UPLO = Lower & TRANS\_A = Trans--    }
406             \textcolor{keywordflow}{else} 
407             \{
408                 \textcolor{keywordflow}{for} ( ki = mt - 1; ki >= 0; ki-- )
409                 \{   
410                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, ki );
411                     \textcolor{keywordflow}{if} ( ki == mt - 1 )
412                     \{
413                         alpha = ALPHA;  
414                     \} 
415                     \textcolor{keywordflow}{else}
416                     \{
417                         alpha = 1.0;
418                     \}
419 
420                     \textcolor{keywordflow}{for} ( ni = 0; ni < nt; ni++ )
421                     \{   
422                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
423 
424 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
425 \textcolor{preprocessor}{                            inout( TILE\_B[ki][ni] ) \(\backslash\)}
426 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
427 \textcolor{preprocessor}{                            firstprivate( ki, ni ) \(\backslash\)}
428 \textcolor{preprocessor}{                            label( dtrsm )}
429                         cblas\_dtrsm( CblasRowMajor,
430                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
431                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
432                                      ( CBLAS\_DIAG ) DIAG,
433                                      tile\_size\_k,
434                                      tile\_size\_n,
435                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
436                                             TILE\_B[ki][ni], tile\_size\_n );
437                     \}
438 
439                     \textcolor{keywordflow}{for} ( mi = ki - 1; mi >= 0; mi-- ) 
440                     \{
441                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
442                         \textcolor{keywordflow}{for} ( nni = 0; nni < nt; nni++ ) 
443                         \{
444                             tile\_size\_nn = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, nni );
445                             
446 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][mi] ) \(\backslash\)}
447 \textcolor{preprocessor}{                                in( TILE\_B[ki][nni] ) \(\backslash\)}
448 \textcolor{preprocessor}{                                inout(  TILE\_B[mi][nni] ) \(\backslash\)}
449 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
450 \textcolor{preprocessor}{                                firstprivate( ki, mi, nni ) \(\backslash\)}
451 \textcolor{preprocessor}{                                label( dgemm )}
452                             cblas\_dgemm( CblasRowMajor,
453                                          CblasTrans, CblasNoTrans,
454                                          tile\_size\_m,
455                                          tile\_size\_nn,
456                                          tile\_size\_k,
457                                          -1.0,  TILE\_A[ki][mi],  tile\_size\_m,
458                                                 TILE\_B[ki][nni], tile\_size\_nn,
459                                          alpha, TILE\_B[mi][nni], tile\_size\_nn );
460                         \}
461                     \}
462                 \}
463             \}
464         \}
465     \}
466 
467     \textcolor{comment}{// --SIDE = Right & UPLO = Upper & TRANS\_A = NoTrans--   }
468     \textcolor{keywordflow}{else}
469     \{
470         \textcolor{keywordflow}{if} ( UPLO == Upper )
471         \{
472             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
473             \{   
474                 \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ )
475                 \{
476                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
477                     \textcolor{keywordflow}{if} ( ki == 0 )
478                     \{
479                         alpha = ALPHA;                      
480                     \} 
481                     \textcolor{keywordflow}{else}
482                     \{
483                         alpha = 1.0;                    
484                     \}
485 
486                     \textcolor{keywordflow}{for} ( mi = 0; mi < mt; mi++ ) 
487                     \{       
488                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
489 
490 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
491 \textcolor{preprocessor}{                            inout(  TILE\_B[mi][ki] ) \(\backslash\)}
492 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
493 \textcolor{preprocessor}{                            firstprivate( ki, mi ) \(\backslash\)}
494 \textcolor{preprocessor}{                            label( dtrsm )}
495                         cblas\_dtrsm( CblasRowMajor,
496                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
497                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
498                                      ( CBLAS\_DIAG ) DIAG,
499                                      tile\_size\_m,
500                                      tile\_size\_k,
501                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
502                                             TILE\_B[mi][ki], tile\_size\_k );
503                     \}
504 
505                     \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ ) 
506                     \{   
507                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
508                         \textcolor{keywordflow}{for} ( mmi = 0; mmi < mt; mmi++ ) 
509                         \{
510                             tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
511                             
512 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][ni] ) \(\backslash\)}
513 \textcolor{preprocessor}{                                in( TILE\_B[mmi][ki] ) \(\backslash\)}
514 \textcolor{preprocessor}{                                inout(  TILE\_B[mmi][ni] ) \(\backslash\)}
515 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
516 \textcolor{preprocessor}{                                firstprivate( ki, ni, mmi ) \(\backslash\)}
517 \textcolor{preprocessor}{                                label( dgemm )}
518                             cblas\_dgemm( CblasRowMajor,
519                                          CblasNoTrans, CblasNoTrans,
520                                          tile\_size\_mm,
521                                          tile\_size\_n,
522                                          tile\_size\_k,
523                                          -1.0,  TILE\_B[mmi][ki], tile\_size\_k,
524                                                 TILE\_A[ki][ni],  tile\_size\_n,
525                                          alpha, TILE\_B[mmi][ni], tile\_size\_n );
526                         \}
527                     \}
528                 \}
529             \}
530             \textcolor{comment}{// --SIDE = Right & UPLO = Upper & TRANS\_A = Trans-- }
531             \textcolor{keywordflow}{else}
532             \{
533                 \textcolor{keywordflow}{for} ( ki = nt - 1; ki >= 0; ki-- ) 
534                 \{   
535                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
536                     \textcolor{keywordflow}{if} ( ki == nt - 1 )
537                     \{
538                         alpha = ALPHA;  
539                     \} 
540                     \textcolor{keywordflow}{else}
541                     \{
542                         alpha = 1.0;
543                     \}
544 
545                     \textcolor{keywordflow}{for} ( mi = 0; mi < mt; mi++ )
546                     \{   
547                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
548 
549 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
550 \textcolor{preprocessor}{                            inout( TILE\_B[mi][ki] ) \(\backslash\)}
551 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
552 \textcolor{preprocessor}{                            firstprivate( ki, mi ) \(\backslash\)}
553 \textcolor{preprocessor}{                            label( dtrsm )}
554                         cblas\_dtrsm( CblasRowMajor,
555                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
556                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
557                                      ( CBLAS\_DIAG ) DIAG,
558                                      tile\_size\_m,
559                                      tile\_size\_k,
560                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
561                                             TILE\_B[mi][ki], tile\_size\_k );
562                     \}
563 
564                     \textcolor{keywordflow}{for} ( ni = ki - 1; ni >= 0; ni-- ) 
565                     \{
566                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
567                         \textcolor{keywordflow}{for} ( mmi = 0; mmi < mt; mmi++ ) 
568                         \{
569                             tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
570 
571 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ni][ki] ) \(\backslash\)}
572 \textcolor{preprocessor}{                                in( TILE\_B[mmi][ki] ) \(\backslash\)}
573 \textcolor{preprocessor}{                                inout( TILE\_B[mmi][ni] ) \(\backslash\)}
574 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
575 \textcolor{preprocessor}{                                firstprivate( ki, ni, mmi ) \(\backslash\)}
576 \textcolor{preprocessor}{                                label( dgemm )}
577                             cblas\_dgemm( CblasRowMajor,
578                                          CblasNoTrans, CblasTrans,
579                                          tile\_size\_mm,
580                                          tile\_size\_n,
581                                          tile\_size\_k,
582                                          -1.0,  TILE\_B[mmi][ki], tile\_size\_k,
583                                                 TILE\_A[ni][ki],  tile\_size\_k,
584                                          alpha, TILE\_B[mmi][ni], tile\_size\_n );
585                         \}
586                     \}
587                 \}
588             \}
589         \}
590 
591         \textcolor{comment}{// --SIDE = Right & UPLO = Lower & TRANS\_A = NoTrans--  }
592         \textcolor{keywordflow}{else}
593         \{
594             \textcolor{keywordflow}{if} ( TRANS\_A == NoTrans )
595             \{
596                 \textcolor{keywordflow}{for} ( ki = nt - 1; ki >= 0; ki-- )
597                 \{
598                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
599                     \textcolor{keywordflow}{if} ( ki == nt - 1 )
600                     \{
601                         alpha = ALPHA;                  
602                     \}
603                     \textcolor{keywordflow}{else}
604                     \{
605                         alpha = 1.0;                    
606                     \}
607 
608                     \textcolor{keywordflow}{for} ( mi = 0; mi < mt; mi++ ) 
609                     \{
610                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
611 
612 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
613 \textcolor{preprocessor}{                            inout( TILE\_B[mi][ki] ) \(\backslash\)}
614 \textcolor{preprocessor}{                            shared( TILE\_A, TILE\_B ) \(\backslash\)}
615 \textcolor{preprocessor}{                            firstprivate( ki, mi ) \(\backslash\)}
616 \textcolor{preprocessor}{                            label( dtrsm ) }
617                         cblas\_dtrsm( CblasRowMajor,
618                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
619                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
620                                      ( CBLAS\_DIAG ) DIAG,
621                                      tile\_size\_m,
622                                      tile\_size\_k,
623                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
624                                             TILE\_B[mi][ki], tile\_size\_k );
625                     \}
626 
627                     \textcolor{keywordflow}{for} ( ni = ki - 1; ni >= 0; ni-- ) 
628                     \{                   
629                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );            
630                         \textcolor{keywordflow}{for} ( mmi = 0; mmi < mt; mmi++ ) 
631                         \{   
632                             tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
633 
634 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ki][ni] ) \(\backslash\)}
635 \textcolor{preprocessor}{                                in( TILE\_B[mmi][ki] ) \(\backslash\)}
636 \textcolor{preprocessor}{                                inout( TILE\_B[mmi][ni] ) \(\backslash\)}
637 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
638 \textcolor{preprocessor}{                                firstprivate( ki, ni, mmi ) \(\backslash\)}
639 \textcolor{preprocessor}{                                label( dgemm ) }
640                             cblas\_dgemm( CblasRowMajor,
641                                          CblasNoTrans, CblasNoTrans,
642                                          tile\_size\_mm,
643                                          tile\_size\_n,
644                                          tile\_size\_k,
645                                          -1.0,  TILE\_B[mmi][ki], tile\_size\_k,
646                                                 TILE\_A[ki][ni],  tile\_size\_n,
647                                          alpha, TILE\_B[mmi][ni], tile\_size\_n );
648                         \}
649                     \}
650                 \}
651             \}
652         
653             \textcolor{comment}{// --SIDE = Right & UPLO = Lower & TRANS\_A = Trans--  }
654             \textcolor{keywordflow}{else} 
655             \{
656                 \textcolor{keywordflow}{for} ( ki = 0; ki < nt; ki++ ) 
657                 \{
658                     tile\_size\_k = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ki );
659                     \textcolor{keywordflow}{if} ( ki == 0 ) 
660                     \{
661                         alpha = ALPHA;      
662                     \} 
663                     \textcolor{keywordflow}{else} 
664                     \{
665                         alpha = 1.0;        
666                     \}
667 
668                     \textcolor{keywordflow}{for} ( mi = 0; mi < mt; mi++ )  
669                     \{       
670                         tile\_size\_m = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mi );
671 
672 \textcolor{preprocessor}{                        #pragma oss task in( TILE\_A[ki][ki] ) \(\backslash\)}
673 \textcolor{preprocessor}{                            inout( TILE\_B[mi][ki] ) \(\backslash\)}
674 \textcolor{preprocessor}{                            shared( TILE\_A,TILE\_B ) \(\backslash\)}
675 \textcolor{preprocessor}{                            firstprivate( ki, mi ) \(\backslash\)}
676 \textcolor{preprocessor}{                            label( dtrsm )}
677                         cblas\_dtrsm( CblasRowMajor, 
678                                      ( CBLAS\_SIDE ) SIDE, ( CBLAS\_UPLO ) UPLO,
679                                      ( CBLAS\_TRANSPOSE ) TRANS\_A,
680                                      ( CBLAS\_DIAG ) DIAG,
681                                      tile\_size\_m,
682                                      tile\_size\_k,
683                                      alpha, TILE\_A[ki][ki], tile\_size\_k,
684                                             TILE\_B[mi][ki], tile\_size\_k );
685                     \}
686 
687                     \textcolor{keywordflow}{for} ( ni = ki + 1; ni < nt; ni++ ) 
688                     \{
689                         tile\_size\_n = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( N, ni );
690                         \textcolor{keywordflow}{for} ( mmi = 0; mmi < mt; mmi++ ) 
691                         \{
692                             tile\_size\_mm = \hyperlink{ddss__tile_8c_a931442adba78807015ff9a076fb2ae49}{ddss\_tile\_size}( M, mmi );
693 
694 \textcolor{preprocessor}{                            #pragma oss task in( TILE\_A[ni][ki] ) \(\backslash\)}
695 \textcolor{preprocessor}{                                in( TILE\_B[mmi][ki] ) \(\backslash\)}
696 \textcolor{preprocessor}{                                inout(  TILE\_B[mmi][ni] ) \(\backslash\)}
697 \textcolor{preprocessor}{                                shared( TILE\_A, TILE\_B ) \(\backslash\)}
698 \textcolor{preprocessor}{                                firstprivate( ki, ni, mmi ) \(\backslash\)}
699 \textcolor{preprocessor}{                                label( dgemm )}
700                             cblas\_dgemm( CblasRowMajor,
701                                          CblasNoTrans, CblasTrans,
702                                          tile\_size\_mm,
703                                          tile\_size\_n,
704                                          tile\_size\_k,
705                                          -1.0,  TILE\_B[mmi][ki], tile\_size\_k,
706                                                 TILE\_A[ni][ki],  tile\_size\_k,
707                                          alpha, TILE\_B[mmi][ni], tile\_size\_n );
708                         \}
709                     \}
710                 \}
711             \}
712         \}
713     \}
714 
715     \textcolor{comment}{/*********************************************}
716 \textcolor{comment}{     --From tiled data layout to flat data layout-- }
717 \textcolor{comment}{     *********************************************/}
718 
719     \hyperlink{ddss__tiled2flat_8c_aeeb6b69c6b4db8333c660ef6824cdf6a}{ddss\_dtiled2flat}( M, N, B, LDB, Bm, Bn, TILE\_B );
720 
721     \textcolor{comment}{// --Tile matrices free--}
722     free( TILE\_A );
723     free( TILE\_B );
724 
725     \textcolor{keywordflow}{return} Success;
726 
727 \}
\end{DoxyCode}
