\hypertarget{ddss__flat2tiled_8c}{}\section{src/ddss\+\_\+flat2tiled.c File Reference}
\label{ddss__flat2tiled_8c}\index{src/ddss\+\_\+flat2tiled.\+c@{src/ddss\+\_\+flat2tiled.\+c}}


L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+flat2tiled routines.  


{\ttfamily \#include \char`\"{}../include/lass.\+h\char`\"{}}\\*
Include dependency graph for ddss\+\_\+flat2tiled.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{ddss__flat2tiled_8c__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{ddss__flat2tiled_8c_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{ddss__flat2tiled_8c_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{ddss__flat2tiled_8c_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)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
L\+A\+Ss-\/\+D\+D\+Ss ddss\+\_\+flat2tiled routines. 

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

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


\subsection{Function Documentation}
\index{ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}!ddss\+\_\+dflat2tiled@{ddss\+\_\+dflat2tiled}}
\index{ddss\+\_\+dflat2tiled@{ddss\+\_\+dflat2tiled}!ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}}
\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{ddss__flat2tiled_8c_ab411e9b05a203c7905f0285ef4200a9e}{}\label{ddss__flat2tiled_8c_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{ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}!ddss\+\_\+dgather\+\_\+tile@{ddss\+\_\+dgather\+\_\+tile}}
\index{ddss\+\_\+dgather\+\_\+tile@{ddss\+\_\+dgather\+\_\+tile}!ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}}
\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{ddss__flat2tiled_8c_a441af0ede62f194937af25f0c8f18736}{}\label{ddss__flat2tiled_8c_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{ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}!ddss\+\_\+dsymflat2tiled@{ddss\+\_\+dsymflat2tiled}}
\index{ddss\+\_\+dsymflat2tiled@{ddss\+\_\+dsymflat2tiled}!ddss\+\_\+flat2tiled.\+c@{ddss\+\_\+flat2tiled.\+c}}
\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{ddss__flat2tiled_8c_afc5c48ad2172946afab6c9e989c4e81a}{}\label{ddss__flat2tiled_8c_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}
