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.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*This is only for "make install" target.*/
  2. #if defined(OPENBLAS_OS_WINNT) || defined(OPENBLAS_OS_CYGWIN_NT) || defined(OPENBLAS_OS_INTERIX)
  3. #define OPENBLAS_WINDOWS_ABI
  4. #define OPENBLAS_OS_WINDOWS
  5. #ifdef DOUBLE
  6. #define DOUBLE_DEFINED DOUBLE
  7. #undef DOUBLE
  8. #endif
  9. #endif
  10. #ifdef OPENBLAS_NEEDBUNDERSCORE
  11. #define BLASFUNC(FUNC) FUNC##_
  12. #else
  13. #define BLASFUNC(FUNC) FUNC
  14. #endif
  15. #ifdef OPENBLAS_QUAD_PRECISION
  16. typedef struct {
  17. unsigned long x[2];
  18. } xdouble;
  19. #elif defined OPENBLAS_EXPRECISION
  20. #define xdouble long double
  21. #else
  22. #define xdouble double
  23. #endif
  24. #if defined(OPENBLAS_OS_WINDOWS) && defined(OPENBLAS___64BIT__)
  25. typedef long long BLASLONG;
  26. typedef unsigned long long BLASULONG;
  27. #else
  28. typedef long BLASLONG;
  29. typedef unsigned long BLASULONG;
  30. #endif
  31. #ifndef BFLOAT16
  32. #include <stdint.h>
  33. typedef uint16_t bfloat16;
  34. #endif
  35. #ifdef OPENBLAS_USE64BITINT
  36. typedef BLASLONG blasint;
  37. #else
  38. typedef int blasint;
  39. #endif
  40. #if defined(XDOUBLE) || defined(DOUBLE)
  41. #define FLOATRET FLOAT
  42. #else
  43. #ifdef NEED_F2CCONV
  44. #define FLOATRET double
  45. #else
  46. #define FLOATRET float
  47. #endif
  48. #endif
  49. /* Inclusion of a standard header file is needed for definition of __STDC_*
  50. predefined macros with some compilers (e.g. GCC 4.7 on Linux). This occurs
  51. as a side effect of including either <features.h> or <stdc-predef.h>. */
  52. #include <stdio.h>
  53. /* C99 supports complex floating numbers natively, which GCC also offers as an
  54. extension since version 3.0. If neither are available, use a compatible
  55. structure as fallback (see Clause 6.2.5.13 of the C99 standard). */
  56. #if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \
  57. (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER)
  58. #define OPENBLAS_COMPLEX_C99
  59. #ifndef __cplusplus
  60. #include <complex.h>
  61. #endif
  62. typedef float _Complex openblas_complex_float;
  63. typedef double _Complex openblas_complex_double;
  64. typedef xdouble _Complex openblas_complex_xdouble;
  65. #define openblas_make_complex_float(real, imag) ((real) + ((imag) * _Complex_I))
  66. #define openblas_make_complex_double(real, imag) ((real) + ((imag) * _Complex_I))
  67. #define openblas_make_complex_xdouble(real, imag) ((real) + ((imag) * _Complex_I))
  68. #define openblas_complex_float_real(z) (creal(z))
  69. #define openblas_complex_float_imag(z) (cimag(z))
  70. #define openblas_complex_double_real(z) (creal(z))
  71. #define openblas_complex_double_imag(z) (cimag(z))
  72. #define openblas_complex_xdouble_real(z) (creal(z))
  73. #define openblas_complex_xdouble_imag(z) (cimag(z))
  74. #else
  75. #define OPENBLAS_COMPLEX_STRUCT
  76. typedef struct { float real, imag; } openblas_complex_float;
  77. typedef struct { double real, imag; } openblas_complex_double;
  78. typedef struct { xdouble real, imag; } openblas_complex_xdouble;
  79. #define openblas_make_complex_float(real, imag) {(real), (imag)}
  80. #define openblas_make_complex_double(real, imag) {(real), (imag)}
  81. #define openblas_make_complex_xdouble(real, imag) {(real), (imag)}
  82. #define openblas_complex_float_real(z) ((z).real)
  83. #define openblas_complex_float_imag(z) ((z).imag)
  84. #define openblas_complex_double_real(z) ((z).real)
  85. #define openblas_complex_double_imag(z) ((z).imag)
  86. #define openblas_complex_xdouble_real(z) ((z).real)
  87. #define openblas_complex_xdouble_imag(z) ((z).imag)
  88. #endif
  89. /* Inclusion of Linux-specific header is needed for definition of cpu_set_t. */
  90. #ifdef OPENBLAS_OS_LINUX
  91. #ifndef _GNU_SOURCE
  92. #define _GNU_SOURCE
  93. #endif
  94. #include <sched.h>
  95. #endif