mkl_direct_call.fi 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. !===============================================================================
  2. ! Copyright 2014-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. ! Content:
  15. ! Intel(R) oneAPI Math Kernel Library (oneMKL) FORTRAN macros for MKL_DIRECT_CALL
  16. !*******************************************************************************
  17. #if defined MKL_DIRECT_CALL_SEQ_JIT
  18. #ifndef MKL_DIRECT_CALL_JIT
  19. #define MKL_DIRECT_CALL_JIT
  20. #endif
  21. #ifndef MKL_DIRECT_CALL_SEQ
  22. #define MKL_DIRECT_CALL_SEQ
  23. #endif
  24. #endif
  25. #if defined MKL_DIRECT_CALL_SEQ || defined MKL_DIRECT_CALL_JIT
  26. #ifndef MKL_DIRECT_CALL
  27. #define MKL_DIRECT_CALL
  28. #endif
  29. #endif
  30. #ifdef MKL_DIRECT_CALL
  31. #if defined MKL_DIRECT_CALL_SEQ
  32. #define MKL_DIRECT_CALL_FLAG 1
  33. #else
  34. #define MKL_DIRECT_CALL_FLAG 0
  35. #endif
  36. #define dgemm DGEMM
  37. #define sgemm SGEMM
  38. #define zgemm ZGEMM
  39. #define cgemm CGEMM
  40. #ifdef MKL_DIRECT_CALL_JIT
  41. #define DGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) MKL_DGEMM_DIRECT_JIT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  42. #define SGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) MKL_SGEMM_DIRECT_JIT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  43. #define CGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) MKL_CGEMM_DIRECT_JIT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  44. #define ZGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) MKL_ZGEMM_DIRECT_JIT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  45. #else
  46. #define DGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) DGEMM_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  47. #define SGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) SGEMM_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  48. #define CGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) CGEMM_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  49. #define ZGEMM(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) ZGEMM_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  50. #endif
  51. #define zgemm3m ZGEMM3M
  52. #define cgemm3m CGEMM3M
  53. #define CGEMM3M(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) CGEMM3M_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  54. #define ZGEMM3M(ta, tb, m, n, k, alpha, A, LDA, B, LDB, beta, C, LDC) ZGEMM3M_DIRECT(ta,tb,m,n,k,alpha,A,LDA,B,LDB,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  55. #define dtrsm DTRSM
  56. #define strsm STRSM
  57. #define ztrsm ZTRSM
  58. #define ctrsm CTRSM
  59. #define DTRSM(sa, su, st, sd, m, n, alpha, a, lda, b, ldb) DTRSM_DIRECT(sa,su,st,sd,m,n,alpha,a,lda,b,ldb,INT(MKL_DIRECT_CALL_FLAG))
  60. #define STRSM(sa, su, st, sd, m, n, alpha, a, lda, b, ldb) STRSM_DIRECT(sa,su,st,sd,m,n,alpha,a,lda,b,ldb,INT(MKL_DIRECT_CALL_FLAG))
  61. #define CTRSM(sa, su, st, sd, m, n, alpha, a, lda, b, ldb) CTRSM_DIRECT(sa,su,st,sd,m,n,alpha,a,lda,b,ldb,INT(MKL_DIRECT_CALL_FLAG))
  62. #define ZTRSM(sa, su, st, sd, m, n, alpha, a, lda, b, ldb) ZTRSM_DIRECT(sa,su,st,sd,m,n,alpha,a,lda,b,ldb,INT(MKL_DIRECT_CALL_FLAG))
  63. #define dsyrk DSYRK
  64. #define ssyrk SSYRK
  65. #define zsyrk ZSYRK
  66. #define csyrk CSYRK
  67. #define DSYRK(ul, tr, n, k, alpha, A, LDA, beta, C, LDC) DSYRK_DIRECT(ul,tr,n,k,alpha,A,LDA,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  68. #define SSYRK(ul, tr, n, k, alpha, A, LDA, beta, C, LDC) SSYRK_DIRECT(ul,tr,n,k,alpha,A,LDA,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  69. #define CSYRK(ul, tr, n, k, alpha, A, LDA, beta, C, LDC) CSYRK_DIRECT(ul,tr,n,k,alpha,A,LDA,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  70. #define ZSYRK(ul, tr, n, k, alpha, A, LDA, beta, C, LDC) ZSYRK_DIRECT(ul,tr,n,k,alpha,A,LDA,beta,C,LDC,INT(MKL_DIRECT_CALL_FLAG))
  71. #define daxpy DAXPY
  72. #define saxpy SAXPY
  73. #define caxpy CAXPY
  74. #define zaxpy ZAXPY
  75. #define DAXPY(n, alpha, x, incx, y, incy) DAXPY_DIRECT(n,alpha,x,incx,y,incy,INT(MKL_DIRECT_CALL_FLAG))
  76. #define SAXPY(n, alpha, x, incx, y, incy) SAXPY_DIRECT(n,alpha,x,incx,y,incy,INT(MKL_DIRECT_CALL_FLAG))
  77. #define CAXPY(n, alpha, x, incx, y, incy) CAXPY_DIRECT(n,alpha,x,incx,y,incy,INT(MKL_DIRECT_CALL_FLAG))
  78. #define ZAXPY(n, alpha, x, incx, y, incy) ZAXPY_DIRECT(n,alpha,x,incx,y,incy,INT(MKL_DIRECT_CALL_FLAG))
  79. #define ddot DDOT_DIRECT
  80. #define sdot SDOT_DIRECT
  81. #define DDOT DDOT_DIRECT
  82. #define SDOT SDOT_DIRECT
  83. #endif