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_dhbelr.c File Reference
#include <lapacke.h>
#include "common.h"
Include dependency graph for core_dhbelr.c:

Go to the source code of this file.

Macros

#define A(_m, _n)   (double *)plasma_geteltaddr(A, ((_m)-1), ((_n)-1), eltsize)
#define V(_m)   &(V[(_m)-1])
#define TAU(_m)   &(TAU[(_m)-1])

Functions

int CORE_dhbelr (int uplo, int N, PLASMA_desc *A, double *V, double *TAU, int st, int ed, int eltsize)

Detailed Description

PLASMA core_blas kernel PLASMA is a software package provided by Univ. of Tennessee, Univ. of California Berkeley and Univ. of Colorado Denver

Version:
2.4.5
Author:
Azzam Haidar
Date:
2011-05-15 d Tue Nov 22 14:35:22 2011

Definition in file core_dhbelr.c.


Macro Definition Documentation

#define A (   _m,
  _n 
)    (double *)plasma_geteltaddr(A, ((_m)-1), ((_n)-1), eltsize)

CORE_dhbelr is a kernel that will operate on a region (triangle) of data bounded by st and ed. This kernel eliminate a column by an element-wise annihiliation, and for each annihiliation, it apply a left update, followed by an right update on the diagonal 2x2 element, then it continue until finishing the the whole column. When this is done, it take advantage that data are on cache and will apply the right on the remaining part of this region that has not been updated by the right yet. Note that the column to be eliminated is located at st-1.

Parameters:
[in]uplo
  • PlasmaLower:
  • PlasmaUpper:
[in]NThe order of the matrix A.
[in,out]AA pointer to the descriptor of the matrix A.
[out]Vdouble array, dimension (N). The scalar elementary reflectors are written in this array. So it is used as a workspace for V at each step of the bulge chasing algorithm.
[out]TAUdouble array, dimension (N). The scalar factors of the elementary reflectors are written in thisarray. So it is used as a workspace for TAU at each step of the bulge chasing algorithm.
[in]stA pointer to the start index where this kernel will operate.
[in]edA pointer to the end index where this kernel will operate.
[in]eltsizePLASMA internal value which refer to the size of the precision.
Returns:
Return values:
PLASMA_SUCCESSsuccessful exit
<0if -i, the i-th argument had an illegal value TYPE 1-BDL Householder add -1 because of C

Definition at line 74 of file core_dhbelr.c.

#define TAU (   _m)    &(TAU[(_m)-1])

Definition at line 76 of file core_dhbelr.c.

#define V (   _m)    &(V[(_m)-1])

Definition at line 75 of file core_dhbelr.c.


Function Documentation

int CORE_dhbelr ( int  uplo,
int  N,
PLASMA_desc A,
double *  V,
double *  TAU,
int  st,
int  ed,
int  eltsize 
)

Definition at line 78 of file core_dhbelr.c.

References A, CORE_dlarfx2(), CORE_dlarfx2c(), coreblas_error, ELTLDD, max, plasma_desc_t::mb, min, PLASMA_SUCCESS, PlasmaLeft, PlasmaLower, PlasmaRight, PlasmaUpper, TAU, and V.

{
int NB, J1, J2;
int len1, len2, t1ed, t2st;
int i;
static double zzero = 0.0;
/* Check input arguments */
if (N < 0) {
coreblas_error(2, "Illegal value of N");
return -2;
}
if (ed <= st) {
coreblas_error(23, "Illegal value of st and ed (internal)");
return -23;
}
/* Quick return */
if (N == 0)
NB = A->mb;
if( uplo == PlasmaLower ) {
/* ========================
* LOWER CASE
* ========================*/
for (i = ed; i >= st+1 ; i--){
/* generate Householder to annihilate a(i+k-1,i) within the band */
*V(i) = *A(i, (st-1));
*A(i, (st-1)) = zzero;
LAPACKE_dlarfg_work( 2, A((i-1),(st-1)), V(i), 1, TAU(i));
/* apply reflector from the left (horizontal row) and from the right for only the diagonal 2x2.*/
J1 = st;
J2 = i-2;
t1ed = (J2/NB)*NB;
t2st = max(t1ed+1,J1);
len1 = t1ed-J1+1; /* can be negative */
len2 = J2-t2st+1;
if(len1>0)CORE_dlarfx2(PlasmaLeft, len1 , *V(i), (*TAU(i)), A(i-1, J1 ), ELTLDD(vA, i-1), A(i, J1 ), ELTLDD(vA, i) );
if(len2>0)CORE_dlarfx2(PlasmaLeft, len2 , *V(i), (*TAU(i)), A(i-1, t2st), ELTLDD(vA, i-1), A(i, t2st), ELTLDD(vA, i) );
CORE_dlarfx2c(PlasmaLower, *V(i), *TAU(i), A(i-1, i-1), A(i, i-1), A(i, i));
}
/* APPLY RIGHT ON THE REMAINING ELEMENT OF KERNEL 1 */
for (i = ed; i >= st+1 ; i--){
J1 = i+1;
J2 = min(ed,N);
t1ed = (J2/NB)*NB;
t2st = max(t1ed+1,J1);
len1 = t1ed-J1+1; /* can be negative */
len2 = J2-t2st+1;
if(len1>0)CORE_dlarfx2(PlasmaRight, len1, *V(i), *TAU(i), A(J1, i-1), ELTLDD(vA, J1) , A(J1 , i), ELTLDD(vA, J1) );
if(len2>0)CORE_dlarfx2(PlasmaRight, len2, *V(i), *TAU(i), A(t2st,i-1), ELTLDD(vA, t2st), A(t2st, i), ELTLDD(vA, t2st) );
}
}else{
/* ========================
* UPPER CASE
* ========================*/
for (i = ed; i >= st+1 ; i--){
/* generate Householder to annihilate a(i+k-1,i) within the band*/
*V(i) = *A((st-1), i);
*A((st-1), i) = zzero;
LAPACKE_dlarfg_work( 2, A(st-1, i-1), V(i), 1, TAU(i));
/* apply reflector from the left (horizontal row) and from the right for only the diagonal 2x2.*/
J1 = st;
J2 = i-2;
t1ed = (J2/NB)*NB;
t2st = max(t1ed+1,J1);
len1 = t1ed-J1+1; /* can be negative */
len2 = J2-t2st+1;
if(len1>0)CORE_dlarfx2(PlasmaRight, len1, (*V(i)), (*TAU(i)), A(J1, i-1), ELTLDD(vA, J1) , A(J1 , i), ELTLDD(vA, J1) );
if(len2>0)CORE_dlarfx2(PlasmaRight, len2, (*V(i)), (*TAU(i)), A(t2st,i-1), ELTLDD(vA, t2st), A(t2st, i), ELTLDD(vA, t2st) );
CORE_dlarfx2c(PlasmaUpper, *V(i), *TAU(i), A(i-1, i-1), A(i-1, i), A(i,i));
}
/* APPLY LEFT ON THE REMAINING ELEMENT OF KERNEL 1 */
for (i = ed; i >= st+1 ; i--){
J1 = i+1;
J2 = min(ed,N);
t1ed = (J2/NB)*NB;
t2st = max(t1ed+1,J1);
len1 = t1ed-J1+1; /* can be negative */
len2 = J2-t2st+1;
if(len1>0)CORE_dlarfx2(PlasmaLeft, len1 , (*V(i)), *TAU(i), A(i-1, J1 ), ELTLDD(vA, i-1), A(i, J1 ), ELTLDD(vA, i) );
if(len2>0)CORE_dlarfx2(PlasmaLeft, len2 , (*V(i)), *TAU(i), A(i-1, t2st), ELTLDD(vA, i-1), A(i, t2st), ELTLDD(vA, i) );
}
} /* end of else for the upper case */
}

Here is the call graph for this function:

Here is the caller graph for this function: