for-6.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* { dg-additional-options "-std=gnu99" { target c } } */
  2. extern
  3. #ifdef __cplusplus
  4. "C"
  5. #endif
  6. void abort ();
  7. #define M(x, y, z) O(x, y, z)
  8. #define O(x, y, z) x ## _ ## y ## _ ## z
  9. #pragma omp declare target
  10. #define F for
  11. #define G f
  12. #define S
  13. #define N(x) M(x, G, normal)
  14. #include "for-2.h"
  15. #undef S
  16. #undef N
  17. #undef F
  18. #undef G
  19. #pragma omp end declare target
  20. #undef OMPTGT
  21. #undef OMPFROM
  22. #undef OMPTO
  23. #define DO_PRAGMA(x) _Pragma (#x)
  24. #define OMPTGT DO_PRAGMA (omp target)
  25. #define OMPFROM(v) DO_PRAGMA (omp target update from(v))
  26. #define OMPTO(v) DO_PRAGMA (omp target update to(v))
  27. #define F teams distribute
  28. #define G td
  29. #define S
  30. #define N(x) M(x, G, normal)
  31. #include "for-2.h"
  32. #undef S
  33. #undef N
  34. #undef F
  35. #undef G
  36. #define F teams distribute
  37. #define G td_ds128
  38. #define S dist_schedule(static, 128)
  39. #define N(x) M(x, G, normal)
  40. #include "for-2.h"
  41. #undef S
  42. #undef N
  43. #undef F
  44. #undef G
  45. #define F teams distribute simd
  46. #define G tds
  47. #define S
  48. #define N(x) M(x, G, normal)
  49. #include "for-2.h"
  50. #undef S
  51. #undef N
  52. #undef F
  53. #undef G
  54. #define F teams distribute simd
  55. #define G tds_ds128
  56. #define S dist_schedule(static, 128)
  57. #define N(x) M(x, G, normal)
  58. #include "for-2.h"
  59. #undef S
  60. #undef N
  61. #undef F
  62. #undef G
  63. #define F teams distribute parallel for
  64. #define G tdpf
  65. #include "for-1.h"
  66. #undef F
  67. #undef G
  68. #define F teams distribute parallel for dist_schedule(static, 128)
  69. #define G tdpf_ds128
  70. #include "for-1.h"
  71. #undef F
  72. #undef G
  73. #define F teams distribute parallel for simd
  74. #define G tdpfs
  75. #include "for-1.h"
  76. #undef F
  77. #undef G
  78. #define F teams distribute parallel for simd dist_schedule(static, 128)
  79. #define G tdpfs_ds128
  80. #include "for-1.h"
  81. #undef F
  82. #undef G
  83. int
  84. main ()
  85. {
  86. if (test_td_normal ()
  87. || test_td_ds128_normal ()
  88. || test_tds_normal ()
  89. || test_tds_ds128_normal ()
  90. || test_tdpf_static ()
  91. || test_tdpf_static32 ()
  92. || test_tdpf_auto ()
  93. || test_tdpf_guided32 ()
  94. || test_tdpf_runtime ()
  95. || test_tdpf_ds128_static ()
  96. || test_tdpf_ds128_static32 ()
  97. || test_tdpf_ds128_auto ()
  98. || test_tdpf_ds128_guided32 ()
  99. || test_tdpf_ds128_runtime ()
  100. || test_tdpfs_static ()
  101. || test_tdpfs_static32 ()
  102. || test_tdpfs_auto ()
  103. || test_tdpfs_guided32 ()
  104. || test_tdpfs_runtime ()
  105. || test_tdpfs_ds128_static ()
  106. || test_tdpfs_ds128_static32 ()
  107. || test_tdpfs_ds128_auto ()
  108. || test_tdpfs_ds128_guided32 ()
  109. || test_tdpfs_ds128_runtime ())
  110. abort ();
  111. return 0;
  112. }