use_starpu_macros_test.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. static void
  17. foo(void)
  18. {
  19. abort(); /* STARPU_ABORT() */
  20. }
  21. static void
  22. bar(struct starpu_task *task)
  23. {
  24. assert(task && task->cl); /* STARPU_ASSERT(task && task->cl) */
  25. }
  26. /*
  27. * STARPU_MIN
  28. */
  29. static int
  30. min(int a, int b)
  31. {
  32. return a<b?a:b; /* return STARPU_MIN(a, b); */
  33. }
  34. static int
  35. min2(int a, int b)
  36. {
  37. int res;
  38. res = a<b?a:b; /* res = STARPU_MIN(a,b); */
  39. return res;
  40. }
  41. static int
  42. min3(int a, int b)
  43. {
  44. int res = a<b?a:b; /* int res = a<b?a:b; */
  45. return res;
  46. }
  47. static int
  48. min4(int a, int b)
  49. {
  50. return a>b?b:a; /* return STARPU_MIN(a,b); */
  51. }
  52. static int
  53. min5(int a, int b)
  54. {
  55. int res;
  56. res = a>b?b:a; /* res = STARPU_MIN(a,b); */
  57. }
  58. static int
  59. min6(int a, int b)
  60. {
  61. int res = a>b?b:a; /* int res = STARPU_MIN(a, b); */
  62. return res;
  63. }
  64. /*
  65. * STARPU_MAX
  66. */
  67. static int
  68. max(int a, int b)
  69. {
  70. return a<b?b:a; /* return STARPU_MAX(a, b); */
  71. }
  72. static int
  73. max2(int a, int b)
  74. {
  75. int res;
  76. res = a<b?b:a; /* res = STARPU_MAX(a, b); */
  77. return res;
  78. }
  79. static int
  80. max3(int a, int b)
  81. {
  82. int res = a<b?b:a; /* int res = STARPU_MAX(a, b); */
  83. return res;
  84. }
  85. static int
  86. max4(int a, int b)
  87. {
  88. return a>b?a:b; /* return STARPU_MAX(a, b); */
  89. }
  90. static int
  91. max5(int a, int b)
  92. {
  93. int res;
  94. res = a>b?a:b; /* res = STARPU_MAX(a, b); */
  95. return res;
  96. }
  97. static int
  98. max6(int a, int b)
  99. {
  100. int res = a>b?a:b; /* int res = STARPU_MAX(a, b); */
  101. return res;
  102. }