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

Go to the source code of this file.

Functions

void CORE_sshiftw (int s, int cl, int m, int n, int L, float *A, float *W)
void QUARK_CORE_sshiftw (Quark *quark, Quark_Task_Flags *task_flags, int s, int cl, int m, int n, int L, float *A, float *W)
void CORE_sshiftw_quark (Quark *quark)
void CORE_sshift (int s, int m, int n, int L, float *A)
void QUARK_CORE_sshift (Quark *quark, Quark_Task_Flags *task_flags, int s, int m, int n, int L, float *A)
void CORE_sshift_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

s Tue Nov 22 14:35:21 2011

Definition in file core_sshift.c.


Function Documentation

void CORE_sshift ( int  s,
int  m,
int  n,
int  L,
float *  A 
)

CORE_sshift Shift a cycle of block. Same as core_sshiftw 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_sshift.c.

References CORE_sshiftw(), and W.

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

Here is the call graph for this function:

void CORE_sshift_quark ( Quark quark)

Definition at line 208 of file core_sshift.c.

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

{
int s;
int m;
int n;
int L;
float *A;
float *W;
quark_unpack_args_6(quark, s, m, n, L, A, W);
memcpy(W, &(A[s*L]), L*sizeof(float));
CORE_sshiftw(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_sshiftw ( int  s,
int  cl,
int  m,
int  n,
int  L,
float *  A,
float *  W 
)

CORE_sshiftw 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_sshift.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(float));
}

Here is the caller graph for this function:

void CORE_sshiftw_quark ( Quark quark)

Definition at line 130 of file core_sshift.c.

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

{
int s;
int cl;
int m;
int n;
int L;
float *A;
float *W;
quark_unpack_args_7(quark, s, cl, m, n, L, A, W);
CORE_sshiftw(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_sshift ( Quark quark,
Quark_Task_Flags task_flags,
int  s,
int  m,
int  n,
int  L,
float *  A 
)

Definition at line 187 of file core_sshift.c.

References CORE_sshift_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(float)*m*n*L, A, INOUT | GATHERV,
sizeof(float)*L, NULL, SCRATCH,
0);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QUARK_CORE_sshiftw ( Quark quark,
Quark_Task_Flags task_flags,
int  s,
int  cl,
int  m,
int  n,
int  L,
float *  A,
float *  W 
)

Definition at line 108 of file core_sshift.c.

References CORE_sshiftw_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(float)*m*n*L, A, INOUT,
sizeof(float)*L, W, INPUT,
0);
}

Here is the call graph for this function: