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_sbrdalg.c
Go to the documentation of this file.
1 
15 #include <lapacke.h>
16 #include "common.h"
17 
18 
19 /***************************************************************************/
79 #if defined(PLASMA_HAVE_WEAK)
80 #pragma weak CORE_sbrdalg = PCORE_sbrdalg
81 #define CORE_sbrdalg PCORE_sbrdalg
82 #endif
83 void CORE_sbrdalg(PLASMA_enum uplo, int N, int NB,
84  PLASMA_desc *pA, float *V, float *TAU,
85  int i, int j, int m, int grsiz)
86 {
87  int k, shift=3;
88  int myid, colpt, stind, edind, blklastind, stepercol;
89  size_t eltsize;
90  PLASMA_desc A = *pA;
91 
92  eltsize = plasma_element_size(A.dtyp);
93 
94  k = shift / grsiz;
95  stepercol = (k*grsiz == shift) ? k : k+1;
96  for (k = 0; k < grsiz; k++){
97  myid = (i-j)*(stepercol*grsiz) +(m-1)*grsiz + k+1;
98  if(myid%2 ==0) {
99  colpt = (myid/2) * NB + 1 + j - 1;
100  stind = colpt - NB + 1;
101  edind = min(colpt, N);
102  blklastind = colpt;
103  } else {
104  colpt = ((myid+1)/2)*NB + 1 +j -1 ;
105  stind = colpt-NB+1;
106  edind = min(colpt,N);
107  if( (stind>=edind-1) && (edind==N) )
108  blklastind = N;
109  else
110  blklastind = 0;
111  }
112 
113  if( myid == 1 )
114  CORE_sgbelr(uplo, N, &A, V, TAU, stind, edind, eltsize);
115  else if(myid%2 == 0)
116  CORE_sgbrce(uplo, N, &A, V, TAU, stind, edind, eltsize);
117  else /*if(myid%2 == 1)*/
118  CORE_sgblrx(uplo, N, &A, V, TAU, stind, edind, eltsize);
119 
120  if(blklastind >= (N-1)) break;
121  }
122 }
123 
124 /***************************************************************************/
127 void QUARK_CORE_sbrdalg(Quark *quark, Quark_Task_Flags *task_flags,
128  int uplo,
129  int N, int NB,
130  PLASMA_desc *A,
131  float *V,
132  float *TAU,
133  int i, int j, int m, int grsiz, int BAND,
134  int *PCOL, int *ACOL, int *MCOL)
135 {
136  QUARK_Insert_Task(quark, CORE_sbrdalg_quark, task_flags,
137  sizeof(int), &uplo, VALUE,
138  sizeof(int), &N, VALUE,
139  sizeof(int), &NB, VALUE,
140  sizeof(PLASMA_desc), A, NODEP,
141  sizeof(float), V, NODEP,
142  sizeof(float), TAU, NODEP,
143  sizeof(int), &i, VALUE,
144  sizeof(int), &j, VALUE,
145  sizeof(int), &m, VALUE,
146  sizeof(int), &grsiz, VALUE,
147  sizeof(int), PCOL, INPUT,
148  sizeof(int), ACOL, INPUT,
149  sizeof(int), MCOL, OUTPUT | LOCALITY,
150  0);
151 
152 }
153 
154 /***************************************************************************/
157 #if defined(PLASMA_HAVE_WEAK)
158 #pragma weak CORE_sbrdalg_quark = PCORE_sbrdalg_quark
159 #define CORE_sbrdalg_quark PCORE_sbrdalg_quark
160 #endif
162 {
163  PLASMA_desc *pA;
164  float *V;
165  float *TAU;
166  int uplo;
167  int N, NB;
168  int i, j, m, grsiz;
169 
170  quark_unpack_args_10(quark, uplo, N, NB, pA, V, TAU, i, j, m, grsiz);
171  CORE_sbrdalg(uplo, N, NB, pA, V, TAU, i, j, m, grsiz);
172 }