From f031b11ddb8b74b82983b634fc910926ffc58600 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 1 Sep 2020 12:41:09 +0100 Subject: [Minor] Use cblas_saxpy where possible --- contrib/kann/kautodiff.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'contrib/kann/kautodiff.c') diff --git a/contrib/kann/kautodiff.c b/contrib/kann/kautodiff.c index a8af6796b..f336c958b 100644 --- a/contrib/kann/kautodiff.c +++ b/contrib/kann/kautodiff.c @@ -897,8 +897,6 @@ void kad_vec_mul_sum(int n, float *a, const float *b, const float *c) for (i = 0; i < n; ++i) a[i] += b[i] * c[i]; } -void kad_saxpy(int n, float a, const float *x, float *y) { kad_saxpy_inlined(n, a, x, y); } - /* This is actually lapack not cblas, but this definition is used */ #ifdef HAVE_CBLAS #ifndef __APPLE__ @@ -958,6 +956,17 @@ void kad_sgemm_simple(int trans_A, int trans_B, int M, int N, int K, const float } #endif +#ifdef HAVE_CBLAS_SAXPY +#ifndef HAVE_CBLAS_H +extern void cblas_saxpy(const int __N, + const float __alpha, const float *__X, const int __incX, float *__Y, const int __incY); +#endif + +void kad_saxpy(int n, float a, const float *x, float *y) { cblas_saxpy(n, a, x, 1, y, 1); } +#else +void kad_saxpy(int n, float a, const float *x, float *y) { kad_saxpy_inlined(n, a, x, y); } +#endif + bool kad_ssyev_simple(int N, float *A, float *eigenvals) { #ifndef HAVE_CBLAS -- cgit v1.2.3