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_zshift.c File Reference
#include <stdlib.h>
#include "common.h"
#include "quark.h"
Include dependency graph for core_zshift.c:

Go to the source code of this file.

Functions

void CORE_zshiftw (int s, int cl, int m, int n, int L, PLASMA_Complex64_t *A, PLASMA_Complex64_t *W)
void QUARK_CORE_zshiftw (Quark *quark, Quark_Task_Flags *task_flags, int s, int cl, int m, int n, int L, PLASMA_Complex64_t *A, PLASMA_Complex64_t *W)
void CORE_zshiftw_quark (Quark *quark)
void CORE_zshift (int s, int m, int n, int L, PLASMA_Complex64_t *A)
void QUARK_CORE_zshift (Quark *quark, Quark_Task_Flags *task_flags, int s, int m, int n, int L, PLASMA_Complex64_t *A)
void CORE_zshift_quark (Quark *quark)

Detailed Description

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

This work is the implementation of an inplace transformation based on the GKK algorithm by Gustavson, Karlsson, Kagstrom and its fortran implementation.

Version:
2.4.5
Author:
Mathieu Faverge
Date:
2010-11-15

normal z -> c d s

Definition in file core_zshift.c.


Function Documentation

void CORE_zshift ( int  s,
int  m,
int  n,
int  L,
PLASMA_Complex64_t A 
)

CORE_zshift Shift a cycle of block. Same as core_zshiftw but you don't need to provide the workspace. As a matter of fact, the cycle cannot be split anymore to keep data coherency.

Parameters:
[in]sStart value in the cycle
[in]mNumber of lines of tile A
[in]nNumber of columns of tile A
[in]LLength of each block of data to move
[in,out]AMatrix of size m-by-n with each element of size L. On exit, A = A', where A' contains the permutations

Definition at line 175 of file core_zshift.c.

References CORE_zshiftw(), and W.

{
W = (PLASMA_Complex64_t*)malloc(L * sizeof(PLASMA_Complex64_t));
memcpy(W, &(A[s*L]), L*sizeof(PLASMA_Complex64_t));
CORE_zshiftw(s, 0, m, n, L, A, W);
free(W);
}

Here is the call graph for this function:

void CORE_zshift_quark ( Quark quark)

Definition at line 208 of file core_zshift.c.

References A, CORE_zshiftw(), L, quark_unpack_args_6, and W.

{
int s;
int m;
int n;
int L;
quark_unpack_args_6(quark, s, m, n, L, A, W);
memcpy(W, &(A[s*L]), L*sizeof(PLASMA_Complex64_t));
CORE_zshiftw(s, 0, m, n, L, A, W);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CORE_zshiftw ( int  s,
int  cl,
int  m,
int  n,
int  L,
PLASMA_Complex64_t A,
PLASMA_Complex64_t W 
)

CORE_zshiftw Shift a linear chain of block using a supplied workspace by following the cycle defined by: k_(i+1) = (k_i * m) % q;

Parameters:
[in]sStart value in the cycle
[in]clCycle length if cl == 0, all the permutations from the cycle are done else the cycle is split onto several threads and the number of permutation to do has to be specified to not get overlap
[in]mNumber of lines of tile A
[in]nNumber of columns of tile A
[in]LLength of each block of data to move
[in,out]AMatrix of size m-by-n with each element of size L. On exit, A = A', where A' contains the permutations
[in]WArray of size L. On entry, must contain: W(:) = A(s*L:s*L+L-1)

Definition at line 66 of file core_zshift.c.

References L.

{
int64_t k, k1;
int i, j, q, kL, k1L;
q = m * n - 1;
k = s;
if( cl != 0 ) {
for (i=1; i<cl; i++) {
k1 = (k * m) % (int64_t)q;
/* A(k*L:k*L+L-1) = A(k1*L:k1*L+L-1) */
kL = k *L;
k1L = k1*L;
for(j=0; j<L; j++) {
A[kL+j] = A[k1L+j];
}
k = k1;
}
}
else {
while (1) {
k1 = (k * m) % (int64_t)q;
if( k1 == s )
break;
/* A(k*L:k*L+L-1) = A(k1*L:k1*L+L-1) */
kL = k *L;
k1L = k1*L;
for (j=0; j<L; j++) {
A[kL+j] = A[k1L+j];
}
k = k1;
}
}
memcpy(&(A[k*L]), W, L*sizeof(PLASMA_Complex64_t));
}

Here is the caller graph for this function:

void CORE_zshiftw_quark ( Quark quark)

Definition at line 130 of file core_zshift.c.

References A, CORE_zshiftw(), L, quark_unpack_args_7, and W.

{
int s;
int cl;
int m;
int n;
int L;
quark_unpack_args_7(quark, s, cl, m, n, L, A, W);
CORE_zshiftw(s, cl, m, n, L, A, W);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QUARK_CORE_zshift ( Quark quark,
Quark_Task_Flags task_flags,
int  s,
int  m,
int  n,
int  L,
PLASMA_Complex64_t A 
)

Definition at line 187 of file core_zshift.c.

References CORE_zshift_quark(), DAG_CORE_SHIFT, GATHERV, INOUT, QUARK_Insert_Task(), SCRATCH, and VALUE.

{
sizeof(int), &s, VALUE,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(int), &L, VALUE,
sizeof(PLASMA_Complex64_t)*m*n*L, A, INOUT | GATHERV,
sizeof(PLASMA_Complex64_t)*L, NULL, SCRATCH,
0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QUARK_CORE_zshiftw ( Quark quark,
Quark_Task_Flags task_flags,
int  s,
int  cl,
int  m,
int  n,
int  L,
PLASMA_Complex64_t A,
PLASMA_Complex64_t W 
)

Definition at line 108 of file core_zshift.c.

References CORE_zshiftw_quark(), DAG_CORE_SHIFTW, INOUT, INPUT, QUARK_Insert_Task(), and VALUE.

{
sizeof(int), &s, VALUE,
sizeof(int), &cl, VALUE,
sizeof(int), &m, VALUE,
sizeof(int), &n, VALUE,
sizeof(int), &L, VALUE,
sizeof(PLASMA_Complex64_t)*m*n*L, A, INOUT,
sizeof(PLASMA_Complex64_t)*L, W, INPUT,
0);
}

Here is the call graph for this function: