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

Go to the source code of this file.

Functions

void CORE_cswpab (int i, int n1, int n2, PLASMA_Complex32_t *A, PLASMA_Complex32_t *work)
void QUARK_CORE_cswpab (Quark *quark, Quark_Task_Flags *task_flags, int i, int n1, int n2, PLASMA_Complex32_t *A, int szeA)
void CORE_cswpab_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

c Tue Nov 22 14:35:20 2011

Definition in file core_cswpab.c.


Function Documentation

void CORE_cswpab ( int  i,
int  n1,
int  n2,
PLASMA_Complex32_t A,
PLASMA_Complex32_t work 
)

CORE_cswpab swaps two adjacent contiguous blocks of data.

n1                     n2

+————-+——————————-+

become : n2 n1 +——————————-+————-+

Parameters:
[in,out]AArray of size i+n1+n2. On entry, a block of size n1 followed by a block of size n2. On exit, the block of size n1 follows the block of size n2.
[in]iFirst block starts at A[i].
[in]n1Size of the first block to swap.
[in]n2Size of the second block to swap.
[out]workWorkspace array of size min(n1, n2).

Definition at line 63 of file core_cswpab.c.

{
PLASMA_Complex32_t *A0 = &(A[i]);
PLASMA_Complex32_t *A1 = &(A[i+n1]);
PLASMA_Complex32_t *A2 = &(A[i+n2]);
int j;
if( n1 < n2 ) {
memcpy(work, A0, n1*sizeof(PLASMA_Complex32_t));
for (j=0; j<n2; j++)
A0[j] = A1[j];
memcpy(A2, work, n1*sizeof(PLASMA_Complex32_t));
} else {
memcpy(work, A1, n2*sizeof(PLASMA_Complex32_t));
for (j=n1-1; j>-1; j--)
A2[j] = A0[j];
memcpy(A0, work, n2*sizeof(PLASMA_Complex32_t));
}
}

Here is the caller graph for this function:

void CORE_cswpab_quark ( Quark quark)

Definition at line 107 of file core_cswpab.c.

References A, CORE_cswpab(), and quark_unpack_args_5.

{
int i;
int n1;
int n2;
quark_unpack_args_5(quark, i, n1, n2, A, work);
CORE_cswpab( i, n1, n2, A, work);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void QUARK_CORE_cswpab ( Quark quark,
Quark_Task_Flags task_flags,
int  i,
int  n1,
int  n2,
PLASMA_Complex32_t A,
int  szeA 
)

Definition at line 85 of file core_cswpab.c.

References CORE_cswpab_quark(), DAG_CORE_SWPAB, INOUT, min, QUARK_Insert_Task(), SCRATCH, and VALUE.

{
quark, CORE_cswpab_quark, task_flags,
sizeof(int), &i, VALUE,
sizeof(int), &n1, VALUE,
sizeof(int), &n2, VALUE,
sizeof(PLASMA_Complex32_t)*szeA, A, INOUT,
sizeof(PLASMA_Complex32_t)*min(n1,n2), NULL, SCRATCH,
0);
}

Here is the call graph for this function: