annotate libgomp/loop.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 /* Copyright (C) 2005-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 Contributed by Richard Henderson <rth@redhat.com>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
111
kono
parents: 0
diff changeset
4 This file is part of the GNU Offloading and Multi Processing Library
kono
parents: 0
diff changeset
5 (libgomp).
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 Libgomp is free software; you can redistribute it and/or modify it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 FOR A PARTICULAR PURPOSE. See the GNU General Public License for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 Under Section 7 of GPL version 3, you are granted additional
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 permissions described in the GCC Runtime Library Exception, version
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 3.1, as published by the Free Software Foundation.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 You should have received a copy of the GNU General Public License and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 a copy of the GCC Runtime Library Exception along with this program;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 /* This file handles the LOOP (FOR/DO) construct. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 #include <limits.h>
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #include <stdlib.h>
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
30 #include <string.h>
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 #include "libgomp.h"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
34 ialias (GOMP_loop_runtime_next)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
35 ialias_redirect (GOMP_taskgroup_reduction_register)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
36
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 /* Initialize the given work share construct from the given arguments. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 static inline void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 gomp_loop_init (struct gomp_work_share *ws, long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 enum gomp_schedule_type sched, long chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 ws->sched = sched;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 ws->chunk_size = chunk_size;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 /* Canonicalize loops that have zero iterations to ->next == ->end. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 ws->end = ((incr > 0 && start > end) || (incr < 0 && start < end))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 ? start : end;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 ws->incr = incr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 ws->next = start;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 if (sched == GFS_DYNAMIC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 ws->chunk_size *= incr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 #ifdef HAVE_SYNC_BUILTINS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 /* For dynamic scheduling prepare things to make each iteration
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 faster. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 struct gomp_team *team = thr->ts.team;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 long nthreads = team ? team->nthreads : 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 if (__builtin_expect (incr > 0, 1))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 /* Cheap overflow protection. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 if (__builtin_expect ((nthreads | ws->chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 >= 1UL << (sizeof (long)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 * __CHAR_BIT__ / 2 - 1), 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 ws->mode = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 ws->mode = ws->end < (LONG_MAX
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 - (nthreads + 1) * ws->chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 /* Cheap overflow protection. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 else if (__builtin_expect ((nthreads | -ws->chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 >= 1UL << (sizeof (long)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 * __CHAR_BIT__ / 2 - 1), 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 ws->mode = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 ws->mode = ws->end > (nthreads + 1) * -ws->chunk_size - LONG_MAX;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 /* The *_start routines are called when first encountering a loop construct
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
86 that is not bound directly to a parallel construct. The first thread
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 that arrives will create the work-share construct; subsequent threads
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 will see the construct exists and allocate work from it.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 START, END, INCR are the bounds of the loop; due to the restrictions of
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 OpenMP, these values must be the same in every thread. This is not
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 verified (nor is it entirely verifiable, since START is not necessarily
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 retained intact in the work-share data structure). CHUNK_SIZE is the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 scheduling parameter; again this must be identical in all threads.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 Returns true if there's any work for this thread to perform. If so,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 *ISTART and *IEND are filled with the bounds of the iteration block
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 allocated to this thread. Returns false if all work was assigned to
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 other threads prior to this thread's arrival. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 gomp_loop_static_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
106
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 thr->ts.static_trip = 0;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
108 if (gomp_work_share_start (0))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 GFS_STATIC, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 return !gomp_iter_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
111
kono
parents: 0
diff changeset
118 /* The current dynamic implementation is always monotonic. The
kono
parents: 0
diff changeset
119 entrypoints without nonmonotonic in them have to be always monotonic,
kono
parents: 0
diff changeset
120 but the nonmonotonic ones could be changed to use work-stealing for
kono
parents: 0
diff changeset
121 improved scalability. */
kono
parents: 0
diff changeset
122
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 gomp_loop_dynamic_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
130 if (gomp_work_share_start (0))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 GFS_DYNAMIC, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
134 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
136
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 #ifdef HAVE_SYNC_BUILTINS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138 ret = gomp_iter_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 ret = gomp_iter_dynamic_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
111
kono
parents: 0
diff changeset
148 /* Similarly as for dynamic, though the question is how can the chunk sizes
kono
parents: 0
diff changeset
149 be decreased without a central locking or atomics. */
kono
parents: 0
diff changeset
150
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 gomp_loop_guided_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
158 if (gomp_work_share_start (0))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 GFS_GUIDED, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 #ifdef HAVE_SYNC_BUILTINS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 ret = gomp_iter_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 ret = gomp_iter_guided_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 GOMP_loop_runtime_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 struct gomp_task_icv *icv = gomp_icv (false);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
181 switch (icv->run_sched_var & ~GFS_MONOTONIC)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 case GFS_STATIC:
111
kono
parents: 0
diff changeset
184 return gomp_loop_static_start (start, end, incr,
kono
parents: 0
diff changeset
185 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 case GFS_DYNAMIC:
111
kono
parents: 0
diff changeset
188 return gomp_loop_dynamic_start (start, end, incr,
kono
parents: 0
diff changeset
189 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 case GFS_GUIDED:
111
kono
parents: 0
diff changeset
192 return gomp_loop_guided_start (start, end, incr,
kono
parents: 0
diff changeset
193 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 case GFS_AUTO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 /* For now map to schedule(static), later on we could play with feedback
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 driven choice. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 return gomp_loop_static_start (start, end, incr, 0, istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 abort ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
204 static long
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
205 gomp_adjust_sched (long sched, long *chunk_size)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
206 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
207 sched &= ~GFS_MONOTONIC;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
208 switch (sched)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
209 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
210 case GFS_STATIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
211 case GFS_DYNAMIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
212 case GFS_GUIDED:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
213 return sched;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
214 /* GFS_RUNTIME is used for runtime schedule without monotonic
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
215 or nonmonotonic modifiers on the clause.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
216 GFS_RUNTIME|GFS_MONOTONIC for runtime schedule with monotonic
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
217 modifier. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
218 case GFS_RUNTIME:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
219 /* GFS_AUTO is used for runtime schedule with nonmonotonic
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
220 modifier. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
221 case GFS_AUTO:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
222 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
223 struct gomp_task_icv *icv = gomp_icv (false);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
224 sched = icv->run_sched_var & ~GFS_MONOTONIC;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
225 switch (sched)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
226 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
227 case GFS_STATIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
228 case GFS_DYNAMIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
229 case GFS_GUIDED:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
230 *chunk_size = icv->run_sched_chunk_size;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
231 break;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
232 case GFS_AUTO:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
233 sched = GFS_STATIC;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
234 *chunk_size = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
235 break;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
236 default:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
237 abort ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
238 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
239 return sched;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
240 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
241 default:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
242 abort ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
243 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
244 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
245
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
246 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
247 GOMP_loop_start (long start, long end, long incr, long sched,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
248 long chunk_size, long *istart, long *iend,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
249 uintptr_t *reductions, void **mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
250 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
251 struct gomp_thread *thr = gomp_thread ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
252
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
253 thr->ts.static_trip = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
255 gomp_workshare_taskgroup_start ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
256 if (gomp_work_share_start (0))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
257 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
258 sched = gomp_adjust_sched (sched, &chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
259 gomp_loop_init (thr->ts.work_share, start, end, incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
260 sched, chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
261 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
263 GOMP_taskgroup_reduction_register (reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
264 thr->task->taskgroup->workshare = true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
265 thr->ts.work_share->task_reductions = reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
266 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
267 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
268 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
269 uintptr_t size = (uintptr_t) *mem;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
270 #define INLINE_ORDERED_TEAM_IDS_OFF \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
271 ((offsetof (struct gomp_work_share, inline_ordered_team_ids) \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
272 + __alignof__ (long long) - 1) & ~(__alignof__ (long long) - 1))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
273 if (size > (sizeof (struct gomp_work_share)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
274 - INLINE_ORDERED_TEAM_IDS_OFF))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
275 *mem
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
276 = (void *) (thr->ts.work_share->ordered_team_ids
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
277 = gomp_malloc_cleared (size));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
278 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
279 *mem = memset (((char *) thr->ts.work_share)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
280 + INLINE_ORDERED_TEAM_IDS_OFF, '\0', size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
281 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
282 gomp_work_share_init_done ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
283 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
284 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
285 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
286 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
287 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
288 uintptr_t *first_reductions = thr->ts.work_share->task_reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
289 gomp_workshare_task_reduction_register (reductions,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
290 first_reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
291 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
292 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
293 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
294 if ((offsetof (struct gomp_work_share, inline_ordered_team_ids)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
295 & (__alignof__ (long long) - 1)) == 0)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
296 *mem = (void *) thr->ts.work_share->ordered_team_ids;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
297 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
298 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
299 uintptr_t p = (uintptr_t) thr->ts.work_share->ordered_team_ids;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
300 p += __alignof__ (long long) - 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
301 p &= ~(__alignof__ (long long) - 1);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
302 *mem = (void *) p;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
303 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
304 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
305 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
306
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
307 if (!istart)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
308 return true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
309 return ialias_call (GOMP_loop_runtime_next) (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
310 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
311
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 /* The *_ordered_*_start routines are similar. The only difference is that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 this work-share construct is initialized to expect an ORDERED section. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 gomp_loop_ordered_static_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 thr->ts.static_trip = 0;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
322 if (gomp_work_share_start (1))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 GFS_STATIC, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 gomp_ordered_static_init ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 return !gomp_iter_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 gomp_loop_ordered_dynamic_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
340 if (gomp_work_share_start (1))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 GFS_DYNAMIC, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 ret = gomp_iter_dynamic_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 if (ret)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 gomp_ordered_first ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 gomp_loop_ordered_guided_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
365 if (gomp_work_share_start (1))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 gomp_loop_init (thr->ts.work_share, start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 GFS_GUIDED, chunk_size);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 gomp_work_share_init_done ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 ret = gomp_iter_guided_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 if (ret)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 gomp_ordered_first ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
379
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384 GOMP_loop_ordered_runtime_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 struct gomp_task_icv *icv = gomp_icv (false);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
388 switch (icv->run_sched_var & ~GFS_MONOTONIC)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 case GFS_STATIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 return gomp_loop_ordered_static_start (start, end, incr,
111
kono
parents: 0
diff changeset
392 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 case GFS_DYNAMIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 return gomp_loop_ordered_dynamic_start (start, end, incr,
111
kono
parents: 0
diff changeset
396 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 case GFS_GUIDED:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 return gomp_loop_ordered_guided_start (start, end, incr,
111
kono
parents: 0
diff changeset
400 icv->run_sched_chunk_size,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 case GFS_AUTO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 /* For now map to schedule(static), later on we could play with feedback
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 driven choice. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 return gomp_loop_ordered_static_start (start, end, incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 0, istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 abort ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
412 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
413 GOMP_loop_ordered_start (long start, long end, long incr, long sched,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
414 long chunk_size, long *istart, long *iend,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
415 uintptr_t *reductions, void **mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
416 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
417 struct gomp_thread *thr = gomp_thread ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
418 size_t ordered = 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
419 bool ret;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
420
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
421 thr->ts.static_trip = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
422 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
423 gomp_workshare_taskgroup_start ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
424 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
425 ordered += (uintptr_t) *mem;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
426 if (gomp_work_share_start (ordered))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
427 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
428 sched = gomp_adjust_sched (sched, &chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
429 gomp_loop_init (thr->ts.work_share, start, end, incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
430 sched, chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
431 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
432 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
433 GOMP_taskgroup_reduction_register (reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
434 thr->task->taskgroup->workshare = true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
435 thr->ts.work_share->task_reductions = reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
436 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
437 if (sched == GFS_STATIC)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
438 gomp_ordered_static_init ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
439 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
440 gomp_mutex_lock (&thr->ts.work_share->lock);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
441 gomp_work_share_init_done ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
442 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
443 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
444 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
445 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
446 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
447 uintptr_t *first_reductions = thr->ts.work_share->task_reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
448 gomp_workshare_task_reduction_register (reductions,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
449 first_reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
450 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
451 sched = thr->ts.work_share->sched;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
452 if (sched != GFS_STATIC)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
453 gomp_mutex_lock (&thr->ts.work_share->lock);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
454 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
455
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
456 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
457 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
458 uintptr_t p
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
459 = (uintptr_t) (thr->ts.work_share->ordered_team_ids
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
460 + (thr->ts.team ? thr->ts.team->nthreads : 1));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
461 p += __alignof__ (long long) - 1;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
462 p &= ~(__alignof__ (long long) - 1);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
463 *mem = (void *) p;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
464 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
465
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
466 switch (sched)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
467 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
468 case GFS_STATIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
469 case GFS_AUTO:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
470 return !gomp_iter_static_next (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
471 case GFS_DYNAMIC:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
472 ret = gomp_iter_dynamic_next_locked (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
473 break;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
474 case GFS_GUIDED:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
475 ret = gomp_iter_guided_next_locked (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
476 break;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
477 default:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
478 abort ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
479 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
480
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
481 if (ret)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
482 gomp_ordered_first ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
483 gomp_mutex_unlock (&thr->ts.work_share->lock);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
484 return ret;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
485 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
486
111
kono
parents: 0
diff changeset
487 /* The *_doacross_*_start routines are similar. The only difference is that
kono
parents: 0
diff changeset
488 this work-share construct is initialized to expect an ORDERED(N) - DOACROSS
kono
parents: 0
diff changeset
489 section, and the worksharing loop iterates always from 0 to COUNTS[0] - 1
kono
parents: 0
diff changeset
490 and other COUNTS array elements tell the library number of iterations
kono
parents: 0
diff changeset
491 in the ordered inner loops. */
kono
parents: 0
diff changeset
492
kono
parents: 0
diff changeset
493 static bool
kono
parents: 0
diff changeset
494 gomp_loop_doacross_static_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
495 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
496 {
kono
parents: 0
diff changeset
497 struct gomp_thread *thr = gomp_thread ();
kono
parents: 0
diff changeset
498
kono
parents: 0
diff changeset
499 thr->ts.static_trip = 0;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
500 if (gomp_work_share_start (0))
111
kono
parents: 0
diff changeset
501 {
kono
parents: 0
diff changeset
502 gomp_loop_init (thr->ts.work_share, 0, counts[0], 1,
kono
parents: 0
diff changeset
503 GFS_STATIC, chunk_size);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
504 gomp_doacross_init (ncounts, counts, chunk_size, 0);
111
kono
parents: 0
diff changeset
505 gomp_work_share_init_done ();
kono
parents: 0
diff changeset
506 }
kono
parents: 0
diff changeset
507
kono
parents: 0
diff changeset
508 return !gomp_iter_static_next (istart, iend);
kono
parents: 0
diff changeset
509 }
kono
parents: 0
diff changeset
510
kono
parents: 0
diff changeset
511 static bool
kono
parents: 0
diff changeset
512 gomp_loop_doacross_dynamic_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
513 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
514 {
kono
parents: 0
diff changeset
515 struct gomp_thread *thr = gomp_thread ();
kono
parents: 0
diff changeset
516 bool ret;
kono
parents: 0
diff changeset
517
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
518 if (gomp_work_share_start (0))
111
kono
parents: 0
diff changeset
519 {
kono
parents: 0
diff changeset
520 gomp_loop_init (thr->ts.work_share, 0, counts[0], 1,
kono
parents: 0
diff changeset
521 GFS_DYNAMIC, chunk_size);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
522 gomp_doacross_init (ncounts, counts, chunk_size, 0);
111
kono
parents: 0
diff changeset
523 gomp_work_share_init_done ();
kono
parents: 0
diff changeset
524 }
kono
parents: 0
diff changeset
525
kono
parents: 0
diff changeset
526 #ifdef HAVE_SYNC_BUILTINS
kono
parents: 0
diff changeset
527 ret = gomp_iter_dynamic_next (istart, iend);
kono
parents: 0
diff changeset
528 #else
kono
parents: 0
diff changeset
529 gomp_mutex_lock (&thr->ts.work_share->lock);
kono
parents: 0
diff changeset
530 ret = gomp_iter_dynamic_next_locked (istart, iend);
kono
parents: 0
diff changeset
531 gomp_mutex_unlock (&thr->ts.work_share->lock);
kono
parents: 0
diff changeset
532 #endif
kono
parents: 0
diff changeset
533
kono
parents: 0
diff changeset
534 return ret;
kono
parents: 0
diff changeset
535 }
kono
parents: 0
diff changeset
536
kono
parents: 0
diff changeset
537 static bool
kono
parents: 0
diff changeset
538 gomp_loop_doacross_guided_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
539 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
540 {
kono
parents: 0
diff changeset
541 struct gomp_thread *thr = gomp_thread ();
kono
parents: 0
diff changeset
542 bool ret;
kono
parents: 0
diff changeset
543
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
544 if (gomp_work_share_start (0))
111
kono
parents: 0
diff changeset
545 {
kono
parents: 0
diff changeset
546 gomp_loop_init (thr->ts.work_share, 0, counts[0], 1,
kono
parents: 0
diff changeset
547 GFS_GUIDED, chunk_size);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
548 gomp_doacross_init (ncounts, counts, chunk_size, 0);
111
kono
parents: 0
diff changeset
549 gomp_work_share_init_done ();
kono
parents: 0
diff changeset
550 }
kono
parents: 0
diff changeset
551
kono
parents: 0
diff changeset
552 #ifdef HAVE_SYNC_BUILTINS
kono
parents: 0
diff changeset
553 ret = gomp_iter_guided_next (istart, iend);
kono
parents: 0
diff changeset
554 #else
kono
parents: 0
diff changeset
555 gomp_mutex_lock (&thr->ts.work_share->lock);
kono
parents: 0
diff changeset
556 ret = gomp_iter_guided_next_locked (istart, iend);
kono
parents: 0
diff changeset
557 gomp_mutex_unlock (&thr->ts.work_share->lock);
kono
parents: 0
diff changeset
558 #endif
kono
parents: 0
diff changeset
559
kono
parents: 0
diff changeset
560 return ret;
kono
parents: 0
diff changeset
561 }
kono
parents: 0
diff changeset
562
kono
parents: 0
diff changeset
563 bool
kono
parents: 0
diff changeset
564 GOMP_loop_doacross_runtime_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
565 long *istart, long *iend)
kono
parents: 0
diff changeset
566 {
kono
parents: 0
diff changeset
567 struct gomp_task_icv *icv = gomp_icv (false);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
568 switch (icv->run_sched_var & ~GFS_MONOTONIC)
111
kono
parents: 0
diff changeset
569 {
kono
parents: 0
diff changeset
570 case GFS_STATIC:
kono
parents: 0
diff changeset
571 return gomp_loop_doacross_static_start (ncounts, counts,
kono
parents: 0
diff changeset
572 icv->run_sched_chunk_size,
kono
parents: 0
diff changeset
573 istart, iend);
kono
parents: 0
diff changeset
574 case GFS_DYNAMIC:
kono
parents: 0
diff changeset
575 return gomp_loop_doacross_dynamic_start (ncounts, counts,
kono
parents: 0
diff changeset
576 icv->run_sched_chunk_size,
kono
parents: 0
diff changeset
577 istart, iend);
kono
parents: 0
diff changeset
578 case GFS_GUIDED:
kono
parents: 0
diff changeset
579 return gomp_loop_doacross_guided_start (ncounts, counts,
kono
parents: 0
diff changeset
580 icv->run_sched_chunk_size,
kono
parents: 0
diff changeset
581 istart, iend);
kono
parents: 0
diff changeset
582 case GFS_AUTO:
kono
parents: 0
diff changeset
583 /* For now map to schedule(static), later on we could play with feedback
kono
parents: 0
diff changeset
584 driven choice. */
kono
parents: 0
diff changeset
585 return gomp_loop_doacross_static_start (ncounts, counts,
kono
parents: 0
diff changeset
586 0, istart, iend);
kono
parents: 0
diff changeset
587 default:
kono
parents: 0
diff changeset
588 abort ();
kono
parents: 0
diff changeset
589 }
kono
parents: 0
diff changeset
590 }
kono
parents: 0
diff changeset
591
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
592 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
593 GOMP_loop_doacross_start (unsigned ncounts, long *counts, long sched,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
594 long chunk_size, long *istart, long *iend,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
595 uintptr_t *reductions, void **mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
596 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
597 struct gomp_thread *thr = gomp_thread ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
598
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
599 thr->ts.static_trip = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
600 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
601 gomp_workshare_taskgroup_start ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
602 if (gomp_work_share_start (0))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
603 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
604 size_t extra = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
605 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
606 extra = (uintptr_t) *mem;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
607 sched = gomp_adjust_sched (sched, &chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
608 gomp_loop_init (thr->ts.work_share, 0, counts[0], 1,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
609 sched, chunk_size);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
610 gomp_doacross_init (ncounts, counts, chunk_size, extra);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
611 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
612 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
613 GOMP_taskgroup_reduction_register (reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
614 thr->task->taskgroup->workshare = true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
615 thr->ts.work_share->task_reductions = reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
616 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
617 gomp_work_share_init_done ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
618 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
619 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
620 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
621 if (reductions)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
622 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
623 uintptr_t *first_reductions = thr->ts.work_share->task_reductions;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
624 gomp_workshare_task_reduction_register (reductions,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
625 first_reductions);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
626 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
627 sched = thr->ts.work_share->sched;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
628 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
629
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
630 if (mem)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
631 *mem = thr->ts.work_share->doacross->extra;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
632
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
633 return ialias_call (GOMP_loop_runtime_next) (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
634 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
635
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
636 /* The *_next routines are called when the thread completes processing of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
637 the iteration block currently assigned to it. If the work-share
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 construct is bound directly to a parallel construct, then the iteration
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 bounds may have been set up before the parallel. In which case, this
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640 may be the first iteration for the thread.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 Returns true if there is work remaining to be performed; *ISTART and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 *IEND are filled with a new iteration block. Returns false if all work
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 has been assigned. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 gomp_loop_static_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 return !gomp_iter_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 gomp_loop_dynamic_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
656
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 #ifdef HAVE_SYNC_BUILTINS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 ret = gomp_iter_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
662 ret = gomp_iter_dynamic_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
669 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 gomp_loop_guided_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
672 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
674 #ifdef HAVE_SYNC_BUILTINS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
675 ret = gomp_iter_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
676 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 ret = gomp_iter_guided_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
681 #endif
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 GOMP_loop_runtime_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 struct gomp_thread *thr = gomp_thread ();
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
690
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 switch (thr->ts.work_share->sched)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
692 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 case GFS_STATIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 case GFS_AUTO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 return gomp_loop_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 case GFS_DYNAMIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 return gomp_loop_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 case GFS_GUIDED:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 return gomp_loop_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
700 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 abort ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 /* The *_ordered_*_next routines are called when the thread completes
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706 processing of the iteration block currently assigned to it.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708 Returns true if there is work remaining to be performed; *ISTART and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709 *IEND are filled with a new iteration block. Returns false if all work
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 has been assigned. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
712 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
713 gomp_loop_ordered_static_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
714 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
715 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 int test;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
717
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
718 gomp_ordered_sync ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
719 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
720 test = gomp_iter_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
721 if (test >= 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
722 gomp_ordered_static_next ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
723 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
724
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 return test == 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
726 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
727
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
728 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
729 gomp_loop_ordered_dynamic_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
730 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
731 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
732 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
733
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
734 gomp_ordered_sync ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
735 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
736 ret = gomp_iter_dynamic_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
737 if (ret)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
738 gomp_ordered_next ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
739 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
740 gomp_ordered_last ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
741 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
742
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
743 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
744 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
745
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
746 static bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
747 gomp_loop_ordered_guided_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
748 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
749 struct gomp_thread *thr = gomp_thread ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
750 bool ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
751
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
752 gomp_ordered_sync ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
753 gomp_mutex_lock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
754 ret = gomp_iter_guided_next_locked (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
755 if (ret)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
756 gomp_ordered_next ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
757 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
758 gomp_ordered_last ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
759 gomp_mutex_unlock (&thr->ts.work_share->lock);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
760
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
761 return ret;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
762 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
763
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
764 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
765 GOMP_loop_ordered_runtime_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
766 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
767 struct gomp_thread *thr = gomp_thread ();
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
768
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
769 switch (thr->ts.work_share->sched)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
770 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
771 case GFS_STATIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
772 case GFS_AUTO:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
773 return gomp_loop_ordered_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
774 case GFS_DYNAMIC:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
775 return gomp_loop_ordered_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
776 case GFS_GUIDED:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
777 return gomp_loop_ordered_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
778 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
779 abort ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
780 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
781 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
782
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
783 /* The GOMP_parallel_loop_* routines pre-initialize a work-share construct
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
784 to avoid one synchronization once we get into the loop. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
785
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
786 static void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
787 gomp_parallel_loop_start (void (*fn) (void *), void *data,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
788 unsigned num_threads, long start, long end,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
789 long incr, enum gomp_schedule_type sched,
111
kono
parents: 0
diff changeset
790 long chunk_size, unsigned int flags)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
791 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
792 struct gomp_team *team;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
793
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
794 num_threads = gomp_resolve_num_threads (num_threads, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
795 team = gomp_new_team (num_threads);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
796 gomp_loop_init (&team->work_shares[0], start, end, incr, sched, chunk_size);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
797 gomp_team_start (fn, data, num_threads, flags, team, NULL);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
798 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
799
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
800 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
801 GOMP_parallel_loop_static_start (void (*fn) (void *), void *data,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
802 unsigned num_threads, long start, long end,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
803 long incr, long chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
804 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
805 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
111
kono
parents: 0
diff changeset
806 GFS_STATIC, chunk_size, 0);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
807 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
808
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
809 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
810 GOMP_parallel_loop_dynamic_start (void (*fn) (void *), void *data,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
811 unsigned num_threads, long start, long end,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
812 long incr, long chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
813 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
814 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
111
kono
parents: 0
diff changeset
815 GFS_DYNAMIC, chunk_size, 0);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
816 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
817
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
818 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
819 GOMP_parallel_loop_guided_start (void (*fn) (void *), void *data,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
820 unsigned num_threads, long start, long end,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
821 long incr, long chunk_size)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
822 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
823 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
111
kono
parents: 0
diff changeset
824 GFS_GUIDED, chunk_size, 0);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
825 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
826
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
827 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
828 GOMP_parallel_loop_runtime_start (void (*fn) (void *), void *data,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
829 unsigned num_threads, long start, long end,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
830 long incr)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
831 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
832 struct gomp_task_icv *icv = gomp_icv (false);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
833 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
834 icv->run_sched_var & ~GFS_MONOTONIC,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
835 icv->run_sched_chunk_size, 0);
111
kono
parents: 0
diff changeset
836 }
kono
parents: 0
diff changeset
837
kono
parents: 0
diff changeset
838 ialias_redirect (GOMP_parallel_end)
kono
parents: 0
diff changeset
839
kono
parents: 0
diff changeset
840 void
kono
parents: 0
diff changeset
841 GOMP_parallel_loop_static (void (*fn) (void *), void *data,
kono
parents: 0
diff changeset
842 unsigned num_threads, long start, long end,
kono
parents: 0
diff changeset
843 long incr, long chunk_size, unsigned flags)
kono
parents: 0
diff changeset
844 {
kono
parents: 0
diff changeset
845 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
kono
parents: 0
diff changeset
846 GFS_STATIC, chunk_size, flags);
kono
parents: 0
diff changeset
847 fn (data);
kono
parents: 0
diff changeset
848 GOMP_parallel_end ();
kono
parents: 0
diff changeset
849 }
kono
parents: 0
diff changeset
850
kono
parents: 0
diff changeset
851 void
kono
parents: 0
diff changeset
852 GOMP_parallel_loop_dynamic (void (*fn) (void *), void *data,
kono
parents: 0
diff changeset
853 unsigned num_threads, long start, long end,
kono
parents: 0
diff changeset
854 long incr, long chunk_size, unsigned flags)
kono
parents: 0
diff changeset
855 {
kono
parents: 0
diff changeset
856 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
kono
parents: 0
diff changeset
857 GFS_DYNAMIC, chunk_size, flags);
kono
parents: 0
diff changeset
858 fn (data);
kono
parents: 0
diff changeset
859 GOMP_parallel_end ();
kono
parents: 0
diff changeset
860 }
kono
parents: 0
diff changeset
861
kono
parents: 0
diff changeset
862 void
kono
parents: 0
diff changeset
863 GOMP_parallel_loop_guided (void (*fn) (void *), void *data,
kono
parents: 0
diff changeset
864 unsigned num_threads, long start, long end,
kono
parents: 0
diff changeset
865 long incr, long chunk_size, unsigned flags)
kono
parents: 0
diff changeset
866 {
kono
parents: 0
diff changeset
867 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
kono
parents: 0
diff changeset
868 GFS_GUIDED, chunk_size, flags);
kono
parents: 0
diff changeset
869 fn (data);
kono
parents: 0
diff changeset
870 GOMP_parallel_end ();
kono
parents: 0
diff changeset
871 }
kono
parents: 0
diff changeset
872
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
873 void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
874 GOMP_parallel_loop_runtime (void (*fn) (void *), void *data,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
875 unsigned num_threads, long start, long end,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
876 long incr, unsigned flags)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
877 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
878 struct gomp_task_icv *icv = gomp_icv (false);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
879 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
880 icv->run_sched_var & ~GFS_MONOTONIC,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
881 icv->run_sched_chunk_size, flags);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
882 fn (data);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
883 GOMP_parallel_end ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
884 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
885
111
kono
parents: 0
diff changeset
886 #ifdef HAVE_ATTRIBUTE_ALIAS
kono
parents: 0
diff changeset
887 extern __typeof(GOMP_parallel_loop_dynamic) GOMP_parallel_loop_nonmonotonic_dynamic
kono
parents: 0
diff changeset
888 __attribute__((alias ("GOMP_parallel_loop_dynamic")));
kono
parents: 0
diff changeset
889 extern __typeof(GOMP_parallel_loop_guided) GOMP_parallel_loop_nonmonotonic_guided
kono
parents: 0
diff changeset
890 __attribute__((alias ("GOMP_parallel_loop_guided")));
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
891 extern __typeof(GOMP_parallel_loop_runtime) GOMP_parallel_loop_nonmonotonic_runtime
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
892 __attribute__((alias ("GOMP_parallel_loop_runtime")));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
893 extern __typeof(GOMP_parallel_loop_runtime) GOMP_parallel_loop_maybe_nonmonotonic_runtime
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
894 __attribute__((alias ("GOMP_parallel_loop_runtime")));
111
kono
parents: 0
diff changeset
895 #else
kono
parents: 0
diff changeset
896 void
kono
parents: 0
diff changeset
897 GOMP_parallel_loop_nonmonotonic_dynamic (void (*fn) (void *), void *data,
kono
parents: 0
diff changeset
898 unsigned num_threads, long start,
kono
parents: 0
diff changeset
899 long end, long incr, long chunk_size,
kono
parents: 0
diff changeset
900 unsigned flags)
kono
parents: 0
diff changeset
901 {
kono
parents: 0
diff changeset
902 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
kono
parents: 0
diff changeset
903 GFS_DYNAMIC, chunk_size, flags);
kono
parents: 0
diff changeset
904 fn (data);
kono
parents: 0
diff changeset
905 GOMP_parallel_end ();
kono
parents: 0
diff changeset
906 }
kono
parents: 0
diff changeset
907
kono
parents: 0
diff changeset
908 void
kono
parents: 0
diff changeset
909 GOMP_parallel_loop_nonmonotonic_guided (void (*fn) (void *), void *data,
kono
parents: 0
diff changeset
910 unsigned num_threads, long start,
kono
parents: 0
diff changeset
911 long end, long incr, long chunk_size,
kono
parents: 0
diff changeset
912 unsigned flags)
kono
parents: 0
diff changeset
913 {
kono
parents: 0
diff changeset
914 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
kono
parents: 0
diff changeset
915 GFS_GUIDED, chunk_size, flags);
kono
parents: 0
diff changeset
916 fn (data);
kono
parents: 0
diff changeset
917 GOMP_parallel_end ();
kono
parents: 0
diff changeset
918 }
kono
parents: 0
diff changeset
919
kono
parents: 0
diff changeset
920 void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
921 GOMP_parallel_loop_nonmonotonic_runtime (void (*fn) (void *), void *data,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
922 unsigned num_threads, long start,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
923 long end, long incr, unsigned flags)
111
kono
parents: 0
diff changeset
924 {
kono
parents: 0
diff changeset
925 struct gomp_task_icv *icv = gomp_icv (false);
kono
parents: 0
diff changeset
926 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
927 icv->run_sched_var & ~GFS_MONOTONIC,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
928 icv->run_sched_chunk_size, flags);
111
kono
parents: 0
diff changeset
929 fn (data);
kono
parents: 0
diff changeset
930 GOMP_parallel_end ();
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
931 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
932
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
933 void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
934 GOMP_parallel_loop_maybe_nonmonotonic_runtime (void (*fn) (void *), void *data,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
935 unsigned num_threads, long start,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
936 long end, long incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
937 unsigned flags)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
938 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
939 struct gomp_task_icv *icv = gomp_icv (false);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
940 gomp_parallel_loop_start (fn, data, num_threads, start, end, incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
941 icv->run_sched_var & ~GFS_MONOTONIC,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
942 icv->run_sched_chunk_size, flags);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
943 fn (data);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
944 GOMP_parallel_end ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
945 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
946 #endif
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
947
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
948 /* The GOMP_loop_end* routines are called after the thread is told that
111
kono
parents: 0
diff changeset
949 all loop iterations are complete. The first two versions synchronize
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
950 all threads; the nowait version does not. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
951
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
952 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
953 GOMP_loop_end (void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
954 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
955 gomp_work_share_end ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
956 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
957
111
kono
parents: 0
diff changeset
958 bool
kono
parents: 0
diff changeset
959 GOMP_loop_end_cancel (void)
kono
parents: 0
diff changeset
960 {
kono
parents: 0
diff changeset
961 return gomp_work_share_end_cancel ();
kono
parents: 0
diff changeset
962 }
kono
parents: 0
diff changeset
963
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
964 void
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
965 GOMP_loop_end_nowait (void)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
966 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
967 gomp_work_share_end_nowait ();
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
968 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
969
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
970
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
971 /* We use static functions above so that we're sure that the "runtime"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
972 function can defer to the proper routine without interposition. We
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
973 export the static function with a strong alias when possible, or with
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
974 a wrapper function otherwise. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
975
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
976 #ifdef HAVE_ATTRIBUTE_ALIAS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
977 extern __typeof(gomp_loop_static_start) GOMP_loop_static_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
978 __attribute__((alias ("gomp_loop_static_start")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
979 extern __typeof(gomp_loop_dynamic_start) GOMP_loop_dynamic_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
980 __attribute__((alias ("gomp_loop_dynamic_start")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
981 extern __typeof(gomp_loop_guided_start) GOMP_loop_guided_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
982 __attribute__((alias ("gomp_loop_guided_start")));
111
kono
parents: 0
diff changeset
983 extern __typeof(gomp_loop_dynamic_start) GOMP_loop_nonmonotonic_dynamic_start
kono
parents: 0
diff changeset
984 __attribute__((alias ("gomp_loop_dynamic_start")));
kono
parents: 0
diff changeset
985 extern __typeof(gomp_loop_guided_start) GOMP_loop_nonmonotonic_guided_start
kono
parents: 0
diff changeset
986 __attribute__((alias ("gomp_loop_guided_start")));
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
987 extern __typeof(GOMP_loop_runtime_start) GOMP_loop_nonmonotonic_runtime_start
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
988 __attribute__((alias ("GOMP_loop_runtime_start")));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
989 extern __typeof(GOMP_loop_runtime_start) GOMP_loop_maybe_nonmonotonic_runtime_start
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
990 __attribute__((alias ("GOMP_loop_runtime_start")));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
991
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
992 extern __typeof(gomp_loop_ordered_static_start) GOMP_loop_ordered_static_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
993 __attribute__((alias ("gomp_loop_ordered_static_start")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
994 extern __typeof(gomp_loop_ordered_dynamic_start) GOMP_loop_ordered_dynamic_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
995 __attribute__((alias ("gomp_loop_ordered_dynamic_start")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
996 extern __typeof(gomp_loop_ordered_guided_start) GOMP_loop_ordered_guided_start
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
997 __attribute__((alias ("gomp_loop_ordered_guided_start")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
998
111
kono
parents: 0
diff changeset
999 extern __typeof(gomp_loop_doacross_static_start) GOMP_loop_doacross_static_start
kono
parents: 0
diff changeset
1000 __attribute__((alias ("gomp_loop_doacross_static_start")));
kono
parents: 0
diff changeset
1001 extern __typeof(gomp_loop_doacross_dynamic_start) GOMP_loop_doacross_dynamic_start
kono
parents: 0
diff changeset
1002 __attribute__((alias ("gomp_loop_doacross_dynamic_start")));
kono
parents: 0
diff changeset
1003 extern __typeof(gomp_loop_doacross_guided_start) GOMP_loop_doacross_guided_start
kono
parents: 0
diff changeset
1004 __attribute__((alias ("gomp_loop_doacross_guided_start")));
kono
parents: 0
diff changeset
1005
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1006 extern __typeof(gomp_loop_static_next) GOMP_loop_static_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1007 __attribute__((alias ("gomp_loop_static_next")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1008 extern __typeof(gomp_loop_dynamic_next) GOMP_loop_dynamic_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1009 __attribute__((alias ("gomp_loop_dynamic_next")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1010 extern __typeof(gomp_loop_guided_next) GOMP_loop_guided_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1011 __attribute__((alias ("gomp_loop_guided_next")));
111
kono
parents: 0
diff changeset
1012 extern __typeof(gomp_loop_dynamic_next) GOMP_loop_nonmonotonic_dynamic_next
kono
parents: 0
diff changeset
1013 __attribute__((alias ("gomp_loop_dynamic_next")));
kono
parents: 0
diff changeset
1014 extern __typeof(gomp_loop_guided_next) GOMP_loop_nonmonotonic_guided_next
kono
parents: 0
diff changeset
1015 __attribute__((alias ("gomp_loop_guided_next")));
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1016 extern __typeof(GOMP_loop_runtime_next) GOMP_loop_nonmonotonic_runtime_next
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1017 __attribute__((alias ("GOMP_loop_runtime_next")));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1018 extern __typeof(GOMP_loop_runtime_next) GOMP_loop_maybe_nonmonotonic_runtime_next
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1019 __attribute__((alias ("GOMP_loop_runtime_next")));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1020
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1021 extern __typeof(gomp_loop_ordered_static_next) GOMP_loop_ordered_static_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1022 __attribute__((alias ("gomp_loop_ordered_static_next")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1023 extern __typeof(gomp_loop_ordered_dynamic_next) GOMP_loop_ordered_dynamic_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1024 __attribute__((alias ("gomp_loop_ordered_dynamic_next")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1025 extern __typeof(gomp_loop_ordered_guided_next) GOMP_loop_ordered_guided_next
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1026 __attribute__((alias ("gomp_loop_ordered_guided_next")));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1027 #else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1028 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1029 GOMP_loop_static_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1030 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1031 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1032 return gomp_loop_static_start (start, end, incr, chunk_size, istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1033 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1034
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1035 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1036 GOMP_loop_dynamic_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1037 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1038 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1039 return gomp_loop_dynamic_start (start, end, incr, chunk_size, istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1040 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1041
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1042 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1043 GOMP_loop_guided_start (long start, long end, long incr, long chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1044 long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1045 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1046 return gomp_loop_guided_start (start, end, incr, chunk_size, istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1047 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1048
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1049 bool
111
kono
parents: 0
diff changeset
1050 GOMP_loop_nonmonotonic_dynamic_start (long start, long end, long incr,
kono
parents: 0
diff changeset
1051 long chunk_size, long *istart,
kono
parents: 0
diff changeset
1052 long *iend)
kono
parents: 0
diff changeset
1053 {
kono
parents: 0
diff changeset
1054 return gomp_loop_dynamic_start (start, end, incr, chunk_size, istart, iend);
kono
parents: 0
diff changeset
1055 }
kono
parents: 0
diff changeset
1056
kono
parents: 0
diff changeset
1057 bool
kono
parents: 0
diff changeset
1058 GOMP_loop_nonmonotonic_guided_start (long start, long end, long incr,
kono
parents: 0
diff changeset
1059 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
1060 {
kono
parents: 0
diff changeset
1061 return gomp_loop_guided_start (start, end, incr, chunk_size, istart, iend);
kono
parents: 0
diff changeset
1062 }
kono
parents: 0
diff changeset
1063
kono
parents: 0
diff changeset
1064 bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1065 GOMP_loop_nonmonotonic_runtime_start (long start, long end, long incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1066 long *istart, long *iend)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1067 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1068 return GOMP_loop_runtime_start (start, end, incr, istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1069 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1070
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1071 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1072 GOMP_loop_maybe_nonmonotonic_runtime_start (long start, long end, long incr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1073 long *istart, long *iend)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1074 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1075 return GOMP_loop_runtime_start (start, end, incr, istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1076 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1077
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1078 bool
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1079 GOMP_loop_ordered_static_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1080 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1081 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1082 return gomp_loop_ordered_static_start (start, end, incr, chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1083 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1084 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1085
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1086 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1087 GOMP_loop_ordered_dynamic_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1088 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1089 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1090 return gomp_loop_ordered_dynamic_start (start, end, incr, chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1091 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1092 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1093
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1094 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1095 GOMP_loop_ordered_guided_start (long start, long end, long incr,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1096 long chunk_size, long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1097 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1098 return gomp_loop_ordered_guided_start (start, end, incr, chunk_size,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1099 istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1100 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1101
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1102 bool
111
kono
parents: 0
diff changeset
1103 GOMP_loop_doacross_static_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
1104 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
1105 {
kono
parents: 0
diff changeset
1106 return gomp_loop_doacross_static_start (ncounts, counts, chunk_size,
kono
parents: 0
diff changeset
1107 istart, iend);
kono
parents: 0
diff changeset
1108 }
kono
parents: 0
diff changeset
1109
kono
parents: 0
diff changeset
1110 bool
kono
parents: 0
diff changeset
1111 GOMP_loop_doacross_dynamic_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
1112 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
1113 {
kono
parents: 0
diff changeset
1114 return gomp_loop_doacross_dynamic_start (ncounts, counts, chunk_size,
kono
parents: 0
diff changeset
1115 istart, iend);
kono
parents: 0
diff changeset
1116 }
kono
parents: 0
diff changeset
1117
kono
parents: 0
diff changeset
1118 bool
kono
parents: 0
diff changeset
1119 GOMP_loop_doacross_guided_start (unsigned ncounts, long *counts,
kono
parents: 0
diff changeset
1120 long chunk_size, long *istart, long *iend)
kono
parents: 0
diff changeset
1121 {
kono
parents: 0
diff changeset
1122 return gomp_loop_doacross_guided_start (ncounts, counts, chunk_size,
kono
parents: 0
diff changeset
1123 istart, iend);
kono
parents: 0
diff changeset
1124 }
kono
parents: 0
diff changeset
1125
kono
parents: 0
diff changeset
1126 bool
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1127 GOMP_loop_static_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1128 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1129 return gomp_loop_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1130 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1131
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1132 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1133 GOMP_loop_dynamic_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1134 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1135 return gomp_loop_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1136 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1137
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1138 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1139 GOMP_loop_guided_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1140 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1141 return gomp_loop_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1142 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1143
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1144 bool
111
kono
parents: 0
diff changeset
1145 GOMP_loop_nonmonotonic_dynamic_next (long *istart, long *iend)
kono
parents: 0
diff changeset
1146 {
kono
parents: 0
diff changeset
1147 return gomp_loop_dynamic_next (istart, iend);
kono
parents: 0
diff changeset
1148 }
kono
parents: 0
diff changeset
1149
kono
parents: 0
diff changeset
1150 bool
kono
parents: 0
diff changeset
1151 GOMP_loop_nonmonotonic_guided_next (long *istart, long *iend)
kono
parents: 0
diff changeset
1152 {
kono
parents: 0
diff changeset
1153 return gomp_loop_guided_next (istart, iend);
kono
parents: 0
diff changeset
1154 }
kono
parents: 0
diff changeset
1155
kono
parents: 0
diff changeset
1156 bool
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1157 GOMP_loop_nonmonotonic_runtime_next (long *istart, long *iend)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1158 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1159 return GOMP_loop_runtime_next (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1160 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1161
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1162 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1163 GOMP_loop_maybe_nonmonotonic_runtime_next (long *istart, long *iend)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1164 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1165 return GOMP_loop_runtime_next (istart, iend);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1166 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1167
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1168 bool
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1169 GOMP_loop_ordered_static_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1170 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1171 return gomp_loop_ordered_static_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1172 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1173
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1174 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1175 GOMP_loop_ordered_dynamic_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1176 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1177 return gomp_loop_ordered_dynamic_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1178 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1179
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1180 bool
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1181 GOMP_loop_ordered_guided_next (long *istart, long *iend)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1182 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1183 return gomp_loop_ordered_guided_next (istart, iend);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1184 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1185 #endif