|
1 | | -/***************************************************************************** |
2 | | - Copyright (c) 2010, Intel Corp. |
3 | | - All rights reserved. |
4 | | -
|
5 | | - Redistribution and use in source and binary forms, with or without |
6 | | - modification, are permitted provided that the following conditions are met: |
7 | | -
|
8 | | - * Redistributions of source code must retain the above copyright notice, |
9 | | - this list of conditions and the following disclaimer. |
10 | | - * Redistributions in binary form must reproduce the above copyright |
11 | | - notice, this list of conditions and the following disclaimer in the |
12 | | - documentation and/or other materials provided with the distribution. |
13 | | - * Neither the name of Intel Corporation nor the names of its contributors |
14 | | - may be used to endorse or promote products derived from this software |
15 | | - without specific prior written permission. |
16 | | -
|
17 | | - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
18 | | - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 | | - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
20 | | - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
21 | | - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
22 | | - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 | | - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
24 | | - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
25 | | - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
26 | | - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
27 | | - THE POSSIBILITY OF SUCH DAMAGE. |
28 | | -****************************************************************************** |
29 | | -* Contents: Native C interface to LAPACK |
30 | | -* Author: Intel Corporation |
31 | | -*****************************************************************************/ |
32 | | - |
33 | | -#ifndef _LAPACKE_CONFIG_H_ |
34 | | -#define _LAPACKE_CONFIG_H_ |
35 | | - |
36 | | -#ifdef __cplusplus |
37 | | -#if defined(LAPACK_COMPLEX_CPP) |
38 | | -#include <complex> |
39 | | -#endif |
40 | | -extern "C" { |
41 | | -#endif /* __cplusplus */ |
42 | | - |
43 | | -#include <stdlib.h> |
44 | | -#include <stdint.h> |
45 | | -#include <inttypes.h> |
46 | | - |
47 | | -#ifndef lapack_int |
48 | | -#if defined(LAPACK_ILP64) |
49 | | -#define lapack_int int64_t |
50 | | -#else |
51 | | -#define lapack_int int32_t |
52 | | -#endif |
53 | | -#endif |
54 | | - |
55 | | -/* |
56 | | - * Integer format string |
57 | | - */ |
58 | | -#ifndef LAPACK_IFMT |
59 | | -#if defined(LAPACK_ILP64) |
60 | | -#define LAPACK_IFMT PRId64 |
61 | | -#else |
62 | | -#define LAPACK_IFMT PRId32 |
63 | | -#endif |
64 | | -#endif |
65 | | - |
66 | | -#ifndef lapack_logical |
67 | | -#define lapack_logical lapack_int |
68 | | -#endif |
69 | | - |
70 | | -#ifndef LAPACK_COMPLEX_CUSTOM |
71 | | -#if defined(_MSC_VER) |
72 | | - #define _CRT_USE_C_COMPLEX_H |
73 | | - #include <complex.h> |
74 | | - #define LAPACK_COMPLEX_CUSTOM |
75 | | - #define lapack_complex_float _Fcomplex |
76 | | - #define lapack_complex_double _Dcomplex |
77 | | - #define lapack_complex_float_real(z) (creal(z)) |
78 | | - #define lapack_complex_float_imag(z) (cimag(z)) |
79 | | - #define lapack_complex_double_real(z) (creal(z)) |
80 | | - #define lapack_complex_double_imag(z) (cimag(z)) |
81 | | -#else |
82 | | - |
83 | | -#if defined(LAPACK_COMPLEX_STRUCTURE) |
84 | | - |
85 | | -typedef struct { float real, imag; } _lapack_complex_float; |
86 | | -typedef struct { double real, imag; } _lapack_complex_double; |
87 | | -#define lapack_complex_float _lapack_complex_float |
88 | | -#define lapack_complex_double _lapack_complex_double |
89 | | -#define lapack_complex_float_real(z) ((z).real) |
90 | | -#define lapack_complex_float_imag(z) ((z).imag) |
91 | | -#define lapack_complex_double_real(z) ((z).real) |
92 | | -#define lapack_complex_double_imag(z) ((z).imag) |
93 | | - |
94 | | -#elif defined(LAPACK_COMPLEX_C99) |
95 | | - |
96 | | -#include <complex.h> |
97 | | -#define lapack_complex_float float _Complex |
98 | | -#define lapack_complex_double double _Complex |
99 | | -#define lapack_complex_float_real(z) (creal(z)) |
100 | | -#define lapack_complex_float_imag(z) (cimag(z)) |
101 | | -#define lapack_complex_double_real(z) (creal(z)) |
102 | | -#define lapack_complex_double_imag(z) (cimag(z)) |
103 | | - |
104 | | -#elif defined(LAPACK_COMPLEX_CPP) |
105 | | - |
106 | | -#define lapack_complex_float std::complex<float> |
107 | | -#define lapack_complex_double std::complex<double> |
108 | | -#define lapack_complex_float_real(z) ((z).real()) |
109 | | -#define lapack_complex_float_imag(z) ((z).imag()) |
110 | | -#define lapack_complex_double_real(z) ((z).real()) |
111 | | -#define lapack_complex_double_imag(z) ((z).imag()) |
112 | | - |
113 | | -#else |
114 | | - |
115 | | -#include <complex.h> |
116 | | -#define lapack_complex_float float _Complex |
117 | | -#define lapack_complex_double double _Complex |
118 | | -#define lapack_complex_float_real(z) (creal(z)) |
119 | | -#define lapack_complex_float_imag(z) (cimag(z)) |
120 | | -#define lapack_complex_double_real(z) (creal(z)) |
121 | | -#define lapack_complex_double_imag(z) (cimag(z)) |
122 | | - |
123 | | -#endif |
124 | | -#endif |
125 | | - |
126 | | -lapack_complex_float lapack_make_complex_float( float re, float im ); |
127 | | -lapack_complex_double lapack_make_complex_double( double re, double im ); |
128 | | - |
129 | | -#endif |
130 | | - |
131 | | -#ifndef LAPACK_malloc |
132 | | -#define LAPACK_malloc( size ) malloc( size ) |
133 | | -#endif |
134 | | - |
135 | | -#ifndef LAPACK_free |
136 | | -#define LAPACK_free( p ) free( p ) |
137 | | -#endif |
138 | | - |
139 | | -#ifdef __cplusplus |
140 | | -} |
141 | | -#endif /* __cplusplus */ |
142 | | - |
143 | | -#endif /* _LAPACKE_CONFIG_H_ */ |
| 1 | +/***************************************************************************** |
| 2 | + Copyright (c) 2010, Intel Corp. |
| 3 | + All rights reserved. |
| 4 | +
|
| 5 | + Redistribution and use in source and binary forms, with or without |
| 6 | + modification, are permitted provided that the following conditions are met: |
| 7 | +
|
| 8 | + * Redistributions of source code must retain the above copyright notice, |
| 9 | + this list of conditions and the following disclaimer. |
| 10 | + * Redistributions in binary form must reproduce the above copyright |
| 11 | + notice, this list of conditions and the following disclaimer in the |
| 12 | + documentation and/or other materials provided with the distribution. |
| 13 | + * Neither the name of Intel Corporation nor the names of its contributors |
| 14 | + may be used to endorse or promote products derived from this software |
| 15 | + without specific prior written permission. |
| 16 | +
|
| 17 | + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 20 | + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 21 | + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 22 | + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 23 | + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 24 | + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 25 | + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 26 | + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 27 | + THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | +****************************************************************************** |
| 29 | +* Contents: Native C interface to LAPACK |
| 30 | +* Author: Intel Corporation |
| 31 | +*****************************************************************************/ |
| 32 | + |
| 33 | +#ifndef _LAPACKE_CONFIG_H_ |
| 34 | +#define _LAPACKE_CONFIG_H_ |
| 35 | + |
| 36 | +#ifdef __cplusplus |
| 37 | +#if defined(LAPACK_COMPLEX_CPP) |
| 38 | +#include <complex> |
| 39 | +#endif |
| 40 | +extern "C" { |
| 41 | +#endif /* __cplusplus */ |
| 42 | + |
| 43 | +#include <stdlib.h> |
| 44 | +#include <stdint.h> |
| 45 | +#include <inttypes.h> |
| 46 | + |
| 47 | +#ifndef lapack_int |
| 48 | +#if defined(LAPACK_ILP64) |
| 49 | +#define lapack_int int64_t |
| 50 | +#else |
| 51 | +#define lapack_int int32_t |
| 52 | +#endif |
| 53 | +#endif |
| 54 | + |
| 55 | +/* |
| 56 | + * Integer format string |
| 57 | + */ |
| 58 | +#ifndef LAPACK_IFMT |
| 59 | +#if defined(LAPACK_ILP64) |
| 60 | +#define LAPACK_IFMT PRId64 |
| 61 | +#else |
| 62 | +#define LAPACK_IFMT PRId32 |
| 63 | +#endif |
| 64 | +#endif |
| 65 | + |
| 66 | +#ifndef lapack_logical |
| 67 | +#define lapack_logical lapack_int |
| 68 | +#endif |
| 69 | + |
| 70 | +#if defined(_MSC_VER) && defined(__INTEL_CLANG_COMPILER) |
| 71 | +#define LAPACK_COMPLEX_STRUCTURE |
| 72 | +#endif |
| 73 | + |
| 74 | +#ifndef LAPACK_COMPLEX_CUSTOM |
| 75 | +#if defined(_MSC_VER) && !defined(__INTEL_CLANG_COMPILER) |
| 76 | + #define _CRT_USE_C_COMPLEX_H |
| 77 | + #include <complex.h> |
| 78 | + #define LAPACK_COMPLEX_CUSTOM |
| 79 | + #define lapack_complex_float _Fcomplex |
| 80 | + #define lapack_complex_double _Dcomplex |
| 81 | + #define lapack_complex_float_real(z) (creal(z)) |
| 82 | + #define lapack_complex_float_imag(z) (cimag(z)) |
| 83 | + #define lapack_complex_double_real(z) (creal(z)) |
| 84 | + #define lapack_complex_double_imag(z) (cimag(z)) |
| 85 | +#else |
| 86 | + |
| 87 | +#if defined(LAPACK_COMPLEX_STRUCTURE) |
| 88 | + |
| 89 | +typedef struct { float real, imag; } _lapack_complex_float; |
| 90 | +typedef struct { double real, imag; } _lapack_complex_double; |
| 91 | +#define lapack_complex_float _lapack_complex_float |
| 92 | +#define lapack_complex_double _lapack_complex_double |
| 93 | +#define lapack_complex_float_real(z) ((z).real) |
| 94 | +#define lapack_complex_float_imag(z) ((z).imag) |
| 95 | +#define lapack_complex_double_real(z) ((z).real) |
| 96 | +#define lapack_complex_double_imag(z) ((z).imag) |
| 97 | + |
| 98 | +#elif defined(LAPACK_COMPLEX_C99) |
| 99 | + |
| 100 | +#include <complex.h> |
| 101 | +#define lapack_complex_float float _Complex |
| 102 | +#define lapack_complex_double double _Complex |
| 103 | +#define lapack_complex_float_real(z) (creal(z)) |
| 104 | +#define lapack_complex_float_imag(z) (cimag(z)) |
| 105 | +#define lapack_complex_double_real(z) (creal(z)) |
| 106 | +#define lapack_complex_double_imag(z) (cimag(z)) |
| 107 | + |
| 108 | +#elif defined(LAPACK_COMPLEX_CPP) |
| 109 | + |
| 110 | +#define lapack_complex_float std::complex<float> |
| 111 | +#define lapack_complex_double std::complex<double> |
| 112 | +#define lapack_complex_float_real(z) ((z).real()) |
| 113 | +#define lapack_complex_float_imag(z) ((z).imag()) |
| 114 | +#define lapack_complex_double_real(z) ((z).real()) |
| 115 | +#define lapack_complex_double_imag(z) ((z).imag()) |
| 116 | + |
| 117 | +#else |
| 118 | + |
| 119 | +#include <complex.h> |
| 120 | +#define lapack_complex_float float _Complex |
| 121 | +#define lapack_complex_double double _Complex |
| 122 | +#define lapack_complex_float_real(z) (creal(z)) |
| 123 | +#define lapack_complex_float_imag(z) (cimag(z)) |
| 124 | +#define lapack_complex_double_real(z) (creal(z)) |
| 125 | +#define lapack_complex_double_imag(z) (cimag(z)) |
| 126 | + |
| 127 | +#endif |
| 128 | +#endif |
| 129 | + |
| 130 | +lapack_complex_float lapack_make_complex_float( float re, float im ); |
| 131 | +lapack_complex_double lapack_make_complex_double( double re, double im ); |
| 132 | + |
| 133 | +#endif |
| 134 | + |
| 135 | +#ifndef LAPACK_malloc |
| 136 | +#define LAPACK_malloc( size ) malloc( size ) |
| 137 | +#endif |
| 138 | + |
| 139 | +#ifndef LAPACK_free |
| 140 | +#define LAPACK_free( p ) free( p ) |
| 141 | +#endif |
| 142 | + |
| 143 | +#ifdef __cplusplus |
| 144 | +} |
| 145 | +#endif /* __cplusplus */ |
| 146 | + |
| 147 | +#endif /* _LAPACKE_CONFIG_H_ */ |
0 commit comments