Home | History | Annotate | Download | only in libgomp

Lines Matching defs:ws

41   struct gomp_work_share *ws;
47 ws = team->work_share_list_alloc;
48 team->work_share_list_alloc = ws->next_free;
49 return ws;
53 ws = team->work_share_list_free;
56 __asm ("" : "+r" (ws));
58 if (ws && ws->next_free)
60 struct gomp_work_share *next = ws->next_free;
61 ws->next_free = NULL;
67 ws = team->work_share_list_free;
68 if (ws)
70 team->work_share_list_alloc = ws->next_free;
73 return ws;
82 ws = gomp_aligned_alloc (__alignof (struct gomp_work_share),
86 ws = gomp_malloc (team->work_share_chunk * sizeof (struct gomp_work_share));
88 ws->next_alloc = team->work_shares[0].next_alloc;
89 team->work_shares[0].next_alloc = ws;
90 team->work_share_list_alloc = &ws[1];
92 ws[i].next_free = &ws[i + 1];
93 ws[i].next_free = NULL;
94 return ws;
101 gomp_init_work_share (struct gomp_work_share *ws, size_t ordered,
104 gomp_mutex_init (&ws->lock);
113 size_t o = nthreads * sizeof (*ws->ordered_team_ids);
123 ordered = nthreads * sizeof (*ws->ordered_team_ids);
125 ws->ordered_team_ids = team_malloc (ordered);
127 ws->ordered_team_ids = ws->inline_ordered_team_ids;
128 memset (ws->ordered_team_ids, '\0', ordered);
129 ws->ordered_num_used = 0;
130 ws->ordered_owner = -1;
131 ws->ordered_cur = 0;
134 ws->ordered_team_ids = ws->inline_ordered_team_ids;
135 gomp_ptrlock_init (&ws->next_ws, NULL);
136 ws->threads_completed = 0;
143 gomp_fini_work_share (struct gomp_work_share *ws)
145 gomp_mutex_destroy (&ws->lock);
146 if (ws->ordered_team_ids != ws->inline_ordered_team_ids)
147 team_free (ws->ordered_team_ids);
148 gomp_ptrlock_destroy (&ws->next_ws);
155 free_work_share (struct gomp_team *team, struct gomp_work_share *ws)
157 gomp_fini_work_share (ws);
159 free (ws);
167 ws->next_free = next_ws;
170 next_ws, ws));
174 ws->next_free = next_ws;
175 team->work_share_list_free = ws;
191 struct gomp_work_share *ws;
197 ws = gomp_aligned_alloc (__alignof (struct gomp_work_share),
198 sizeof (*ws));
200 ws = gomp_malloc (sizeof (*ws));
202 gomp_init_work_share (ws, ordered, 1);
203 thr->ts.work_share = ws;
207 ws = thr->ts.work_share;
208 thr->ts.last_work_share = ws;
209 ws = gomp_ptrlock_get (&ws->next_ws);
210 if (ws == NULL)
212 /* This thread encountered a new ws first. */
213 struct gomp_work_share *ws = alloc_work_share (team);
214 gomp_init_work_share (ws, ordered, team->nthreads);
215 thr->ts.work_share = ws;
220 thr->ts.work_share = ws;
292 struct gomp_work_share *ws = thr->ts.work_share;
298 free_work_share (NULL, ws);
307 completed = __sync_add_and_fetch (&ws->threads_completed, 1);
309 gomp_mutex_lock (&ws->lock);
310 completed = ++ws->threads_completed;
311 gomp_mutex_unlock (&ws->lock);