PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
core_dtrdalg.c
Go to the documentation of this file.
1 
15 #include <lapacke.h>
16 #include "common.h"
17 
18 /***************************************************************************/
78 #if defined(PLASMA_HAVE_WEAK)
79 #pragma weak CORE_dtrdalg = PCORE_dtrdalg
80 #define CORE_dtrdalg PCORE_dtrdalg
81 #endif
82 void CORE_dtrdalg(PLASMA_enum uplo, int N, int NB,
83  PLASMA_desc *pA, double *V, double *TAU,
84  int i, int j, int m, int grsiz)
85 {
86  int k, shift=3;
87  int myid, colpt, stind, edind, blklastind, stepercol;
88  size_t eltsize;
89  PLASMA_desc A = *pA;
90 
91  eltsize = plasma_element_size(A.dtyp);
92 
93  k = shift / grsiz;
94  stepercol = (k*grsiz == shift) ? k : k+1;
95  for (k = 0; k < grsiz; k++){
96  myid = (i-j)*(stepercol*grsiz) +(m-1)*grsiz + k+1;
97  if(myid%2 ==0) {
98  colpt = (myid/2) * NB + 1 + j - 1;
99  stind = colpt - NB + 1;
100  edind = min(colpt, N);
101  blklastind = colpt;
102  } else {
103  colpt = ((myid+1)/2)*NB + 1 +j -1 ;
104  stind = colpt-NB+1;
105  edind = min(colpt,N);
106  if( (stind>=edind-1) && (edind==N) )
107  blklastind = N;
108  else
109  blklastind = 0;
110  }
111 
112  if( myid == 1 )
113  CORE_dhbelr(uplo, N, &A, V, TAU, stind, edind, eltsize);
114  else if(myid%2 == 0)
115  CORE_dhbrce(uplo, N, &A, V, TAU, stind, edind, eltsize);
116  else /*if(myid%2 == 1)*/
117  CORE_dhblrx(uplo, N, &A, V, TAU, stind, edind, eltsize);
118 
119  if(blklastind >= (N-1)) break;
120  }
121 }
122 
123 /***************************************************************************/
126 void QUARK_CORE_dtrdalg(Quark *quark, Quark_Task_Flags *task_flags,
127  int uplo,
128  int N, int NB,
129  PLASMA_desc *A,
130  double *V,
131  double *TAU,
132  int i, int j, int m, int grsiz, int BAND,
133  int *PCOL, int *ACOL, int *MCOL)
134 {
135  QUARK_Insert_Task(quark, CORE_dtrdalg_quark, task_flags,
136  sizeof(int), &uplo, VALUE,
137  sizeof(int), &N, VALUE,
138  sizeof(int), &NB, VALUE,
139  sizeof(PLASMA_desc), A, NODEP,
140  sizeof(double), V, NODEP,
141  sizeof(double), TAU, NODEP,
142  sizeof(int), &i, VALUE,
143  sizeof(int), &j, VALUE,
144  sizeof(int), &m, VALUE,
145  sizeof(int), &grsiz, VALUE,
146  sizeof(int), PCOL, INPUT,
147  sizeof(int), ACOL, INPUT,
148  sizeof(int), MCOL, OUTPUT | LOCALITY,
149  0);
150 
151 }
152 
153 /***************************************************************************/
156 #if defined(PLASMA_HAVE_WEAK)
157 #pragma weak CORE_dtrdalg_quark = PCORE_dtrdalg_quark
158 #define CORE_dtrdalg_quark PCORE_dtrdalg_quark
159 #endif
161 {
162  PLASMA_desc *pA;
163  double *V;
164  double *TAU;
165  int uplo;
166  int N, NB;
167  int i, j, m, grsiz;
168 
169  quark_unpack_args_10(quark, uplo, N, NB, pA, V, TAU, i, j, m, grsiz);
170  CORE_dtrdalg(uplo, N, NB, pA, V, TAU, i, j, m, grsiz);
171 }