do1.f90 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ! { dg-do run }
  2. integer, dimension (128) :: a, b
  3. integer :: i
  4. a = -1
  5. b = -1
  6. do i = 1, 128
  7. if (i .ge. 8 .and. i .le. 15) then
  8. b(i) = 1 * 256 + i
  9. else if (i .ge. 19 .and. i .le. 23) then
  10. b(i) = 2 * 256 + i
  11. else if (i .ge. 28 .and. i .le. 38) then
  12. if (iand (i, 1) .eq. 0) b(i) = 3 * 256 + i
  13. else if (i .ge. 59 .and. i .le. 79) then
  14. if (iand (i - 59, 3) .eq. 0) b(i) = 4 * 256 + i
  15. else if (i .ge. 101 .and. i .le. 125) then
  16. if (mod (i - 101, 12) .eq. 0) b(i) = 5 * 256 + i
  17. end if
  18. end do
  19. !$omp parallel num_threads (4)
  20. !$omp do
  21. do i = 8, 15
  22. a(i) = 1 * 256 + i
  23. end do
  24. !$omp do
  25. do i = 23, 19, -1
  26. a(i) = 2 * 256 + i
  27. end do
  28. !$omp do
  29. do i = 28, 39, 2
  30. a(i) = 3 * 256 + i
  31. end do
  32. !$omp do
  33. do i = 79, 59, -4
  34. a(i) = 4 * 256 + i
  35. end do
  36. !$omp do
  37. do i = 125, 90, -12
  38. a(i) = 5 * 256 + i
  39. end do
  40. !$omp end parallel
  41. if (any (a .ne. b)) call abort
  42. a = -1
  43. !$omp parallel num_threads (4)
  44. !$omp do schedule (static)
  45. do i = 8, 15
  46. a(i) = 1 * 256 + i
  47. end do
  48. !$omp do schedule (static, 1)
  49. do i = 23, 19, -1
  50. a(i) = 2 * 256 + i
  51. end do
  52. !$omp do schedule (static, 3)
  53. do i = 28, 39, 2
  54. a(i) = 3 * 256 + i
  55. end do
  56. !$omp do schedule (static, 6)
  57. do i = 79, 59, -4
  58. a(i) = 4 * 256 + i
  59. end do
  60. !$omp do schedule (static, 2)
  61. do i = 125, 90, -12
  62. a(i) = 5 * 256 + i
  63. end do
  64. !$omp end parallel
  65. if (any (a .ne. b)) call abort
  66. a = -1
  67. !$omp parallel num_threads (4)
  68. !$omp do schedule (dynamic)
  69. do i = 8, 15
  70. a(i) = 1 * 256 + i
  71. end do
  72. !$omp do schedule (dynamic, 4)
  73. do i = 23, 19, -1
  74. a(i) = 2 * 256 + i
  75. end do
  76. !$omp do schedule (dynamic, 1)
  77. do i = 28, 39, 2
  78. a(i) = 3 * 256 + i
  79. end do
  80. !$omp do schedule (dynamic, 2)
  81. do i = 79, 59, -4
  82. a(i) = 4 * 256 + i
  83. end do
  84. !$omp do schedule (dynamic, 3)
  85. do i = 125, 90, -12
  86. a(i) = 5 * 256 + i
  87. end do
  88. !$omp end parallel
  89. if (any (a .ne. b)) call abort
  90. a = -1
  91. !$omp parallel num_threads (4)
  92. !$omp do schedule (guided)
  93. do i = 8, 15
  94. a(i) = 1 * 256 + i
  95. end do
  96. !$omp do schedule (guided, 4)
  97. do i = 23, 19, -1
  98. a(i) = 2 * 256 + i
  99. end do
  100. !$omp do schedule (guided, 1)
  101. do i = 28, 39, 2
  102. a(i) = 3 * 256 + i
  103. end do
  104. !$omp do schedule (guided, 2)
  105. do i = 79, 59, -4
  106. a(i) = 4 * 256 + i
  107. end do
  108. !$omp do schedule (guided, 3)
  109. do i = 125, 90, -12
  110. a(i) = 5 * 256 + i
  111. end do
  112. !$omp end parallel
  113. if (any (a .ne. b)) call abort
  114. a = -1
  115. !$omp parallel num_threads (4)
  116. !$omp do schedule (runtime)
  117. do i = 8, 15
  118. a(i) = 1 * 256 + i
  119. end do
  120. !$omp do schedule (runtime)
  121. do i = 23, 19, -1
  122. a(i) = 2 * 256 + i
  123. end do
  124. !$omp do schedule (runtime)
  125. do i = 28, 39, 2
  126. a(i) = 3 * 256 + i
  127. end do
  128. !$omp do schedule (runtime)
  129. do i = 79, 59, -4
  130. a(i) = 4 * 256 + i
  131. end do
  132. !$omp do schedule (runtime)
  133. do i = 125, 90, -12
  134. a(i) = 5 * 256 + i
  135. end do
  136. !$omp end parallel
  137. if (any (a .ne. b)) call abort
  138. end