YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
yac_lapack_interface.h
Go to the documentation of this file.
1// Copyright (c) 2024 The YAC Authors
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
5#ifndef YAC_LAPACK_INTERFACE_H
6#define YAC_LAPACK_INTERFACE_H
7
8#ifdef HAVE_CONFIG_H
9#include "config.h"
10#endif
11
12#ifndef YAC_LAPACK_INTERFACE_ID
13#error None of the supported LAPACK interfaces is available
14#endif
15
16#if YAC_LAPACK_INTERFACE_ID == 1 // Intel MKL LAPACKE
17
18#include <mkl_lapacke.h>
19
20#elif YAC_LAPACK_INTERFACE_ID == 2 // Netlib LAPACKE
21
22#include <lapacke.h>
23
24#elif YAC_LAPACK_INTERFACE_ID == 3 // ATLAS CLAPACK
25
26#include <clapack.h>
27
28#ifndef ATL_INT
29#define ATL_INT int
30#endif
31
32#ifndef lapack_int
33#define lapack_int ATL_INT
34#endif
35
36#define LAPACK_COL_MAJOR CblasColMajor
37
38#if 0
39lapack_int LAPACKE_dgels_work( int matrix_layout, char trans, lapack_int m,
40 lapack_int n, lapack_int nrhs, double* a,
41 lapack_int lda, double* b, lapack_int ldb,
42 double* work, lapack_int lwork );
43#endif
44
45lapack_int LAPACKE_dgesv( int matrix_layout, lapack_int n, lapack_int nrhs,
46 double* a, lapack_int lda, lapack_int* ipiv,
47 double* b, lapack_int ldb );
48
49lapack_int LAPACKE_dgetrf( int matrix_layout, lapack_int m, lapack_int n,
50 double* a, lapack_int lda, lapack_int* ipiv );
51
52lapack_int LAPACKE_dgetri_work( int matrix_layout, lapack_int n, double* a,
53 lapack_int lda, const lapack_int* ipiv,
54 double* work, lapack_int lwork );
55
56#define YAC_LAPACK_NO_DSYTR
57#define YAC_LAPACK_C_INDEXING
58
59#elif YAC_LAPACK_INTERFACE_ID == 4 // Netlib CLAPACK
60
61#include <f2c.h>
62
63#ifndef lapack_int
64#define lapack_int integer
65#endif
66
67#define LAPACK_COL_MAJOR 102
68
69#if 0
70lapack_int LAPACKE_dgels_work( int matrix_layout, char trans, lapack_int m,
71 lapack_int n, lapack_int nrhs, double* a,
72 lapack_int lda, double* b, lapack_int ldb,
73 double* work, lapack_int lwork );
74#endif
75
76lapack_int LAPACKE_dgesv( int matrix_layout, lapack_int n, lapack_int nrhs,
77 double* a, lapack_int lda, lapack_int* ipiv,
78 double* b, lapack_int ldb );
79
80lapack_int LAPACKE_dgetrf( int matrix_layout, lapack_int m, lapack_int n,
81 double* a, lapack_int lda, lapack_int* ipiv );
82
83lapack_int LAPACKE_dgetri_work( int matrix_layout, lapack_int n, double* a,
84 lapack_int lda, const lapack_int* ipiv,
85 double* work, lapack_int lwork );
86
87lapack_int LAPACKE_dsytrf_work( int matrix_layout, char uplo, lapack_int n,
88 double* a, lapack_int lda, lapack_int* ipiv,
89 double* work, lapack_int lwork );
90
91lapack_int LAPACKE_dsytri_work( int matrix_layout, char uplo, lapack_int n,
92 double* a, lapack_int lda,
93 const lapack_int* ipiv, double* work );
94
95#elif YAC_LAPACK_INTERFACE_ID == 5 // Fortran LAPACK
96
97#ifndef lapack_int
98#define lapack_int int
99#endif
100
101#define LAPACK_COL_MAJOR 102
102
103#if 0
104lapack_int LAPACKE_dgels_work( int matrix_layout, char trans, lapack_int m,
105 lapack_int n, lapack_int nrhs, double* a,
106 lapack_int lda, double* b, lapack_int ldb,
107 double* work, lapack_int lwork );
108#endif
109
110lapack_int LAPACKE_dgesv( int matrix_layout, lapack_int n, lapack_int nrhs,
111 double* a, lapack_int lda, lapack_int* ipiv,
112 double* b, lapack_int ldb );
113
114lapack_int LAPACKE_dgetrf( int matrix_layout, lapack_int m, lapack_int n,
115 double* a, lapack_int lda, lapack_int* ipiv );
116
117lapack_int LAPACKE_dgetri_work( int matrix_layout, lapack_int n, double* a,
118 lapack_int lda, const lapack_int* ipiv,
119 double* work, lapack_int lwork );
120
121lapack_int LAPACKE_dsytrf_work( int matrix_layout, char uplo, lapack_int n,
122 double* a, lapack_int lda, lapack_int* ipiv,
123 double* work, lapack_int lwork );
124
125lapack_int LAPACKE_dsytri_work( int matrix_layout, char uplo, lapack_int n,
126 double* a, lapack_int lda,
127 const lapack_int* ipiv, double* work );
128
129#else
130
131#error Unexpected value for YAC_LAPACK_INTERFACE_ID
132
133#endif
134
135#endif // YAC_LAPACK_INTERFACE_H
136