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

Go to the source code of this file.

Functions

int CORE_spamm (int op, int side, int storev, int M, int N, int K, int L, float *A1, int LDA1, float *A2, int LDA2, float *V, int LDV, float *W, int LDW)
void QUARK_CORE_spamm (Quark *quark, Quark_Task_Flags *task_flags, int op, int side, int storev, int m, int n, int k, int l, float *A1, int lda1, float *A2, int lda2, float *V, int ldv, float *W, int ldw)
void CORE_spamm_quark (Quark *quark)

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:
Dulceneia Becker
Date:
2011-06-14 s Tue Nov 22 14:35:24 2011

Definition in file core_spamm.c.


Function Documentation

int CORE_spamm ( int  op,
int  side,
int  storev,
int  M,
int  N,
int  K,
int  L,
float *  A1,
int  LDA1,
float *  A2,
int  LDA2,
float *  V,
int  LDV,
float *  W,
int  LDW 
)

ZPAMM performs one of the matrix-matrix operations

              LEFT                      RIGHT

OP PlasmaW : W = A1 + op(V) * A2 or W = A1 + A2 * op(V) OP PlasmaA2 : A2 = A2 - op(V) * W or A2 = A2 - W * op(V)

where op( V ) is one of

op( V ) = V or op( V ) = V**T or op( V ) = V**T,

A1, A2 and W are general matrices, and V is:

  l = k: rectangle + triangle
  l < k: rectangle + trapezoid
  l = 0: rectangle

Size of V, both rowwise and columnwise, is:


side trans size

left N M x K T K x M right N K x N

T N x K

LEFT (columnwise and rowwise):

        |    K    |                 |         M         |
     _  __________   _              _______________        _ 
        |    |    |                 |             | \

V: | | | V': |_____________|___\ K | | | M-L | | M | | | |__________________| _ |____| | _ \ | | | M - L | L | \ | | L _ \|____| _

RIGHT (columnwise and rowwise):

    |         K         |                   |    N    |   
    _______________        _             _  __________   _
    |             | \                       |    |    |   

V': |_____________|___\ N V: | | | | | | | | K-L |__________________| _ K | | | |____| | _ | K - L | L | \ | | \ | | L _ \|____| _

Arguments

Parameters:
[in]OP
    OP specifies which operation to perform:

    @arg PlasmaW  : W  = A1 + op(V) * A2  or  W  = A1 + A2 * op(V)
    @arg PlasmaA2 : A2 = A2 - op(V) * W   or  A2 = A2 - W * op(V)
[in]SIDE
    SIDE specifies whether  op( V ) multiplies A2
    or W from the left or right as follows:

    @arg PlasmaLeft  : multiply op( V ) from the left
                       OP PlasmaW  :  W  = A1 + op(V) * A2
                       OP PlasmaA2 :  A2 = A2 - op(V) * W

    @arg PlasmaRight : multiply op( V ) from the right
                       OP PlasmaW  :  W  = A1 + A2 * op(V)
                       OP PlasmaA2 :  A2 = A2 - W * op(V)
[in]STOREV
    Indicates how the vectors which define the elementary
    reflectors are stored in V:

    @arg PlasmaColumnwise
    @arg PlasmaRowwise
[in]MThe number of rows of the A1, A2 and W If SIDE is PlasmaLeft, the number of rows of op( V )
[in]NThe number of columns of the A1, A2 and W If SIDE is PlasmaRight, the number of columns of op( V )
[in]KIf SIDE is PlasmaLeft, the number of columns of op( V ) If SIDE is PlasmaRight, the number of rows of op( V )
[in]LThe size of the triangular part of V
[in]A1On entry, the M-by-N tile A1.
[in]LDA1The leading dimension of the array A1. LDA1 >= max(1,M).
[in,out]A2On entry, the M-by-N tile A2. On exit, if OP is PlasmaA2 A2 is overwritten
[in]LDA2The leading dimension of the tile A2. LDA2 >= max(1,M).
[in]VThe matrix V as described above. If SIDE is PlasmaLeft : op( V ) is M-by-K If SIDE is PlasmaRight: op( V ) is K-by-N
[in]LDVThe leading dimension of the array V.
[in,out]WOn entry, the M-by-N matrix W. On exit, W is overwritten either if OP is PlasmaA2 or PlasmaW. If OP is PlasmaA2, W is an input and is used as a workspace.
[in]LDWThe leading dimension of array WORK.
Returns:
Return values:
PLASMA_SUCCESSsuccessful exit
<0if -i, the i-th argument had an illegal value

Definition at line 174 of file core_spamm.c.

References CblasLower, CblasUpper, coreblas_error, L, PLASMA_SUCCESS, PlasmaA2, PlasmaColumnwise, PlasmaLeft, PlasmaNoTrans, PlasmaRight, PlasmaRowwise, PlasmaTrans, PlasmaW, trans, and uplo.

{
int vi2, vi3, uplo, trans, info;
/* Check input arguments */
if ((op != PlasmaW) && (op != PlasmaA2)) {
coreblas_error(1, "Illegal value of op");
return -1;
}
if ((side != PlasmaLeft) && (side != PlasmaRight)) {
coreblas_error(2, "Illegal value of side");
return -2;
}
coreblas_error(3, "Illegal value of storev");
return -3;
}
if (M < 0) {
coreblas_error(4, "Illegal value of M");
return -4;
}
if (N < 0) {
coreblas_error(5, "Illegal value of N");
return -5;
}
if (K < 0) {
coreblas_error(6, "Illegal value of K");
return -6;
}
if (L < 0) {
coreblas_error(7, "Illegal value of L");
return -7;
}
if (LDA1 < 0) {
coreblas_error(9, "Illegal value of LDA1");
return -9;
}
if (LDA2 < 0) {
coreblas_error(11, "Illegal value of LDA2");
return -11;
}
if (LDV < 0) {
coreblas_error(13, "Illegal value of LDV");
return -13;
}
if (LDW < 0) {
coreblas_error(15, "Illegal value of LDW");
return -15;
}
/* Quick return */
if ((M == 0) || (N == 0) || (K == 0))
/*
* TRANS is set as:
*
* -------------------------------------
* side direct PlasmaW PlasmaA2
* -------------------------------------
* left colwise T N
* rowwise N T
* right colwise N T
* rowwise T N
* -------------------------------------
*/
/* Columnwise*/
uplo = CblasUpper;
if (side == PlasmaLeft) {
trans = op == PlasmaA2 ? PlasmaNoTrans : PlasmaTrans;
vi2 = trans == PlasmaNoTrans ? M - L : K - L;
}
else {
trans = op == PlasmaW ? PlasmaNoTrans : PlasmaTrans;
vi2 = trans == PlasmaNoTrans ? K - L : N - L;
}
vi3 = LDV * L;
}
/* Rowwise */
else {
uplo = CblasLower;
if (side == PlasmaLeft) {
trans = op == PlasmaW ? PlasmaNoTrans : PlasmaTrans;
vi2 = trans == PlasmaNoTrans ? K - L : M - L;
}
else {
trans = op == PlasmaA2 ? PlasmaNoTrans : PlasmaTrans;
vi2 = trans == PlasmaNoTrans ? N - L : K - L;
}
vi2 *= LDV;
vi3 = L;
}
if (op==PlasmaW) {
info = CORE_spamm_w(
side, trans, uplo, M, N, K, L, vi2, vi3,
A1, LDA1, A2, LDA2, V, LDV, W, LDW);
if (info != 0)
return info;
} else if (op==PlasmaA2) {
info = CORE_spamm_a2(
side, trans, uplo, M, N, K, L, vi2, vi3,
A2, LDA2, V, LDV, W, LDW);
if (info != 0)
return info;
}
}

Here is the caller graph for this function:

void CORE_spamm_quark ( Quark quark)

Definition at line 600 of file core_spamm.c.

References CORE_spamm(), L, quark_unpack_args_15, side, storev, V, and W.

{
int op;
int side;
int storev;
int M;
int N;
int K;
int L;
float *A1;
int LDA1;
float *A2;
int LDA2;
float *V;
int LDV;
float *W;
int LDW;
quark_unpack_args_15(quark, op, side, storev, M, N, K, L,
A1, LDA1, A2, LDA2, V, LDV, W, LDW);
CORE_spamm( op, side, storev, M, N, K, L, A1, LDA1, A2, LDA2, V, LDV, W, LDW);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QUARK_CORE_spamm ( Quark quark,
Quark_Task_Flags task_flags,
int  op,
int  side,
int  storev,
int  m,
int  n,
int  k,
int  l,
float *  A1,
int  lda1,
float *  A2,
int  lda2,
float *  V,
int  ldv,
float *  W,
int  ldw 
)

Definition at line 569 of file core_spamm.c.

References CORE_spamm_quark(), INOUT, INPUT, QUARK_Insert_Task(), and VALUE.

{
QUARK_Insert_Task(quark, CORE_spamm_quark, task_flags,
sizeof(int), &op, VALUE,
sizeof(PLASMA_enum), &side, VALUE,
sizeof(PLASMA_enum), &storev, VALUE,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(int), &k, VALUE,
sizeof(int), &l, VALUE,
sizeof(float)*m*k, A1, INPUT,
sizeof(int), &lda1, VALUE,
sizeof(float)*k*n, A2, INPUT,
sizeof(int), &lda2, VALUE,
sizeof(float)*m*n, V, INPUT,
sizeof(int), &ldv, VALUE,
sizeof(float)*m*n, W, INOUT,
sizeof(int), &ldw, VALUE,
0);
}

Here is the call graph for this function: