def_atlas.hpp 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
  2. // Copyright 2008-2016 National ICT Australia (NICTA)
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // ------------------------------------------------------------------------
  15. #ifdef ARMA_USE_ATLAS
  16. //! \namespace atlas namespace for ATLAS functions (imported from the global namespace)
  17. namespace atlas
  18. {
  19. using ::CblasColMajor;
  20. using ::CblasNoTrans;
  21. using ::CblasTrans;
  22. using ::CblasConjTrans;
  23. using ::CblasLower;
  24. using ::CblasUpper;
  25. #if defined(ARMA_USE_WRAPPER)
  26. extern "C"
  27. {
  28. float wrapper_cblas_sasum(const int N, const float *X, const int incX);
  29. double wrapper_cblas_dasum(const int N, const double *X, const int incX);
  30. float wrapper_cblas_snrm2(const int N, const float *X, const int incX);
  31. double wrapper_cblas_dnrm2(const int N, const double *X, const int incX);
  32. float wrapper_cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY);
  33. double wrapper_cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY);
  34. void wrapper_cblas_cdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu);
  35. void wrapper_cblas_zdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu);
  36. void wrapper_cblas_sgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha,
  37. const float *A, const int lda, const float *X, const int incX, const float beta, float *Y, const int incY);
  38. void wrapper_cblas_dgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const double alpha,
  39. const double *A, const int lda, const double *X, const int incX, const double beta, double *Y, const int incY);
  40. void wrapper_cblas_cgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha,
  41. const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY);
  42. void wrapper_cblas_zgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha,
  43. const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY);
  44. void wrapper_cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
  45. const int M, const int N, const int K, const float alpha,
  46. const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc);
  47. void wrapper_cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
  48. const int M, const int N, const int K, const double alpha,
  49. const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc);
  50. void wrapper_cblas_cgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
  51. const int M, const int N, const int K, const void *alpha,
  52. const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc);
  53. void wrapper_cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB,
  54. const int M, const int N, const int K, const void *alpha,
  55. const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc);
  56. void wrapper_cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans,
  57. const int N, const int K, const float alpha,
  58. const float *A, const int lda, const float beta, float *C, const int ldc);
  59. void wrapper_cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans,
  60. const int N, const int K, const double alpha,
  61. const double *A, const int lda, const double beta, double *C, const int ldc);
  62. void wrapper_cblas_cherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans,
  63. const int N, const int K, const float alpha,
  64. const void *A, const int lda, const float beta, void *C, const int ldc);
  65. void wrapper_cblas_zherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans,
  66. const int N, const int K, const double alpha,
  67. const void *A, const int lda, const double beta, void *C, const int ldc);
  68. int wrapper_clapack_sgetrf(const enum CBLAS_ORDER Order, const int M, const int N, float *A, const int lda, int *ipiv);
  69. int wrapper_clapack_dgetrf(const enum CBLAS_ORDER Order, const int M, const int N, double *A, const int lda, int *ipiv);
  70. int wrapper_clapack_cgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void *A, const int lda, int *ipiv);
  71. int wrapper_clapack_zgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void *A, const int lda, int *ipiv);
  72. int wrapper_clapack_sgetri(const enum CBLAS_ORDER Order, const int N, float *A, const int lda, const int *ipiv);
  73. int wrapper_clapack_dgetri(const enum CBLAS_ORDER Order, const int N, double *A, const int lda, const int *ipiv);
  74. int wrapper_clapack_cgetri(const enum CBLAS_ORDER Order, const int N, void *A, const int lda, const int *ipiv);
  75. int wrapper_clapack_zgetri(const enum CBLAS_ORDER Order, const int N, void *A, const int lda, const int *ipiv);
  76. int wrapper_clapack_sgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, float *A, const int lda, int *ipiv, float *B, const int ldb);
  77. int wrapper_clapack_dgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, double *A, const int lda, int *ipiv, double *B, const int ldb);
  78. int wrapper_clapack_cgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb);
  79. int wrapper_clapack_zgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb);
  80. int wrapper_clapack_spotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, float *A, const int lda);
  81. int wrapper_clapack_dpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, double *A, const int lda);
  82. int wrapper_clapack_cpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda);
  83. int wrapper_clapack_zpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda);
  84. int wrapper_clapack_spotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, float *A, const int lda);
  85. int wrapper_clapack_dpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, double *A, const int lda);
  86. int wrapper_clapack_cpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda);
  87. int wrapper_clapack_zpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda);
  88. int wrapper_clapack_sposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, float *A, const int lda, float *B, const int ldb);
  89. int wrapper_clapack_dposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, double *A, const int lda, double *B, const int ldb);
  90. int wrapper_clapack_cposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, void *A, const int lda, void *B, const int ldb);
  91. int wrapper_clapack_zposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, void *A, const int lda, void *B, const int ldb);
  92. }
  93. #endif
  94. }
  95. #endif