mkl_spblas_omp_variant.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /*******************************************************************************
  2. * Copyright 2020-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) C OpenMP offload
  17. ! interface for Sparse BLAS
  18. !******************************************************************************/
  19. #ifndef _MKL_SPBLAS_OMP_VARIANT_H_
  20. #define _MKL_SPBLAS_OMP_VARIANT_H_
  21. #include "mkl_types.h"
  22. #include "mkl_spblas.h"
  23. #include "mkl_omp_variant.h"
  24. #define MKL_SPBLAS_VARIANT_NAME(func) MKL_VARIANT_NAME(sparse, func)
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif /* __cplusplus */
  28. sparse_status_t MKL_SPBLAS_VARIANT_NAME(s_create_csr)( sparse_matrix_t *A,
  29. const sparse_index_base_t indexing,
  30. const MKL_INT rows,
  31. const MKL_INT cols,
  32. MKL_INT *rows_start,
  33. MKL_INT *rows_end,
  34. MKL_INT *col_indx,
  35. float *values,
  36. void *interop_obj);
  37. sparse_status_t MKL_SPBLAS_VARIANT_NAME(d_create_csr)( sparse_matrix_t *A,
  38. const sparse_index_base_t indexing,
  39. const MKL_INT rows,
  40. const MKL_INT cols,
  41. MKL_INT *rows_start,
  42. MKL_INT *rows_end,
  43. MKL_INT *col_indx,
  44. double *values,
  45. void *interop_obj);
  46. sparse_status_t MKL_SPBLAS_VARIANT_NAME(s_export_csr)( const sparse_matrix_t source,
  47. sparse_index_base_t *indexing,
  48. MKL_INT *rows,
  49. MKL_INT *cols,
  50. MKL_INT **rows_start,
  51. MKL_INT **rows_end,
  52. MKL_INT **col_indx,
  53. float **values,
  54. void *interop_obj);
  55. sparse_status_t MKL_SPBLAS_VARIANT_NAME(d_export_csr)( const sparse_matrix_t source,
  56. sparse_index_base_t *indexing,
  57. MKL_INT *rows,
  58. MKL_INT *cols,
  59. MKL_INT **rows_start,
  60. MKL_INT **rows_end,
  61. MKL_INT **col_indx,
  62. double **values,
  63. void *interop_obj);
  64. sparse_status_t MKL_SPBLAS_VARIANT_NAME(destroy)( sparse_matrix_t A, void *interop_obj);
  65. sparse_status_t MKL_SPBLAS_VARIANT_NAME(set_mv_hint)( const sparse_matrix_t A,
  66. const sparse_operation_t operation,
  67. const struct matrix_descr descr,
  68. const MKL_INT expected_calls,
  69. void *interop_obj);
  70. sparse_status_t MKL_SPBLAS_VARIANT_NAME(set_sv_hint)( const sparse_matrix_t A,
  71. const sparse_operation_t operation,
  72. const struct matrix_descr descr,
  73. const MKL_INT expected_calls,
  74. void *interop_obj);
  75. sparse_status_t MKL_SPBLAS_VARIANT_NAME(optimize)( sparse_matrix_t A, void *interop_obj);
  76. sparse_status_t MKL_SPBLAS_VARIANT_NAME(order)( const sparse_matrix_t A, void *interop_obj);
  77. /* Level 2 */
  78. /* Computes y = alpha * A * x + beta * y */
  79. sparse_status_t MKL_SPBLAS_VARIANT_NAME(s_mv)( const sparse_operation_t operation,
  80. const float alpha,
  81. const sparse_matrix_t A,
  82. const struct matrix_descr descr,
  83. const float *x,
  84. const float beta,
  85. float *y,
  86. void *interop_obj);
  87. sparse_status_t MKL_SPBLAS_VARIANT_NAME(d_mv)( const sparse_operation_t operation,
  88. const double alpha,
  89. const sparse_matrix_t A,
  90. const struct matrix_descr descr,
  91. const double *x,
  92. const double beta,
  93. double *y,
  94. void *interop_obj);
  95. /* Solves triangular system y = alpha * A^{-1} * x */
  96. sparse_status_t MKL_SPBLAS_VARIANT_NAME(s_trsv) ( const sparse_operation_t operation,
  97. const float alpha,
  98. const sparse_matrix_t A,
  99. const struct matrix_descr descr,
  100. const float *x,
  101. float *y,
  102. void *interop_obj);
  103. sparse_status_t MKL_SPBLAS_VARIANT_NAME(d_trsv) ( const sparse_operation_t operation,
  104. const double alpha,
  105. const sparse_matrix_t A,
  106. const struct matrix_descr descr,
  107. const double *x,
  108. double *y,
  109. void *interop_obj);
  110. /* Level 3 */
  111. /* Computes y = alpha * A * x + beta * y */
  112. sparse_status_t MKL_SPBLAS_VARIANT_NAME(s_mm)( const sparse_operation_t operation,
  113. const float alpha,
  114. const sparse_matrix_t A,
  115. const struct matrix_descr descr,
  116. const sparse_layout_t layout,
  117. const float *x,
  118. const MKL_INT columns,
  119. const MKL_INT ldx,
  120. const float beta,
  121. float *y,
  122. const MKL_INT ldy,
  123. void *interop_obj);
  124. sparse_status_t MKL_SPBLAS_VARIANT_NAME(d_mm)( const sparse_operation_t operation,
  125. const double alpha,
  126. const sparse_matrix_t A,
  127. const struct matrix_descr descr,
  128. const sparse_layout_t layout,
  129. const double *x,
  130. const MKL_INT columns,
  131. const MKL_INT ldx,
  132. const double beta,
  133. double *y,
  134. const MKL_INT ldy,
  135. void *interop_obj);
  136. /* Computes product of sparse matrices: C = opA(A) * opB(B), result is sparse */
  137. sparse_status_t MKL_SPBLAS_VARIANT_NAME(sp2m) ( const sparse_operation_t transA,
  138. const struct matrix_descr descrA,
  139. const sparse_matrix_t A,
  140. const sparse_operation_t transB,
  141. const struct matrix_descr descrB,
  142. const sparse_matrix_t B,
  143. const sparse_request_t request,
  144. sparse_matrix_t *C,
  145. void *interop_obj);
  146. #ifdef __cplusplus
  147. }
  148. #endif /*__cplusplus */
  149. #endif /*_MKL_SPBLAS_OMP_VARIANT_H_ */