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_cgeadd.c
Go to the documentation of this file.
1 
15 #include "common.h"
16 
17 /***************************************************************************/
22 #if defined(PLASMA_HAVE_WEAK)
23 #pragma weak CORE_cgeadd = PCORE_cgeadd
24 #define CORE_cgeadd PCORE_cgeadd
25 #endif
26 void CORE_cgeadd(int M, int N, PLASMA_Complex32_t alpha,
27  PLASMA_Complex32_t *A, int LDA,
28  PLASMA_Complex32_t *B, int LDB)
29 {
30  int j;
31 
32  if (M == LDA && M == LDB)
33  cblas_caxpy(M*N, CBLAS_SADDR(alpha), A, 1, B, 1);
34  else {
35  for (j = 0; j < N; j++)
36  cblas_caxpy(M, CBLAS_SADDR(alpha), &A[j*LDA], 1, &B[j*LDB], 1);
37  }
38 }
39 
40 /***************************************************************************/
43 void QUARK_CORE_cgeadd(Quark *quark, Quark_Task_Flags *task_flags,
44  int m, int n, int nb, PLASMA_Complex32_t alpha,
45  PLASMA_Complex32_t *A, int lda,
46  PLASMA_Complex32_t *B, int ldb)
47 {
49  QUARK_Insert_Task(quark, CORE_cgeadd_quark, task_flags,
50  sizeof(int), &m, VALUE,
51  sizeof(int), &n, VALUE,
52  sizeof(PLASMA_Complex32_t), &alpha, VALUE,
53  sizeof(PLASMA_Complex32_t)*nb*nb, A, INPUT,
54  sizeof(int), &lda, VALUE,
55  sizeof(PLASMA_Complex32_t)*nb*nb, B, INOUT,
56  sizeof(int), &ldb, VALUE,
57  0);
58 }
59 
60 /***************************************************************************/
63 #if defined(PLASMA_HAVE_WEAK)
64 #pragma weak CORE_cgeadd_quark = PCORE_cgeadd_quark
65 #define CORE_cgeadd_quark PCORE_cgeadd_quark
66 #endif
68 {
69  int M;
70  int N;
71  PLASMA_Complex32_t alpha;
73  int LDA;
75  int LDB;
76 
77  int j;
78 
79  quark_unpack_args_7(quark, M, N, alpha, A, LDA, B, LDB);
80  if (M == LDA && M == LDB)
81  cblas_caxpy(M*N, CBLAS_SADDR(alpha), A, 1, B, 1);
82  else {
83  for (j = 0; j < N; j++)
84  cblas_caxpy(M, CBLAS_SADDR(alpha), &A[j*LDA], 1, &B[j*LDB], 1);
85  }
86 }
87