use_starpu_macros_test.c 2.0 KB

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