LASs - Linear Algebra Routines on OmpSs  1.0.0
LASs
Functions
ddss_flat2tiled.c File Reference

LASs-DDSs ddss_flat2tiled routines. More...

#include "../include/lass.h"
Include dependency graph for ddss_flat2tiled.c:

Go to the source code of this file.

Functions

void ddss_dflat2tiled (int M, int N, double *A, int LDA, int MT, int NT, double(*TILE_A)[NT][TILE_SIZE *TILE_SIZE])
 
void 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)
 
void ddss_dgather_tile (int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
 

Detailed Description

LASs-DDSs ddss_flat2tiled routines.

LASs-DDSs is a software package provided by: Barcelona Supercomputing Center - Centro Nacional de Supercomputacion

Author
Pedro Valero-Lara pedro.nosp@m..val.nosp@m.ero@b.nosp@m.sc.e.nosp@m.s
Date
2017-05-11

Definition in file ddss_flat2tiled.c.

Function Documentation

void ddss_dflat2tiled ( int  M,
int  N,
double *  A,
int  LDA,
int  MT,
int  NT,
double(*)  TILE_A[NT][TILE_SIZE *TILE_SIZE] 
)

ddss_dflat2tiled: Performs the change of the data layout from flat layout to tiled layout according to row-major order.

Parameters
[in]Mint. M specifies the number of rows of the flat matrix.
[in]Nint. N specifies the number of columns of the flat matrix.
[in]Adouble *. A is a pointer to the flat matrix.
[in]LDAint. LDA specifies the number of columns ( row-major order ) of matrix A.
[in]MTint. MT specifies the number of rows of the matrix TILE_A.
[in]NTint. NT specifies the number of columns of the matrix TILE_A.
[in,out]TILE_Adouble *. TILE_A is a pointer to the tile matrix.
See also
ddss_dgather_tile
ddss_tile_size

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().

70 {
71 
72  // Local variables
73  int m, n;
74 
75  for ( m = 0; m < MT; m++ )
76  {
77  for ( n = 0; n < NT; n++ )
78  {
79  #pragma oss task inout(TILE_A[m][n]) \
80  label( dflat2tiled )
81  {
82  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 }
void ddss_dgather_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
void ddss_dgather_tile ( int  M,
int  N,
double *  A,
int  LDA,
double *  TILE_A,
int  MID,
int  NID 
)

ddss_dgather_tile: Performs the copy of a tile from the flat matrix A to the tile matrix TILE_A for the MT, NT tile.

Parameters
[in]Mint. M specifies the number of rows of the flat matrix.
[in]Nint. N specifies the number of columns of the flat matrix.
[in]Adouble *. A is a pointer to the flat matrix.
[in]LDAint. LDA specifies the number of columns ( row-major order ) of matrix A.
[in,out]TILE_Adouble *. TILE_A is a pointer to the tile matrix.
[in]MIDint. MID specifies the row id of the tile.
[in]NIDint. NID specifies the column id of the tile.
See also
ddss_tile_size
ddss_dflat2tiled

Definition at line 238 of file ddss_flat2tiled.c.

References ddss_tile_size().

Referenced by ddss_dflat2tiled(), and ddss_dsymflat2tiled().

240 {
241 
242  //Local variables
243  int i, j;
244  int tile_size_m, tile_size_n;
245 
246  tile_size_m = ddss_tile_size( M, MID );
247  tile_size_n = ddss_tile_size( N, NID );
248 
249  for ( i = 0; i < tile_size_m; i++ )
250  {
251  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 }
int ddss_tile_size(int M, int MT)
Definition: ddss_tile.c:52
void 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 
)

ddss_dsymflat2tiled: Performs the change of the data layout from flat layout to tiled layout for symmetric matrices according to row-major order.

Parameters
[in]Mint. M specifies the number of rows of the flat matrix.
[in]Nint. N specifies the number of columns of the flat matrix.
[in]Adouble *. A is a pointer to the flat matrix.
[in]LDAint. LDA specifies the number of columns ( row-major order ) of matrix A.
[in]MTint. MT specifies the number of rows of the matrix TILE_A.
[in]NTint. NT specifies the number of columns of the matrix TILE_A.
[in,out]TILE_Adouble *. TILE_A is a pointer to the tile matrix.
[in]UPLOenum DDSS_UPLO. UPLO specifies the form of A is stored:
  • Lower: Lower triangle of A is stored. The upper traingular part is not referenced.
  • Upper: Upper triangle of A is stored. The lower triangular part is not referenced.
See also
ddss_dgather_tile
ddss_tile_size

Definition at line 147 of file ddss_flat2tiled.c.

References ddss_dgather_tile().

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

149 {
150 
151  // Local variables
152  int m, n;
153 
154  if ( UPLO == Upper )
155  {
156  for ( m = 0; m < MT; m++ )
157  {
158  for ( n = NT-1; n >= m; n-- )
159  {
160  #pragma oss task inout(TILE_A[m][n]) \
161  label( dsymmflat2tiled )
162  {
163  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  else if ( UPLO == Lower )
171  {
172  for ( m = 0; m < MT; m++ )
173  {
174  for ( n = 0; n <= m; n++ )
175  {
176  #pragma oss task inout(TILE_A[m][n]) \
177  label( dsymmflat2tiled )
178  {
179  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 }
void ddss_dgather_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)