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

LASs-DDSs ddss_tiled2flat routines. More...

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

Go to the source code of this file.

Functions

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

Detailed Description

LASs-DDSs ddss_tiled2flat 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-10

Definition in file ddss_tiled2flat.c.

Function Documentation

void ddss_dscatter_tile ( int  M,
int  N,
double *  A,
int  LDA,
double *  TILE_A,
int  MID,
int  NID 
)

ddss_dscatter_tile: Performs the copy of a tile from the tile matrix TILE_A to the flat matrix 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,out]Adouble *. A is a pointer to the flat matrix.
[in]LDAint. LDA specifies the number of columns ( row-major order ) of matrix A.
[in]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_dtiled2flat

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

416 {
417 
418  //Local variables
419  int i, j;
420  int tile_size_m, tile_size_n;
421 
422  tile_size_m = ddss_tile_size( M, MID );
423  tile_size_n = ddss_tile_size( N, NID );
424 
425  for ( i = 0; i < tile_size_m; i++ )
426  {
427  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 }
int ddss_tile_size(int M, int MT)
Definition: ddss_tile.c:52
void 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 
)

ddss_dsymtiled2flat: Performs the change of the data layout from tile layout to flat 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,out]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]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_dscatter_tile
ddss_tile_size

Definition at line 223 of file ddss_tiled2flat.c.

References ddss_dscatter_tile().

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

225 {
226 
227  // Local variables
228  int m, n;
229 
230  if ( UPLO == Upper )
231  {
232  for ( m = 0; m < MT; m++ )
233  {
234  for ( n = NT-1; n >= m; n-- )
235  {
236  #pragma oss task inout(TILE_A[m][n]) \
237  label( dsymmtiled2flat )
238  {
239  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  else if ( UPLO == Lower )
247  {
248  for ( m = 0; m < MT; m++ )
249  {
250  for ( n = 0; n <= m; n++ )
251  {
252  #pragma oss task inout(TILE_A[m][n]) \
253  label( dsymmtiled2flat )
254  {
255  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  #pragma oss taskwait
264 }
void ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
void 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 
)

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.

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,out]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]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_dscatter_tile
ddss_tile_size

Definition at line 324 of file ddss_tiled2flat.c.

References ddss_dscatter_tile().

Referenced by kdposv().

326 {
327 
328  // Local variables
329  int m, n;
330 
331  if ( UPLO == Upper )
332  {
333  for ( m = 0; m < MT; m++ )
334  {
335  for ( n = NT-1; n >= m; n-- )
336  {
337  #pragma oss task inout(TILE_A[m][n]) \
338  label( dsymmtiled2flat_nb )
339  {
340  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  else if ( UPLO == Lower )
348  {
349  for ( m = 0; m < MT; m++ )
350  {
351  for ( n = 0; n <= m; n++ )
352  {
353  #pragma oss task inout(TILE_A[m][n]) \
354  label( dsymmtiled2flat_nb )
355  {
356  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 }
void ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
void ddss_dtiled2flat ( int  M,
int  N,
double *  A,
int  LDA,
int  MT,
int  NT,
double(*)  TILE_A[NT][TILE_SIZE *TILE_SIZE] 
)

ddss_dtiled2flat: Performs the change of the data layout from tile layout to flat 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,out]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]TILE_Adouble *. TILE_A is a pointer to the tile matrix.
See also
ddss_dscatter_tile
ddss_tile_size

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

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( dtiled2flat)
81  {
82  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  #pragma oss taskwait
90 
91 }
void ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)
void ddss_dtiled2flat_nb ( int  M,
int  N,
double *  A,
int  LDA,
int  MT,
int  NT,
double(*)  TILE_A[NT][TILE_SIZE *TILE_SIZE] 
)

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.

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,out]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]TILE_Adouble *. TILE_A is a pointer to the tile matrix.
See also
ddss_dscatter_tile
ddss_tile_size

Definition at line 142 of file ddss_tiled2flat.c.

References ddss_dscatter_tile().

Referenced by kdnpgesv().

144 {
145 
146  // Local variables
147  int m, n;
148 
149  for ( m = 0; m < MT; m++ )
150  {
151  for ( n = 0; n < NT; n++ )
152  {
153  #pragma oss task inout(TILE_A[m][n]) \
154  label( dtiled2flat)
155  {
156  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 }
void ddss_dscatter_tile(int M, int N, double *A, int LDA, double *TILE_A, int MID, int NID)