Debian Codegraph @

include/deal.II/lac/blas_extension_templates.h

raw
1 // ------------------------------------------------------------------------
2 //
3 // SPDX-License-Identifier: LGPL-2.1-or-later
4 // Copyright (C) 2018 - 2024 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // Part of the source code is dual licensed under Apache-2.0 WITH
9 // LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10 // governing the source code and code contributions can be found in
11 // LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12 //
13 // ------------------------------------------------------------------------
14
15
16 #ifndef dealii_blas_extension_templates_h
17 #define dealii_blas_extension_templates_h
18
19 #include <deal.II/base/config.h>
20
21 #include <deal.II/lac/lapack_support.h>
22
23 #ifdef DEAL_II_HAVE_FP_EXCEPTIONS
24 # include <cfenv>
25 #endif
26
27 // Intel-MKL specific functions
28 #ifdef DEAL_II_LAPACK_WITH_MKL
29 // see
30 // https://software.intel.com/en-us/mkl-windows-developer-guide-using-complex-types-in-c-c
31 # define MKL_Complex8 std::complex<float>
32 # define MKL_Complex16 std::complex<double>
33 # include <mkl_trans.h>
34 #endif
35
36
37 DEAL_II_NAMESPACE_OPEN
38
39
40 template <typename number1, typename number2, typename number3>
41 inline void
42 omatcopy(char,
43 char,
44 dealii::types::blas_int,
45 dealii::types::blas_int,
46 const number1,
47 const number2 *,
48 dealii::types::blas_int,
49 number3 *,
50 dealii::types::blas_int)
51 {
52 DEAL_II_NOT_IMPLEMENTED();
53 }
54
55
56
57 inline void
58 omatcopy(char ordering,
59 char trans,
60 dealii::types::blas_int rows,
61 dealii::types::blas_int cols,
62 const float alpha,
63 const float *A,
64 dealii::types::blas_int lda,
65 float *B,
66 dealii::types::blas_int ldb)
67 {
68 #ifdef DEAL_II_LAPACK_WITH_MKL
69 mkl_somatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
70 #else
71 (void)ordering;
72 (void)trans;
73 (void)rows;
74 (void)cols;
75 (void)alpha;
76 (void)A;
77 (void)lda;
78 (void)B;
79 (void)ldb;
80 Assert(false, LAPACKSupport::ExcMissing("mkl_somatcopy"));
81 #endif // DEAL_II_LAPACK_WITH_MKL
82 }
83
84
85
86 inline void
87 omatcopy(char ordering,
88 char trans,
89 dealii::types::blas_int rows,
90 dealii::types::blas_int cols,
91 const double alpha,
92 const double *A,
93 dealii::types::blas_int lda,
94 double *B,
95 dealii::types::blas_int ldb)
96 {
97 #ifdef DEAL_II_LAPACK_WITH_MKL
98 mkl_domatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
99 #else
100 (void)ordering;
101 (void)trans;
102 (void)rows;
103 (void)cols;
104 (void)alpha;
105 (void)A;
106 (void)lda;
107 (void)B;
108 (void)ldb;
109 Assert(false, LAPACKSupport::ExcMissing("mkl_domatcopy"));
110 #endif // DEAL_II_LAPACK_WITH_MKL
111 }
112
113
114
115 inline void
116 omatcopy(char ordering,
117 char trans,
118 dealii::types::blas_int rows,
119 dealii::types::blas_int cols,
120 const std::complex<float> alpha,
121 const std::complex<float> *A,
122 dealii::types::blas_int lda,
123 std::complex<float> *B,
124 dealii::types::blas_int ldb)
125 {
126 #ifdef DEAL_II_LAPACK_WITH_MKL
127 mkl_comatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
128 #else
129 (void)ordering;
130 (void)trans;
131 (void)rows;
132 (void)cols;
133 (void)alpha;
134 (void)A;
135 (void)lda;
136 (void)B;
137 (void)ldb;
138 Assert(false, LAPACKSupport::ExcMissing("mkl_comatcopy"));
139 #endif // DEAL_II_LAPACK_WITH_MKL
140 }
141
142
143
144 inline void
145 omatcopy(char ordering,
146 char trans,
147 dealii::types::blas_int rows,
148 dealii::types::blas_int cols,
149 const std::complex<double> alpha,
150 const std::complex<double> *A,
151 dealii::types::blas_int lda,
152 std::complex<double> *B,
153 dealii::types::blas_int ldb)
154 {
155 #ifdef DEAL_II_LAPACK_WITH_MKL
156 mkl_zomatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
157 #else
158 (void)ordering;
159 (void)trans;
160 (void)rows;
161 (void)cols;
162 (void)alpha;
163 (void)A;
164 (void)lda;
165 (void)B;
166 (void)ldb;
167 Assert(false, LAPACKSupport::ExcMissing("mkl_zomatcopy"));
168 #endif // DEAL_II_LAPACK_WITH_MKL
169 }
170
171 DEAL_II_NAMESPACE_CLOSE
172
173 #endif