comparison libgomp/sections.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents b7f97abdc517
children 84e7813d76e9
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 /* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 1 /* Copyright (C) 2005-2017 Free Software Foundation, Inc.
2 Contributed by Richard Henderson <rth@redhat.com>. 2 Contributed by Richard Henderson <rth@redhat.com>.
3 3
4 This file is part of the GNU OpenMP Library (libgomp). 4 This file is part of the GNU Offloading and Multi Processing Library
5 (libgomp).
5 6
6 Libgomp is free software; you can redistribute it and/or modify it 7 Libgomp is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by 8 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option) 9 the Free Software Foundation; either version 3, or (at your option)
9 any later version. 10 any later version.
137 struct gomp_team *team; 138 struct gomp_team *team;
138 139
139 num_threads = gomp_resolve_num_threads (num_threads, count); 140 num_threads = gomp_resolve_num_threads (num_threads, count);
140 team = gomp_new_team (num_threads); 141 team = gomp_new_team (num_threads);
141 gomp_sections_init (&team->work_shares[0], count); 142 gomp_sections_init (&team->work_shares[0], count);
142 gomp_team_start (fn, data, num_threads, team); 143 gomp_team_start (fn, data, num_threads, 0, team);
144 }
145
146 ialias_redirect (GOMP_parallel_end)
147
148 void
149 GOMP_parallel_sections (void (*fn) (void *), void *data,
150 unsigned num_threads, unsigned count, unsigned flags)
151 {
152 struct gomp_team *team;
153
154 num_threads = gomp_resolve_num_threads (num_threads, count);
155 team = gomp_new_team (num_threads);
156 gomp_sections_init (&team->work_shares[0], count);
157 gomp_team_start (fn, data, num_threads, flags, team);
158 fn (data);
159 GOMP_parallel_end ();
143 } 160 }
144 161
145 /* The GOMP_section_end* routines are called after the thread is told 162 /* The GOMP_section_end* routines are called after the thread is told
146 that all sections are complete. This first version synchronizes 163 that all sections are complete. The first two versions synchronize
147 all threads; the nowait version does not. */ 164 all threads; the nowait version does not. */
148 165
149 void 166 void
150 GOMP_sections_end (void) 167 GOMP_sections_end (void)
151 { 168 {
152 gomp_work_share_end (); 169 gomp_work_share_end ();
153 } 170 }
154 171
172 bool
173 GOMP_sections_end_cancel (void)
174 {
175 return gomp_work_share_end_cancel ();
176 }
177
155 void 178 void
156 GOMP_sections_end_nowait (void) 179 GOMP_sections_end_nowait (void)
157 { 180 {
158 gomp_work_share_end_nowait (); 181 gomp_work_share_end_nowait ();
159 } 182 }