Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
alien_cblas.h
1
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6#pragma once
7
8#ifdef ALIEN_USE_MKL
9#include "mkl_cblas.h"
10#elif ALIEN_USE_FLEXIBLAS
11#include "flexiblas/cblas.h"
12#else
13#include "cblas.h"
14#endif
15
16namespace cblas
17{
18
19inline float dot(const int n, const float* x, const int incx, const float* y,
20 const int incy)
21{
22 return cblas_sdot(n, x, incx, y, incy);
23}
24
25inline double dot(const int n, const double* x, const int incx, const double* y, const int incy)
26{
27 return cblas_ddot(n, x, incx, y, incy);
28}
29
30inline void axpy(const int n, const float alpha, const float* x, const int incx, float* y, const int incy)
31{
32 return cblas_saxpy(n, alpha, x, incx, y, incy);
33}
34
35inline void axpy(const int n, const double alpha, const double* x, const int incx, double* y, const int incy)
36{
37 return cblas_daxpy(n, alpha, x, incx, y, incy);
38}
39
40inline void copy(const int n, const float* x, const int incx, float* y, const int incy)
41{
42 return cblas_scopy(n, x, incx, y, incy);
43}
44
45inline void copy(const int n, const double* x, const int incx, double* y, const int incy)
46{
47 return cblas_dcopy(n, x, incx, y, incy);
48}
49
50inline void scal(const int n, const float alpha, float* x, const int incx)
51{
52 return cblas_sscal(n, alpha, x, incx);
53}
54
55inline void scal(const int n, const double alpha, double* x, const int incx)
56{
57 return cblas_dscal(n, alpha, x, incx);
58}
59
60inline double nrm1(const int n, const double* x, const int incx)
61{
62 return cblas_dasum(n, x, incx);
63}
64
65inline double nrm2(const int n, const double* x, const int incx)
66{
67 return cblas_dnrm2(n, x, incx);
68}
69
70} // namespace cblas
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition alien_cblas.h:17