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_dgeadd.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_dgeadd = PCORE_dgeadd
24 #define CORE_dgeadd PCORE_dgeadd
25 #endif
26 void CORE_dgeadd(int M, int N, double alpha,
27  double *A, int LDA,
28  double *B, int LDB)
29 {
30  int j;
31 
32  if (M == LDA && M == LDB)
33  cblas_daxpy(M*N, (alpha), A, 1, B, 1);
34  else {
35  for (j = 0; j < N; j++)
36  cblas_daxpy(M, (alpha), &A[j*LDA], 1, &B[j*LDB], 1);
37  }
38 }
39 
40 /***************************************************************************/
43 void QUARK_CORE_dgeadd(Quark *quark, Quark_Task_Flags *task_flags,
44  int m, int n, int nb, double alpha,
45  double *A, int lda,
46  double *B, int ldb)
47 {
49  QUARK_Insert_Task(quark, CORE_dgeadd_quark, task_flags,
50  sizeof(int), &m, VALUE,
51  sizeof(int), &n, VALUE,
52  sizeof(double), &alpha, VALUE,
53  sizeof(double)*nb*nb, A, INPUT,
54  sizeof(int), &lda, VALUE,
55  sizeof(double)*nb*nb, B, INOUT,
56  sizeof(int), &ldb, VALUE,
57  0);
58 }
59 
60 /***************************************************************************/
63 #if defined(PLASMA_HAVE_WEAK)
64 #pragma weak CORE_dgeadd_quark = PCORE_dgeadd_quark
65 #define CORE_dgeadd_quark PCORE_dgeadd_quark
66 #endif
68 {
69  int M;
70  int N;
71  double alpha;
72  double *A;
73  int LDA;
74  double *B;
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_daxpy(M*N, (alpha), A, 1, B, 1);
82  else {
83  for (j = 0; j < N; j++)
84  cblas_daxpy(M, (alpha), &A[j*LDA], 1, &B[j*LDB], 1);
85  }
86 }
87