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_dswpab.c
Go to the documentation of this file.
1 
21 #include <stdlib.h>
22 #include "common.h"
23 #include "quark.h"
24 
59 #if defined(PLASMA_HAVE_WEAK)
60 #pragma weak CORE_dswpab = PCORE_dswpab
61 #define CORE_dswpab PCORE_dswpab
62 #endif
63 void CORE_dswpab(int i, int n1, int n2, double *A, double *work) {
64  double *A0 = &(A[i]);
65  double *A1 = &(A[i+n1]);
66  double *A2 = &(A[i+n2]);
67  int j;
68 
69  if( n1 < n2 ) {
70  memcpy(work, A0, n1*sizeof(double));
71  for (j=0; j<n2; j++)
72  A0[j] = A1[j];
73  memcpy(A2, work, n1*sizeof(double));
74  } else {
75  memcpy(work, A1, n2*sizeof(double));
76  for (j=n1-1; j>-1; j--)
77  A2[j] = A0[j];
78  memcpy(A0, work, n2*sizeof(double));
79  }
80 }
81 
82 /***************************************************************************/
85 void QUARK_CORE_dswpab(Quark *quark, Quark_Task_Flags *task_flags,
86  int i, int n1, int n2,
87  double *A, int szeA)
88 {
91  quark, CORE_dswpab_quark, task_flags,
92  sizeof(int), &i, VALUE,
93  sizeof(int), &n1, VALUE,
94  sizeof(int), &n2, VALUE,
95  sizeof(double)*szeA, A, INOUT,
96  sizeof(double)*min(n1,n2), NULL, SCRATCH,
97  0);
98 }
99 
100 /***************************************************************************/
103 #if defined(PLASMA_HAVE_WEAK)
104 #pragma weak CORE_dswpab_quark = PCORE_dswpab_quark
105 #define CORE_dswpab_quark PCORE_dswpab_quark
106 #endif
108 {
109  int i;
110  int n1;
111  int n2;
112  double *A;
113  double *work;
114 
115  quark_unpack_args_5(quark, i, n1, n2, A, work);
116  CORE_dswpab( i, n1, n2, A, work);
117 }