You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

getarch_2nd.c 5.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /***************************************************************************
  2. * Copyright (c) 2025, The OpenBLAS Project
  3. * All rights reserved.
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are
  6. * met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in
  11. * the documentation and/or other materials provided with the
  12. * distribution.
  13. * 3. Neither the name of the OpenBLAS project nor the names of
  14. * its contributors may be used to endorse or promote products
  15. * derived from this software without specific prior written permission.
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE OPENBLAS PROJECT OR CONTRIBUTORS BE
  20. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  23. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  24. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  25. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  26. * POSSIBILITY OF SUCH DAMAGE.
  27. * *****************************************************************************/
  28. #include <stdio.h>
  29. #ifndef BUILD_KERNEL
  30. #include "config.h"
  31. #else
  32. #include "config_kernel.h"
  33. #endif
  34. #if (defined(__WIN32__) || defined(__WIN64__) || defined(__CYGWIN32__) || defined(__CYGWIN64__) || defined(_WIN32) || defined(_WIN64)) && defined(__64BIT__)
  35. typedef long long BLASLONG;
  36. typedef unsigned long long BLASULONG;
  37. #else
  38. typedef long BLASLONG;
  39. typedef unsigned long BLASULONG;
  40. #endif
  41. #include "param.h"
  42. int main(int argc, char **argv) {
  43. if ( (argc <= 1) || ((argc >= 2) && (*argv[1] == '0'))) {
  44. printf("BGEMM_UNROLL_M=%d\n", BGEMM_DEFAULT_UNROLL_M);
  45. printf("BGEMM_UNROLL_N=%d\n", BGEMM_DEFAULT_UNROLL_N);
  46. printf("BGEMM_UNROLL_M=%d\n", BGEMM_DEFAULT_UNROLL_M);
  47. printf("BGEMM_UNROLL_N=%d\n", BGEMM_DEFAULT_UNROLL_N);
  48. printf("SBGEMM_UNROLL_M=%d\n", SBGEMM_DEFAULT_UNROLL_M);
  49. printf("SBGEMM_UNROLL_N=%d\n", SBGEMM_DEFAULT_UNROLL_N);
  50. printf("SHGEMM_UNROLL_M=%d\n", SHGEMM_DEFAULT_UNROLL_M);
  51. printf("SHGEMM_UNROLL_N=%d\n", SHGEMM_DEFAULT_UNROLL_N);
  52. printf("SGEMM_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
  53. printf("SGEMM_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
  54. printf("DGEMM_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
  55. printf("DGEMM_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
  56. printf("QGEMM_UNROLL_M=%d\n", QGEMM_DEFAULT_UNROLL_M);
  57. printf("QGEMM_UNROLL_N=%d\n", QGEMM_DEFAULT_UNROLL_N);
  58. printf("CGEMM_UNROLL_M=%d\n", CGEMM_DEFAULT_UNROLL_M);
  59. printf("CGEMM_UNROLL_N=%d\n", CGEMM_DEFAULT_UNROLL_N);
  60. printf("ZGEMM_UNROLL_M=%d\n", ZGEMM_DEFAULT_UNROLL_M);
  61. printf("ZGEMM_UNROLL_N=%d\n", ZGEMM_DEFAULT_UNROLL_N);
  62. printf("XGEMM_UNROLL_M=%d\n", XGEMM_DEFAULT_UNROLL_M);
  63. printf("XGEMM_UNROLL_N=%d\n", XGEMM_DEFAULT_UNROLL_N);
  64. #ifdef CGEMM3M_DEFAULT_UNROLL_M
  65. printf("CGEMM3M_UNROLL_M=%d\n", CGEMM3M_DEFAULT_UNROLL_M);
  66. #else
  67. printf("CGEMM3M_UNROLL_M=%d\n", SGEMM_DEFAULT_UNROLL_M);
  68. #endif
  69. #ifdef CGEMM3M_DEFAULT_UNROLL_N
  70. printf("CGEMM3M_UNROLL_N=%d\n", CGEMM3M_DEFAULT_UNROLL_N);
  71. #else
  72. printf("CGEMM3M_UNROLL_N=%d\n", SGEMM_DEFAULT_UNROLL_N);
  73. #endif
  74. #ifdef ZGEMM3M_DEFAULT_UNROLL_M
  75. printf("ZGEMM3M_UNROLL_M=%d\n", ZGEMM3M_DEFAULT_UNROLL_M);
  76. #else
  77. printf("ZGEMM3M_UNROLL_M=%d\n", DGEMM_DEFAULT_UNROLL_M);
  78. #endif
  79. #ifdef ZGEMM3M_DEFAULT_UNROLL_N
  80. printf("ZGEMM3M_UNROLL_N=%d\n", ZGEMM3M_DEFAULT_UNROLL_N);
  81. #else
  82. printf("ZGEMM3M_UNROLL_N=%d\n", DGEMM_DEFAULT_UNROLL_N);
  83. #endif
  84. #ifdef XGEMM3M_DEFAULT_UNROLL_M
  85. printf("XGEMM3M_UNROLL_M=%d\n", ZGEMM3M_DEFAULT_UNROLL_M);
  86. #else
  87. printf("XGEMM3M_UNROLL_M=%d\n", QGEMM_DEFAULT_UNROLL_M);
  88. #endif
  89. #ifdef XGEMM3M_DEFAULT_UNROLL_N
  90. printf("XGEMM3M_UNROLL_N=%d\n", ZGEMM3M_DEFAULT_UNROLL_N);
  91. #else
  92. printf("XGEMM3M_UNROLL_N=%d\n", QGEMM_DEFAULT_UNROLL_N);
  93. #endif
  94. }
  95. if ((argc >= 2) && (*argv[1] == '1')) {
  96. #if defined(ARCH_X86) || defined(ARCH_X86_64)
  97. printf("#define SLOCAL_BUFFER_SIZE\t%ld\n", (SGEMM_DEFAULT_Q * SGEMM_DEFAULT_UNROLL_N * 4 * 1 * sizeof(float)));
  98. printf("#define DLOCAL_BUFFER_SIZE\t%ld\n", (DGEMM_DEFAULT_Q * DGEMM_DEFAULT_UNROLL_N * 2 * 1 * sizeof(double)));
  99. printf("#define CLOCAL_BUFFER_SIZE\t%ld\n", (CGEMM_DEFAULT_Q * CGEMM_DEFAULT_UNROLL_N * 4 * 2 * sizeof(float)));
  100. printf("#define ZLOCAL_BUFFER_SIZE\t%ld\n", (ZGEMM_DEFAULT_Q * ZGEMM_DEFAULT_UNROLL_N * 2 * 2 * sizeof(double)));
  101. #endif
  102. #ifdef USE64BITINT
  103. printf("#define USE64BITINT\n");
  104. #endif
  105. printf("#define GEMM_MULTITHREAD_THRESHOLD\t%ld\n", (long int)GEMM_MULTITHREAD_THRESHOLD);
  106. }
  107. return 0;
  108. }