blas.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2009-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef __BLAS_H__
  17. #define __BLAS_H__
  18. #include <stdint.h>
  19. #define BLASINT int64_t
  20. void STARPU_SGEMM(char *transa, char *transb, BLASINT M, BLASINT N, BLASINT K, float alpha, const float *A, BLASINT lda,
  21. const float *B, BLASINT ldb, float beta, float *C, BLASINT ldc);
  22. void STARPU_DGEMM(char *transa, char *transb, BLASINT M, BLASINT N, BLASINT K, double alpha, double *A, BLASINT lda,
  23. double *B, BLASINT ldb, double beta, double *C, BLASINT ldc);
  24. void STARPU_SGEMV(char *transa, BLASINT M, BLASINT N, float alpha, float *A, BLASINT lda,
  25. float *X, BLASINT incX, float beta, float *Y, BLASINT incY);
  26. void STARPU_DGEMV(char *transa, BLASINT M, BLASINT N, double alpha, double *A, BLASINT lda,
  27. double *X, BLASINT incX, double beta, double *Y, BLASINT incY);
  28. float STARPU_SASUM(BLASINT N, float *X, BLASINT incX);
  29. double STARPU_DASUM(BLASINT N, double *X, BLASINT incX);
  30. void STARPU_SSCAL(BLASINT N, float alpha, float *X, BLASINT incX);
  31. void STARPU_DSCAL(BLASINT N, double alpha, double *X, BLASINT incX);
  32. void STARPU_STRSM (const char *side, const char *uplo, const char *transa,
  33. const char *diag, const BLASINT m, const BLASINT n,
  34. const float alpha, const float *A, const BLASINT lda,
  35. float *B, const BLASINT ldb);
  36. void STARPU_DTRSM (const char *side, const char *uplo, const char *transa,
  37. const char *diag, const BLASINT m, const BLASINT n,
  38. const double alpha, const double *A, const BLASINT lda,
  39. double *B, const BLASINT ldb);
  40. void STARPU_SSYR (const char *uplo, const BLASINT n, const float alpha,
  41. const float *x, const BLASINT incx, float *A, const BLASINT lda);
  42. void STARPU_SSYRK (const char *uplo, const char *trans, const BLASINT n,
  43. const BLASINT k, const float alpha, const float *A,
  44. const BLASINT lda, const float beta, float *C,
  45. const BLASINT ldc);
  46. void STARPU_SGER (const BLASINT m, const BLASINT n, const float alpha,
  47. const float *x, const BLASINT incx, const float *y,
  48. const BLASINT incy, float *A, const BLASINT lda);
  49. void STARPU_DGER(const BLASINT m, const BLASINT n, const double alpha,
  50. const double *x, const BLASINT incx, const double *y,
  51. const BLASINT incy, double *A, const BLASINT lda);
  52. void STARPU_STRSV (const char *uplo, const char *trans, const char *diag,
  53. const BLASINT n, const float *A, const BLASINT lda, float *x,
  54. const BLASINT incx);
  55. void STARPU_STRMM(const char *side, const char *uplo, const char *transA,
  56. const char *diag, const BLASINT m, const BLASINT n,
  57. const float alpha, const float *A, const BLASINT lda,
  58. float *B, const BLASINT ldb);
  59. void STARPU_DTRMM(const char *side, const char *uplo, const char *transA,
  60. const char *diag, const BLASINT m, const BLASINT n,
  61. const double alpha, const double *A, const BLASINT lda,
  62. double *B, const BLASINT ldb);
  63. void STARPU_STRMV(const char *uplo, const char *transA, const char *diag,
  64. const BLASINT n, const float *A, const BLASINT lda, float *X,
  65. const BLASINT incX);
  66. void STARPU_SAXPY(const BLASINT n, const float alpha, float *X, const BLASINT incX, float *Y, const BLASINT incy);
  67. void STARPU_DAXPY(const BLASINT n, const double alpha, double *X, const BLASINT incX, double *Y, const BLASINT incY);
  68. BLASINT STARPU_ISAMAX (const BLASINT n, float *X, const BLASINT incX);
  69. BLASINT STARPU_IDAMAX (const BLASINT n, double *X, const BLASINT incX);
  70. float STARPU_SDOT(const BLASINT n, const float *x, const BLASINT incx, const float *y, const BLASINT incy);
  71. double STARPU_DDOT(const BLASINT n, const double *x, const BLASINT incx, const double *y, const BLASINT incy);
  72. void STARPU_SSWAP(const BLASINT n, float *x, const BLASINT incx, float *y, const BLASINT incy);
  73. void STARPU_DSWAP(const BLASINT n, double *x, const BLASINT incx, double *y, const BLASINT incy);
  74. extern void sgemm_64_ (const char *transa, const char *transb, const BLASINT *m,
  75. const BLASINT *n, const BLASINT *k, const float *alpha,
  76. const float *A, const BLASINT *lda, const float *B,
  77. const BLASINT *ldb, const float *beta, float *C,
  78. const BLASINT *ldc);
  79. extern void dgemm_64_ (const char *transa, const char *transb, const BLASINT *m,
  80. const BLASINT *n, const BLASINT *k, const double *alpha,
  81. const double *A, const BLASINT *lda, const double *B,
  82. const BLASINT *ldb, const double *beta, double *C,
  83. const BLASINT *ldc);
  84. extern void sgemv_64_(const char *trans, const BLASINT *m, const BLASINT *n, const float *alpha,
  85. const float *a, const BLASINT *lda, const float *x, const BLASINT *incx,
  86. const float *beta, float *y, const BLASINT *incy);
  87. extern void dgemv_64_(const char *trans, const BLASINT *m, const BLASINT *n, const double *alpha,
  88. const double *a, const BLASINT *lda, const double *x, const BLASINT *incx,
  89. const double *beta, double *y, const BLASINT *incy);
  90. extern void ssyr_64_ (const char *uplo, const BLASINT *n, const float *alpha,
  91. const float *x, const BLASINT *incx, float *A, const BLASINT *lda);
  92. extern void ssyrk_64_ (const char *uplo, const char *trans, const BLASINT *n,
  93. const BLASINT *k, const float *alpha, const float *A,
  94. const BLASINT *lda, const float *beta, float *C,
  95. const BLASINT *ldc);
  96. extern void strsm_64_ (const char *side, const char *uplo, const char *transa,
  97. const char *diag, const BLASINT *m, const BLASINT *n,
  98. const float *alpha, const float *A, const BLASINT *lda,
  99. float *B, const BLASINT *ldb);
  100. extern void dtrsm_64_ (const char *side, const char *uplo, const char *transa,
  101. const char *diag, const BLASINT *m, const BLASINT *n,
  102. const double *alpha, const double *A, const BLASINT *lda,
  103. double *B, const BLASINT *ldb);
  104. extern double sasum_64_ (const BLASINT *n, const float *x, const BLASINT *incx);
  105. extern double dasum_64_ (const BLASINT *n, const double *x, const BLASINT *incx);
  106. extern void sscal_64_ (const BLASINT *n, const float *alpha, float *x,
  107. const BLASINT *incx);
  108. extern void dscal_64_ (const BLASINT *n, const double *alpha, double *x,
  109. const BLASINT *incx);
  110. extern void sger_64_(const BLASINT *m, const BLASINT *n, const float *alpha,
  111. const float *x, const BLASINT *incx, const float *y,
  112. const BLASINT *incy, float *A, const BLASINT *lda);
  113. extern void dger_64_(const BLASINT *m, const BLASINT *n, const double *alpha,
  114. const double *x, const BLASINT *incx, const double *y,
  115. const BLASINT *incy, double *A, const BLASINT *lda);
  116. extern void strsv_64_ (const char *uplo, const char *trans, const char *diag,
  117. const BLASINT *n, const float *A, const BLASINT *lda, float *x,
  118. const BLASINT *incx);
  119. extern void strmm_64_(const char *side, const char *uplo, const char *transA,
  120. const char *diag, const BLASINT *m, const BLASINT *n,
  121. const float *alpha, const float *A, const BLASINT *lda,
  122. float *B, const BLASINT *ldb);
  123. extern void dtrmm_64_(const char *side, const char *uplo, const char *transA,
  124. const char *diag, const BLASINT *m, const BLASINT *n,
  125. const double *alpha, const double *A, const BLASINT *lda,
  126. double *B, const BLASINT *ldb);
  127. extern void strmv_64_(const char *uplo, const char *transA, const char *diag,
  128. const BLASINT *n, const float *A, const BLASINT *lda, float *X,
  129. const BLASINT *incX);
  130. extern void saxpy_64_(const BLASINT *n, const float *alpha, const float *X, const BLASINT *incX,
  131. float *Y, const BLASINT *incy);
  132. extern void daxpy_64_(const BLASINT *n, const double *alpha, const double *X, const BLASINT *incX,
  133. double *Y, const BLASINT *incy);
  134. extern BLASINT isamax_64_(const BLASINT *n, const float *X, const BLASINT *incX);
  135. extern BLASINT idamax_64_(const BLASINT *n, const double *X, const BLASINT *incX);
  136. /* for some reason, FLOATRET is not a float but a double in GOTOBLAS */
  137. extern double sdot_64_(const BLASINT *n, const float *x, const BLASINT *incx, const float *y, const BLASINT *incy);
  138. extern double ddot_64_(const BLASINT *n, const double *x, const BLASINT *incx, const double *y, const BLASINT *incy);
  139. extern void sswap_64_(const BLASINT *n, float *x, const BLASINT *incx, float *y, const BLASINT *incy);
  140. extern void dswap_64_(const BLASINT *n, double *x, const BLASINT *incx, double *y, const BLASINT *incy);
  141. #endif /* __BLAS_H__ */