You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

openblas_config_template.h 3.0 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*This is only for "make install" target.*/
  2. #ifdef NEEDBUNDERSCORE
  3. #define BLASFUNC(FUNC) FUNC##_
  4. #else
  5. #define BLASFUNC(FUNC) FUNC
  6. #endif
  7. #ifdef QUAD_PRECISION
  8. typedef struct {
  9. unsigned long x[2];
  10. } xdouble;
  11. #elif defined EXPRECISION
  12. #define xdouble long double
  13. #else
  14. #define xdouble double
  15. #endif
  16. #if defined(OS_WINDOWS) && defined(__64BIT__)
  17. typedef long long BLASLONG;
  18. typedef unsigned long long BLASULONG;
  19. #else
  20. typedef long BLASLONG;
  21. typedef unsigned long BLASULONG;
  22. #endif
  23. #ifdef USE64BITINT
  24. typedef BLASLONG blasint;
  25. #else
  26. typedef int blasint;
  27. #endif
  28. #if defined(XDOUBLE) || defined(DOUBLE)
  29. #define FLOATRET FLOAT
  30. #else
  31. #ifdef NEED_F2CCONV
  32. #define FLOATRET double
  33. #else
  34. #define FLOATRET float
  35. #endif
  36. #endif
  37. /* Inclusion of a standard header file is needed for definition of __STDC_*
  38. predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs
  39. as a side effect of including either <features.h> or <stdc-predef.h>. */
  40. #include <stdio.h>
  41. /* C99 supports complex floating numbers natively, which GCC also offers as an
  42. extension since version 3.0. If neither are available, use a compatible
  43. structure as fallback (see Clause 6.2.5.13 of the C99 standard). */
  44. #if defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || __GNUC__ >= 3
  45. #define OPENBLAS_COMPLEX_C99
  46. #include <complex.h>
  47. typedef float _Complex openblas_complex_float;
  48. typedef double _Complex openblas_complex_double;
  49. typedef xdouble _Complex openblas_complex_xdouble;
  50. #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I))
  51. #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I))
  52. #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I))
  53. #define openblas_complex_float_real(z) (creal(z))
  54. #define openblas_complex_float_imag(z) (cimag(z))
  55. #define openblas_complex_double_real(z) (creal(z))
  56. #define openblas_complex_double_imag(z) (cimag(z))
  57. #define openblas_complex_xdouble_real(z) (creal(z))
  58. #define openblas_complex_xdouble_imag(z) (cimag(z))
  59. #else
  60. #define OPENBLAS_COMPLEX_STRUCT
  61. typedef struct { float real, imag; } openblas_complex_float;
  62. typedef struct { double real, imag; } openblas_complex_double;
  63. typedef struct { xdouble real, imag; } openblas_complex_xdouble;
  64. #define openblas_make_complex_float(real, imag) {(real), (imag)}
  65. #define openblas_make_complex_double(real, imag) {(real), (imag)}
  66. #define openblas_make_complex_xdouble(real, imag) {(real), (imag)}
  67. #define openblas_complex_float_real(z) ((z).real)
  68. #define openblas_complex_float_imag(z) ((z).imag)
  69. #define openblas_complex_double_real(z) ((z).real)
  70. #define openblas_complex_double_imag(z) ((z).imag)
  71. #define openblas_complex_xdouble_real(z) ((z).real)
  72. #define openblas_complex_xdouble_imag(z) ((z).imag)
  73. #endif