mkl_trans.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. /*******************************************************************************
  2. * Copyright 2007-2022 Intel Corporation.
  3. *
  4. * This software and the related documents are Intel copyrighted materials, and
  5. * your use of them is governed by the express license under which they were
  6. * provided to you (License). Unless the License provides otherwise, you may not
  7. * use, modify, copy, publish, distribute, disclose or transmit this software or
  8. * the related documents without Intel's prior written permission.
  9. *
  10. * This software and the related documents are provided as is, with no express
  11. * or implied warranties, other than those that are expressly stated in the
  12. * License.
  13. *******************************************************************************/
  14. /*
  15. ! Content:
  16. ! Intel(R) oneAPI Math Kernel Library (oneMKL) include for transposition routines
  17. !******************************************************************************/
  18. #if !defined(_MKL_TRANS_H)
  19. #define _MKL_TRANS_H
  20. /* for size_t */
  21. #include <stddef.h>
  22. #include "mkl_types.h"
  23. #include "mkl_trans_names.h"
  24. #ifdef __cplusplus
  25. #if __cplusplus > 199711L
  26. #define NOTHROW noexcept
  27. #else
  28. #define NOTHROW throw()
  29. #endif
  30. #else
  31. #define NOTHROW
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif /* __cplusplus */
  36. /* In-place transposition routines */
  37. void mkl_simatcopy(
  38. const char ordering, const char trans,
  39. size_t rows, size_t cols,
  40. const float alpha,
  41. float * AB, size_t lda, size_t ldb);
  42. void mkl_dimatcopy(
  43. const char ordering, const char trans,
  44. size_t rows, size_t cols,
  45. const double alpha,
  46. double * AB, size_t lda, size_t ldb);
  47. void mkl_cimatcopy(
  48. const char ordering, const char trans,
  49. size_t rows, size_t cols,
  50. const MKL_Complex8 alpha,
  51. MKL_Complex8 * AB, size_t lda, size_t ldb);
  52. void mkl_zimatcopy(
  53. const char ordering, const char trans,
  54. size_t rows, size_t cols,
  55. const MKL_Complex16 alpha,
  56. MKL_Complex16 * AB, size_t lda, size_t ldb);
  57. /* Out-of-place transposition routines */
  58. void mkl_somatcopy(
  59. char ordering, char trans,
  60. size_t rows, size_t cols,
  61. const float alpha,
  62. const float * A, size_t lda,
  63. float * B, size_t ldb);
  64. void mkl_domatcopy(
  65. char ordering, char trans,
  66. size_t rows, size_t cols,
  67. const double alpha,
  68. const double * A, size_t lda,
  69. double * B, size_t ldb);
  70. void mkl_comatcopy(
  71. char ordering, char trans,
  72. size_t rows, size_t cols,
  73. const MKL_Complex8 alpha,
  74. const MKL_Complex8 * A, size_t lda,
  75. MKL_Complex8 * B, size_t ldb);
  76. void mkl_zomatcopy(
  77. char ordering, char trans,
  78. size_t rows, size_t cols,
  79. const MKL_Complex16 alpha,
  80. const MKL_Complex16 * A, size_t lda,
  81. MKL_Complex16 * B, size_t ldb);
  82. /* Out-of-place transposition routines (all-strided case) */
  83. void mkl_somatcopy2(
  84. char ordering, char trans,
  85. size_t rows, size_t cols,
  86. const float alpha,
  87. const float * A, size_t lda, size_t stridea,
  88. float * B, size_t ldb, size_t strideb);
  89. void mkl_domatcopy2(
  90. char ordering, char trans,
  91. size_t rows, size_t cols,
  92. const double alpha,
  93. const double * A, size_t lda, size_t stridea,
  94. double * B, size_t ldb, size_t strideb);
  95. void mkl_comatcopy2(
  96. char ordering, char trans,
  97. size_t rows, size_t cols,
  98. const MKL_Complex8 alpha,
  99. const MKL_Complex8 * A, size_t lda, size_t stridea,
  100. MKL_Complex8 * B, size_t ldb, size_t strideb);
  101. void mkl_zomatcopy2(
  102. char ordering, char trans,
  103. size_t rows, size_t cols,
  104. const MKL_Complex16 alpha,
  105. const MKL_Complex16 * A, size_t lda, size_t stridea,
  106. MKL_Complex16 * B, size_t ldb, size_t strideb);
  107. /* Out-of-place memory movement routines */
  108. void mkl_somatadd(
  109. char ordering, char transa, char transb,
  110. size_t rows, size_t cols,
  111. const float alpha,
  112. const float * A, size_t lda,
  113. const float beta,
  114. const float * B, size_t ldb,
  115. float * C, size_t ldc);
  116. void mkl_domatadd(
  117. char ordering, char transa, char transb,
  118. size_t rows, size_t cols,
  119. const double alpha,
  120. const double * A, size_t lda,
  121. const double beta,
  122. const double * B, size_t ldb,
  123. double * C, size_t ldc);
  124. void mkl_comatadd(
  125. char ordering, char transa, char transb,
  126. size_t rows, size_t cols,
  127. const MKL_Complex8 alpha,
  128. const MKL_Complex8 * A, size_t lda,
  129. const MKL_Complex8 beta,
  130. const MKL_Complex8 * B, size_t ldb,
  131. MKL_Complex8 * C, size_t ldc);
  132. void mkl_zomatadd(
  133. char ordering, char transa, char transb,
  134. size_t rows, size_t cols,
  135. const MKL_Complex16 alpha,
  136. const MKL_Complex16 * A, size_t lda,
  137. const MKL_Complex16 beta,
  138. const MKL_Complex16 * B, size_t ldb,
  139. MKL_Complex16 * C, size_t ldc);
  140. /* Batch routines */
  141. void mkl_simatcopy_batch_strided(
  142. const char ordering, const char trans,
  143. size_t rows, size_t cols,
  144. const float alpha,
  145. float * AB, size_t lda, size_t ldb,
  146. size_t stride, size_t batch_size) NOTHROW;
  147. void mkl_dimatcopy_batch_strided(
  148. const char ordering, const char trans,
  149. size_t rows, size_t cols,
  150. const double alpha,
  151. double * AB, size_t lda, size_t ldb,
  152. size_t stride, size_t batch_size) NOTHROW;
  153. void mkl_cimatcopy_batch_strided(
  154. const char ordering, const char trans,
  155. size_t rows, size_t cols,
  156. const MKL_Complex8 alpha,
  157. MKL_Complex8 * AB, size_t lda, size_t ldb,
  158. size_t stride, size_t batch_size) NOTHROW;
  159. void mkl_zimatcopy_batch_strided(
  160. const char ordering, const char trans,
  161. size_t rows, size_t cols,
  162. const MKL_Complex16 alpha,
  163. MKL_Complex16 * AB, size_t lda, size_t ldb,
  164. size_t stride, size_t batch_size) NOTHROW;
  165. void mkl_somatcopy_batch_strided(
  166. char ordering, char trans,
  167. size_t rows, size_t cols,
  168. const float alpha,
  169. const float * A, size_t lda, size_t stridea,
  170. float * B, size_t ldb, size_t strideb, size_t batch_size) NOTHROW;
  171. void mkl_domatcopy_batch_strided(
  172. char ordering, char trans,
  173. size_t rows, size_t cols,
  174. const double alpha,
  175. const double * A, size_t lda, size_t stridea,
  176. double * B, size_t ldb, size_t strideb, size_t batch_size) NOTHROW;
  177. void mkl_comatcopy_batch_strided(
  178. char ordering, char trans,
  179. size_t rows, size_t cols,
  180. const MKL_Complex8 alpha,
  181. const MKL_Complex8 * A, size_t lda, size_t stridea,
  182. MKL_Complex8 * B, size_t ldb, size_t strideb, size_t batch_size) NOTHROW;
  183. void mkl_zomatcopy_batch_strided(
  184. char ordering, char trans,
  185. size_t rows, size_t cols,
  186. const MKL_Complex16 alpha,
  187. const MKL_Complex16 * A, size_t lda, size_t stridea,
  188. MKL_Complex16 * B, size_t ldb, size_t strideb, size_t batch_size) NOTHROW;
  189. void mkl_simatcopy_batch(
  190. char ordering, const char * trans_array,
  191. const size_t * rows_array, const size_t * cols_array,
  192. const float * alpha_array,
  193. float ** AB_array, const size_t * lda_array, const size_t * ldb_array,
  194. size_t group_count, const size_t * group_size) NOTHROW;
  195. void mkl_dimatcopy_batch(
  196. char ordering, const char * trans_array,
  197. const size_t * rows_array, const size_t * cols_array,
  198. const double * alpha_array,
  199. double ** AB_array, const size_t * lda_array, const size_t * ldb_array,
  200. size_t group_count, const size_t * group_size) NOTHROW;
  201. void mkl_cimatcopy_batch(
  202. char ordering, const char * trans_array,
  203. const size_t * rows_array, const size_t * cols_array,
  204. const MKL_Complex8 * alpha_array,
  205. MKL_Complex8 ** AB_array, const size_t * lda_array, const size_t * ldb_array,
  206. size_t group_count, const size_t * group_size) NOTHROW;
  207. void mkl_zimatcopy_batch(
  208. char ordering, const char * trans_array,
  209. const size_t * rows_array, const size_t * cols_array,
  210. const MKL_Complex16 * alpha_array,
  211. MKL_Complex16 ** AB_array, const size_t * lda_array, const size_t * ldb_array,
  212. size_t group_count, const size_t * group_size) NOTHROW;
  213. void mkl_somatcopy_batch(
  214. char ordering, const char * trans_array,
  215. const size_t * rows_array, const size_t * cols_array,
  216. const float * alpha_array,
  217. const float ** A_array, const size_t * lda_array,
  218. float ** B, const size_t * ldb_array, size_t group_count,
  219. const size_t * group_size) NOTHROW;
  220. void mkl_domatcopy_batch(
  221. char ordering, const char * trans_array,
  222. const size_t * rows_array, const size_t * cols_array,
  223. const double * alpha_array,
  224. const double ** A_array, const size_t * lda_array,
  225. double ** B_array, const size_t * ldb_array, size_t group_count,
  226. const size_t * group_size) NOTHROW;
  227. void mkl_comatcopy_batch(
  228. char ordering, const char * trans_array,
  229. const size_t * rows_array, const size_t * cols_array,
  230. const MKL_Complex8 * alpha_array,
  231. const MKL_Complex8 ** A_array, const size_t * lda_array,
  232. MKL_Complex8 ** B, const size_t * ldb_array, size_t group_count,
  233. const size_t * group_size) NOTHROW;
  234. void mkl_zomatcopy_batch(
  235. char ordering, const char * trans_array,
  236. const size_t * rows_array, const size_t * cols_array,
  237. const MKL_Complex16 * alpha_array,
  238. const MKL_Complex16 ** A_array, const size_t * lda_array,
  239. MKL_Complex16 ** B, const size_t * ldb_array, size_t group_count,
  240. const size_t * group_size) NOTHROW;
  241. void mkl_somatadd_batch_strided(
  242. char ordering, char transa, char transb,
  243. size_t rows, size_t cols,
  244. const float alpha, const float * A, size_t lda, size_t stridea,
  245. const float beta, const float * B, size_t ldb, size_t strideb,
  246. float * C, size_t ldc, size_t stridec, size_t batch_size) NOTHROW;
  247. void mkl_domatadd_batch_strided(
  248. char ordering, char transa, char transb,
  249. size_t rows, size_t cols,
  250. const double alpha, const double * A, size_t lda, size_t stridea,
  251. const double beta, const double * B, size_t ldb, size_t strideb,
  252. double * C, size_t ldc, size_t stridec, size_t batch_size) NOTHROW;
  253. void mkl_comatadd_batch_strided(
  254. char ordering, char transa, char transb,
  255. size_t rows, size_t cols,
  256. const MKL_Complex8 alpha, const MKL_Complex8 * A, size_t lda, size_t stridea,
  257. const MKL_Complex8 beta, const MKL_Complex8 * B, size_t ldb, size_t strideb,
  258. MKL_Complex8 * C, size_t ldc, size_t stridec, size_t batch_size) NOTHROW;
  259. void mkl_zomatadd_batch_strided(
  260. char ordering, char transa, char transb,
  261. size_t rows, size_t cols,
  262. const MKL_Complex16 alpha, const MKL_Complex16 * A, size_t lda, size_t stridea,
  263. const MKL_Complex16 beta, const MKL_Complex16 * B, size_t ldb, size_t strideb,
  264. MKL_Complex16 * C, size_t ldc, size_t stridec, size_t batch_size) NOTHROW;
  265. #ifdef __cplusplus
  266. }
  267. #endif /* __cplusplus */
  268. #endif /* _MKL_TRANS_H */