OpenACC acc_on_device.
[official-gcc.git] / libgomp / ChangeLog.gomp
blobabc38a6adbfb711c90cd103709b9d326d7b23d70
1 2014-09-23  Thomas Schwinge  <thomas@codesourcery.com>
3         * libgomp.map (OACC_2.0): Add acc_on_device, acc_on_device_.
4         * fortran.c: Include "openacc.h".
5         (acc_on_device_): New function.
6         * oacc-parallel.c: Include "openacc.h".
7         (acc_on_device): New function.
8         * openacc.f90 (acc_device_kind, acc_device_none)
9         (acc_device_default, acc_device_host, acc_device_not_host): New
10         parameters.
11         (acc_on_device): New function declaration.
12         * openacc_lib.h (acc_device_kind, acc_device_none)
13         (acc_device_default, acc_device_host, acc_device_not_host): New
14         parameters.
15         (acc_on_device): New function declaration.
16         * openacc.h (acc_device_t): New enum.
17         (acc_on_device): New function declaration.
18         * testsuite/libgomp.oacc-c/acc_on_device-1.c: New file.
19         * testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise.
20         * testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise.
21         * testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise.
23 2014-07-09  Thomas Schwinge  <thomas@codesourcery.com>
24             Jakub Jelinek  <jakub@redhat.com>
26         * target.c (gomp_map_vars, gomp_unmap_vars, gomp_update): Support
27         NULL mappings as well as mapping kind OMP_CLAUSE_MAP_TO_PSET.
28         Also, some code reformatting.
30 2014-06-06  Thomas Schwinge  <thomas@codesourcery.com>
31             James Norris  <jnorris@codesourcery.com>
33         * libgomp.map (GOACC_2.0): Add GOACC_update.
34         * oacc-parallel.c (GOACC_update): New function.
36 2014-03-18  Ilya Verbin  <ilya.verbin@intel.com>
38         * libgomp.map (GOMP_4.0.1): New symbol version.
39         Add GOMP_offload_register.
40         * plugin-host.c (device_available): Replace with:
41         (get_num_devices): This.
42         (get_type): New.
43         (offload_register): Ditto.
44         (device_init): Ditto.
45         (device_get_table): Ditto.
46         (device_run): Ditto.
47         * target.c (target_type): New enum.
48         (offload_image_descr): New struct.
49         (offload_images, num_offload_images): New globals.
50         (struct gomp_device_descr): Remove device_available_func.
51         Add type, is_initialized, get_type_func, get_num_devices_func,
52         offload_register_func, device_init_func, device_get_table_func,
53         device_run_func.
54         (mapping_table): New struct.
55         (GOMP_offload_register): New function.
56         (gomp_init_device): Ditto.
57         (GOMP_target): Add device initialization and lookup for target fn.
58         (GOMP_target_data): Add device initialization.
59         (GOMP_target_update): Ditto.
60         (gomp_load_plugin_for_device): Take handles for get_type,
61         get_num_devices, offload_register, device_init, device_get_table,
62         device_run functions.
63         (gomp_register_images_for_device): New function.
64         (gomp_find_available_plugins): Add registration of offload images.
66 2014-03-18  Thomas Schwinge  <thomas@codesourcery.com>
68         * libgomp_g.h (GOACC_kernels, GOACC_parallel): Add three
69         additional int arguments.
70         * oacc-parallel.c (GOACC_kernels, GOACC_parallel): Handle these.
71         * testsuite/libgomp.oacc-c/goacc_kernels.c: Adjust.
72         * testsuite/libgomp.oacc-c/goacc_parallel.c: Likewise.
74 2014-02-28  Thomas Schwinge  <thomas@codesourcery.com>
76         * testsuite/libgomp.oacc-c/goacc_kernels.c: New file.
77         * testsuite/libgomp.oacc-c/kernels-1.c: Likewise.
78         * testsuite/libgomp.oacc-c/parallel-1.c: Add one missing test.
80         * libgomp.map (GOACC_2.0): Add GOACC_kernels.
81         * libgomp_g.h (GOACC_kernels): New prototype.
82         * oacc-parallel.c (GOACC_kernels): New function.
84 2014-02-21  Thomas Schwinge  <thomas@codesourcery.com>
86         * testsuite/libgomp.oacc-c/data-1.c: New file.
88         * libgomp.map (GOACC_2.0): Add GOACC_data_end, GOACC_data_start.
89         * libgomp_g.h (GOACC_data_start, GOACC_data_end): New prototypes.
90         * oacc-parallel.c (GOACC_data_start, GOACC_data_end): New
91         functions.
93 2014-02-20  Thomas Schwinge  <thomas@codesourcery.com>
95         * target.c (gomp_load_plugin_for_device): Don't call dlcose if
96         dlopen failed.
98 2014-02-20  Thomas Schwinge  <thomas@codesourcery.com>
99             James Norris  <jnorris@codesourcery.com>
101         * plugin-host.c: New file.
102         * target.c (struct gomp_device_descr): Add device_alloc_func,
103         device_free_func, device_dev2host_func, device_host2dev_func
104         members.
105         (gomp_load_plugin_for_device): Load these.
106         (gomp_map_vars, gomp_unmap_tgt, gomp_unmap_vars, gomp_update): Use
107         these.
108         (resolve_device, gomp_find_available_plugins): Remove ID 257 hack.
110 2014-02-17  Ilya Verbin  <ilya.verbin@intel.com>
112         * target.c (gomp_map_vars_existing): Don't update copy_from for the
113         existing mappings.
115 2014-01-28  Thomas Schwinge  <thomas@codesourcery.com>
117         * testsuite/libgomp.oacc-c/parallel-1.c: Extend.
119 2013-12-18  Thomas Schwinge  <thomas@codesourcery.com>
121         * libgomp_g.h (GOACC_parallel): Switch kinds array to unsigned
122         short.
123         * oacc-parallel.c (GOACC_parallel): Likewise, and catch
124         unsupported kinds.
126 2013-11-08  Thomas Schwinge  <thomas@codesourcery.com>
128         libgomp/
129         * target.c (gomp_find_available_plugins): Don't skip device 257
130         setup.
132 2013-11-07  Thomas Schwinge  <thomas@codesourcery.com>
134         * oacc-parallel.c: New file.
135         * Makefile.am (libgomp_la_SOURCES): Add it.
136         * Makefile.in: Regenerate.
137         * libgomp.map (GOACC_2.0): Add GOACC_parallel.
138         * libgomp_g.h (GOACC_parallel): New declaration.
139         * testsuite/libgomp.oacc-c/goacc_parallel.c: New file.
140         * testsuite/libgomp.oacc-c/parallel-1.c: New file.
142         * libgomp.map (GOACC_2.0): New symbol version.
144         * openacc.f90 (openacc_version): New integer parameter.
145         * openacc_lib.h (openacc_version): Likewise.
146         * testsuite/libgomp.oacc-fortran/openacc_version-1.f: New file.
147         * testsuite/libgomp.oacc-fortran/openacc_version-2.f90: Likewise.
149         * libgomp.map (OACC_2.0): New symbol version.
150         * Makefile.am (nodist_libsubinclude_HEADERS): Add openacc.h.
151         (nodist_finclude_HEADERS): Add openacc_lib.h, openacc.f90,
152         openacc.mod, and openacc_kinds.mod.
153         (openacc_kinds.mod): New target.
154         (%.mod): New target, generalized from omp_lib.mod.
155         * Makefile.in: Regenerate.
156         * openacc.f90: New file.
157         * openacc.h: Likewise.
158         * openacc_lib.h: Likewise.
159         * testsuite/libgomp.oacc-c++/c++.exp: Likewise.
160         * testsuite/libgomp.oacc-c/c.exp: Likewise.
161         * testsuite/libgomp.oacc-c/lib-1.c: Likewise.
162         * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.
163         * testsuite/libgomp.oacc-fortran/lib-1.f90: Likewise.
164         * testsuite/libgomp.oacc-fortran/lib-2.f: Likewise.
165         * testsuite/libgomp.oacc-fortran/lib-3.f: Likewise.
167         Backport from trunk, r204519:
169         * testsuite/lib/libgomp.exp (libgomp_init): Don't add -fopenmp to
170         ALWAYS_CFLAGS.
171         * testsuite/libgomp.c++/c++.exp (ALWAYS_CFLAGS): Add -fopenmp.
172         * testsuite/libgomp.c/c.exp (ALWAYS_CFLAGS): Likewise.
173         * testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Likewise.
174         * testsuite/libgomp.graphite/graphite.exp (ALWAYS_CFLAGS):
175         Likewise.
177         Backport from trunk, r204518:
179         * libgomp_g.h: Include <stddef.h> for size_t.
181         Backport from trunk, r204517:
183         * libgomp.spec.in: Update comment about libgomp's dependencies.
184         * configure.ac: Likewise.
185         * configure: Regenerate.
187 2013-10-10  Jakub Jelinek  <jakub@redhat.com>
189         * testsuite/libgomp.c++/udr-6.C: Remove UDR + on type F.
191 2013-10-08  Jakub Jelinek  <jakub@redhat.com>
193         * testsuite/libgomp.c/thread-limit-1.c (main): Check if
194         cnt isn't bigger than 6 at any point in time, sleep 10ms after
195         incrementing it and then atomically decrement.
196         * testsuite/libgomp.c/thread-limit-2.c (main): Likewise.
198         * libgomp.h (struct gomp_team): Add task_queued_count field.
199         Add comments about task_{,queued_,running_}count.
200         * team.c (gomp_new_team): Clear task_queued_count.
201         * task.c (GOMP_task): Increment task_queued_count.
202         (gomp_task_run_pre): Decrement task_queued_count.  If it is
203         decremented to zero, call gomp_team_barrier_clear_task_pending.
204         (gomp_task_run_post_handle_dependers): Increment task_queued_count.
205         (gomp_barrier_handle_tasks): Don't call
206         gomp_team_barrier_clear_task_pending here.
208         * testsuite/libgomp.c/udr-2.c (main): Remove unused variable i.
209         * testsuite/libgomp.c/udr-3.c (main): Initialize i to 0.
210         * testsuite/libgomp.c++/udr-8.C (main): Likewise.
212         * testsuite/libgomp.c/affinity-1.c (min_cpusetsize): New variable.
213         (pthread_getaffinity_np): Set it when setting contig_cpucount.
214         (print_affinity): Use it for size, only use sysconf value if that is not
215         set and if it is smaller than sizeof (cpu_set_t), use sizeof (cpu_set_t).
217 2013-10-07  Jakub Jelinek  <jakub@redhat.com>
219         * testsuite/libgomp.c/affinity-1.c (main): Fork even if
220         contig_cpucount is > 8.
222         PR libgomp/58642
223         * config/linux/proc.c: Include errno.h.
224         (gomp_get_cpuset_size): New variable.
225         (gomp_cpuset_popcount): Add cpusetsize argument, use it instead of
226         gomp_cpuset_size.
227         (gomp_init_num_threads): If CPU_ALLOC_SIZE is defined and
228         pthread_getaffinity_np returned EINVAL, increase gomp_cpuset_size
229         and retry.  After successful pthread_getaffinity_np copy
230         gomp_cpuset_size to gomp_get_cpuset_size and try to find out
231         minimum gomp_cpuset_size that covers all the CPUs set in gomp_cpusetp.
232         (get_num_procs): Pass gomp_get_cpuset_size rather than gomp_cpuset_size
233         to pthread_getaffinity_np, adjust gomp_cpuset_popcount caller.
234         * config/linux/proc.h (gomp_cpuset_popcount): Add cpusetsize argument.
235         * config/linux/affinity.c (gomp_affinity_finalize_place_list,
236         gomp_affinity_init_level): Adjust gomp_cpuset_popcount callers.
237         * testsuite/libgomp.c/affinity-1.c (pthread_getaffinity_np): Set
238         contig_cpucount from the first successful pthread_getaffinity_np
239         call, rather than just first call.
241 2013-10-04  Jakub Jelinek  <jakub@redhat.com>
243         * libgomp.h (struct gomp_task_icv): Add thread_limit_var.
244         (gomp_thread_limit_var, gomp_remaining_threads_count,
245         gomp_remaining_threads_lock): Remove.
246         (gomp_managed_threads_lock): New variable.
247         (struct gomp_thread_pool): Add threads_busy field.
248         (gomp_free_thread): New prototype.
249         * parallel.c (gomp_resolve_num_threads): Adjust for
250         thread_limit now being in icv->thread_limit_var.  Use
251         UINT_MAX instead of ULONG_MAX as infinity.  If not nested,
252         just return minimum of max_num_threads and icv->thread_limit_var
253         and if thr->thread_pool, set threads_busy to the returned value.
254         Otherwise, don't update atomically gomp_remaining_threads_count,
255         but instead thr->thread_pool->threads_busy.
256         (GOMP_parallel_end): Adjust for thread_limit now being in
257         icv->thread_limit_var.  Use UINT_MAX instead of ULONG_MAX as
258         infinity.  Adjust threads_busy in the pool rather than
259         gomp_remaining_threads_count.  Remember team->nthreads and call
260         gomp_team_end before adjusting threads_busy, if not nested
261         afterwards, just set it to 1 non-atomically.
262         * team.c (gomp_thread_start): Clear thr->thread_pool and
263         thr->task before returning.
264         (gomp_free_pool_helper): Clear thr->thread_pool and thr->task
265         before calling pthread_exit.
266         (gomp_free_thread): No longer static.  Use
267         gomp_managed_threads_lock instead of gomp_remaining_threads_lock.
268         (gomp_team_start): Set thr->thread_pool->threads_busy to
269         nthreads immediately after creating new pool.  Use
270         gomp_managed_threads_lock instead of gomp_remaining_threads_lock.
271         (gomp_team_end): Use gomp_managed_threads_lock instead of
272         gomp_remaining_threads_lock.
273         (initialize_team): Don't call gomp_sem_init here.
274         * env.c (gomp_global_icv): Initialize thread_limit_var field.
275         (gomp_thread_limit_var, gomp_remaining_threads_count,
276         gomp_remaining_threads_lock): Remove.
277         (gomp_managed_threads_locks): New variable.
278         (handle_omp_display_env): Adjust for thread_limit var being
279         in gomp_global_icv.
280         (initialize_env): Likewise.  If user provided value is > INT_MAX,
281         set gomp_global_icv.thread_limit_var to UINT_MAX (infinity).
282         Initialize gomp_managed_threads_lock instead of
283         gomp_remaining_threads_lock.
284         (omp_get_thread_limit): Adjust for thread_limit var in
285         icv->thread_limit_var.
286         * target.c: Include limits.h.
287         (resolve_device): If device_id is < -1, return NULL.
288         (gomp_map_vars): Make sure tgt->array, tgt->to_free, tgt->tgt_start,
289         tgt->tgt_end and k->copy_from aren't left uninitialized.
290         (GOMP_target): Arrange for host callback to be performed in a
291         separate initial thread and contention group, inheriting ICVs from
292         gomp_global_icv etc.
293         (GOMP_teams): Adjust thread_limit_var ICV.
294         * testsuite/libgomp.c/affinity-1.c (main): Call omp_set_dynamic (0).
295         * testsuite/libgomp.c/target-3.c: New test.
296         * testsuite/libgomp.c/target-4.c: New test.
297         * testsuite/libgomp.c/target-5.c: New test.
298         * testsuite/libgomp.c/target-6.c: New test.
299         * testsuite/libgomp.c/target-7.c: New test.
300         * testsuite/libgomp.c/thread-limit-1.c: New test.
301         * testsuite/libgomp.c/thread-limit-2.c: New test.
302         * testsuite/libgomp.c/thread-limit-3.c: New test.
304         * libgomp.h (struct gomp_team_state): Add place_partition_off
305         and place_partition_len fields.
306         (struct gomp_task_icv): Add bind_var field.
307         (gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
308         gomp_places_list_len): New extern decls.
309         (struct gomp_thread): Add place field.
310         (gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
311         (gomp_init_thread_affinity): Add place argument.
312         (gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
313         gomp_affinity_remove_cpu, gomp_affinity_copy_place,
314         gomp_affinity_same_place, gomp_affinity_finalize_place_list,
315         gomp_affinity_init_level, gomp_affinity_print_place): New prototypes.
316         (gomp_team_start): Add flags argument.
317         * team.c (struct gomp_thread_start_data): Add place field.
318         (gomp_thread_start): Initialize thr->place.
319         (gomp_team_start): Add flags argument.  Handle OpenMP 4.0 affinity.
320         * env.c (gomp_global_icv): Initialize bind_var field.
321         (gomp_cpu_affinity, gomp_cpu_affinity_len): Remove.
322         (gomp_bind_var_list, gomp_bind_var_list_len, gomp_places_list,
323         gomp_places_list_len): New variables.
324         (parse_bind_var, parse_one_place, parse_places_var): New functions.
325         (parse_affinity): Rewritten to construct OMP_PLACES list with unit
326         sized places.
327         (handle_omp_display_env): Remove proc_bind argument.  Set display
328         to true for OMP_DISPLAY_ENV=true.  Print 201307 instead of 201107
329         as _OPENMP.  Enhance printing of OMP_PROC_BIND, add printing
330         of OMP_PLACES, don't print anything for GOMP_CPU_AFFINITY.
331         (initialize_env): Use parse_bind_var to parse OMP_PROC_BIND
332         instead of parse_boolean.  Use parse_places_var for OMP_PLACES
333         parsing.  Don't call parse_affinity if OMP_PLACES has been
334         successfully parsed (and call gomp_init_affinity in that case).
335         Adjust handle_omp_display_env caller.
336         (omp_get_proc_bind): Return bind_var ICV.
337         * config/posix/affinity.c (gomp_init_thread_affinity): Add place
338         argument.
339         (gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
340         gomp_affinity_remove_cpu, gomp_affinity_copy_place,
341         gomp_affinity_same_place, gomp_affinity_finalize_place_list,
342         gomp_affinity_init_level, gomp_affinity_print_place): New stubs.
343         * config/linux/proc.c (gomp_cpuset_popcount): Fix up check extern decl.
344         (gomp_init_num_threads): If HAVE_PTHREAD_AFFINITY_NP isn't defined,
345         fix up sizeof argument.  Free and clear gomp_cpusetp if it didn't
346         contain any logical CPUs.
347         (get_num_procs): Check gomp_places_list instead of gomp_cpu_affinity.
348         * config/linux/affinity.c: Include errno.h, stdio.h and string.h.
349         (affinity_counter): Remove.
350         (CPU_CLR_S): Define if CPU_ALLOC_SIZE is not defined.
351         (gomp_init_affinity): Rewritten, if gomp_places_list is NULL, try
352         silently create OMP_PLACES=threads, if it is non-NULL afterwards,
353         bind current thread to the first place.
354         (gomp_init_thread_affinity): Rewritten.  Add place argument, just
355         pthread_setaffinity_np to gomp_places_list[place].
356         (gomp_affinity_alloc, gomp_affinity_init_place, gomp_affinity_add_cpus,
357         gomp_affinity_remove_cpu, gomp_affinity_copy_place,
358         gomp_affinity_same_place, gomp_affinity_finalize_place_list,
359         gomp_affinity_init_level, gomp_affinity_print_place): New functions.
360         * parallel.c (GOMP_parallel_start): Adjust gomp_team_start caller.
361         (GOMP_parallel): Likewise, pass through flags parameter to it.
362         * sections.c (GOMP_parallel_sections_start): Adjust gomp_team_start
363         caller.
364         (GOMP_parallel_sections): Likewise, pass through flags parameter to it.
365         * loop.c (gomp_parallel_loop_start): Add flags argument, pass it through
366         to gomp_team_start.
367         (GOMP_parallel_loop_static_start, GOMP_parallel_loop_dynamic_start,
368         GOMP_parallel_loop_guided_start, GOMP_parallel_loop_runtime_start):
369         Adjust gomp_parallel_loop_start callers.
370         (GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
371         GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime): Likewise, pass
372         through flags parameter to it.
373         * testsuite/libgomp.c/affinity-1.c: New test.
374         * testsuite/libgomp.c++/affinity-1.C: New test.
376 2013-10-01  Jakub Jelinek  <jakub@redhat.com>
378         PR libgomp/57298
379         * config/linux/proc.c (gomp_cpuset_size, gomp_cpusetp): New variables.
380         (gomp_cpuset_popcount): Use CPU_COUNT_S if available, or CPU_COUNT if
381         gomp_cpuset_size is sizeof (cpu_set_t).  Use gomp_cpuset_size instead
382         of sizeof (cpu_set_t) to determine number of iterations.
383         (gomp_init_num_threads): Initialize gomp_cpuset_size and gomp_cpusetp
384         here, use gomp_cpusetp instead of &cpuset and pass gomp_cpuset_size
385         instead of sizeof (cpu_set_t) to pthread_getaffinity_np.
386         (get_num_procs): Don't call pthread_getaffinity_np if gomp_cpusetp
387         is NULL.  Use gomp_cpusetp instead of &cpuset and pass gomp_cpuset_size
388         instead of sizeof (cpu_set_t) to pthread_getaffinity_np.
389         * config/linux/proc.h (gomp_cpuset_popcount): Add attribute_hidden.
390         (gomp_cpuset_size, gomp_cpusetp): Declare.
391         * config/linux/affinity.c (CPU_ISSET_S, CPU_ZERO_S, CPU_SET_S): Define
392         if CPU_ALLOC_SIZE isn't defined.
393         (gomp_init_affinity): Don't call pthread_getaffinity_np here, instead
394         use gomp_cpusetp computed by gomp_init_num_threads.  Use CPU_*_S
395         variants of macros with gomp_cpuset_size as set size, for cpusetnew
396         use alloca for it if CPU_ALLOC_SIZE is defined, otherwise local
397         fixed size variable.
398         (gomp_init_thread_affinity): Use CPU_*_S variants of macros with
399         gomp_cpuset_size as set size, for cpuset use alloca for it if
400         CPU_ALLOC_SIZE is defined, otherwise local fixed size variable.
402 2013-09-27  Jakub Jelinek  <jakub@redhat.com>
404         * libgomp.h: Include stdlib.h.
405         (struct gomp_task_depend_entry,
406         struct gomp_dependers_vec): New types.
407         (struct gomp_task): Add dependers, depend_hash, depend_count,
408         num_dependees and depend fields.
409         (struct gomp_taskgroup): Add num_children field.
410         (gomp_finish_task): Free depend_hash if non-NULL.
411         * libgomp_g.h (GOMP_task): Add depend argument.
412         * hashtab.h: New file.
413         * task.c: Include hashtab.h.
414         (hash_entry_type): New typedef.
415         (htab_alloc, htab_free, htab_hash, htab_eq): New inlines.
416         (gomp_init_task): Clear dependers, depend_hash and depend_count
417         fields.
418         (GOMP_task): Add depend argument, handle depend clauses.  Increment
419         num_children field in taskgroup.
420         (gomp_task_run_pre): Don't increment task_running_count here,
421         nor clear task_pending bit.
422         (gomp_task_run_post_handle_depend_hash,
423         gomp_task_run_post_handle_dependers,
424         gomp_task_run_post_handle_depend): New functions.
425         (gomp_task_run_post_remove_parent): Clear in_taskwait before
426         signalling corresponding semaphore.
427         (gomp_task_run_post_remove_taskgroup): Decrement num_children
428         field and make the decrement to 0 MEMMODEL_RELEASE operation,
429         rather than storing NULL to taskgroup->children.  Clear
430         in_taskgroup_wait before signalling corresponding semaphore.
431         (gomp_barrier_handle_tasks): Move task_running_count increment
432         and task_pending bit clearing here.  Call
433         gomp_task_run_post_handle_depend.  If more than one new tasks
434         have been queued, wake other threads if needed.
435         (GOMP_taskwait): Call gomp_task_run_post_handle_depend.  If more
436         than one new tasks have been queued, wake other threads if needed.
437         After waiting on taskwait_sem, enter critical section again.
438         (GOMP_taskgroup_start): Initialize num_children field.
439         (GOMP_taskgroup_end): Check num_children instead of children
440         before critical section.  If children is NULL, but num_children
441         is non-zero, wait on taskgroup_sem.  Call
442         gomp_task_run_post_handle_depend.  If more than one new tasks have
443         been queued, wake other threads if needed.  After waiting on
444         taskgroup_sem, enter critical section again.
445         * testsuite/libgomp.c/depend-1.c: New test.
446         * testsuite/libgomp.c/depend-2.c: New test.
447         * testsuite/libgomp.c/depend-3.c: New test.
448         * testsuite/libgomp.c/depend-4.c: New test.
450 2013-09-26  Jakub Jelinek  <jakub@redhat.com>
452         PR libgomp/58482
453         * testsuite/libgomp.c/simd-6.c: New test.
454         * testsuite/libgomp.c++/simd-8.C: New test.
456 2013-09-25  Jakub Jelinek  <jakub@redhat.com>
458         * parallel.c (GOMP_cancellation_point, GOMP_cancel): Handle
459         GIMPLE_CANCEL_TASKGROUP cancellation.
460         * libgomp.h (struct gomp_task): Add next_taskgroup, prev_taskgroup,
461         taskgroup and copy_ctors_done fields.
462         (struct gomp_taskgroup): New type.
463         * task.c (gomp_init_task): Initialize copy_ctors_done and taskgroup
464         fields.
465         (GOMP_task): Don't start a new thread also if it's taskgroup has
466         been cancelled.  Set copy_ctors_done field if needed.  Initialize
467         taskgroup field.  If copy_ctors_done and already cancelled, don't
468         discard the task.  If taskgroup is non-NULL, enqueue the task
469         into taskgroup queue.
470         (gomp_task_run_pre, gomp_task_run_post_remove_parent,
471         gomp_task_run_post_remove_taskgroup): New inline functions.
472         (gomp_barrier_handle_tasks, GOMP_taskwait): Use them.
473         (GOMP_taskgroup_start, GOMP_taskgroup_end): Implement taskgroup
474         support.
475         * testsuite/libgomp.c++/cancel-parallel-1.C: New test.
476         * testsuite/libgomp.c++/cancel-parallel-2.C: New test.
477         * testsuite/libgomp.c++/cancel-parallel-3.C: New test.
478         * testsuite/libgomp.c++/cancel-for-1.C: New test.
479         * testsuite/libgomp.c++/cancel-for-1.C: New test.
480         * testsuite/libgomp.c++/cancel-taskgroup-1.C: New test.
481         * testsuite/libgomp.c++/cancel-taskgroup-2.C: New test.
482         * testsuite/libgomp.c++/cancel-taskgroup-3.C: New test.
483         * testsuite/libgomp.c++/cancel-test.h: New file.
484         * testsuite/libgomp.c++/cancel-sections-1.C: New test.
485         * testsuite/libgomp.c++/taskgroup-1.C: New test.
486         * testsuite/libgomp.c/cancel-taskgroup-1.c: New test.
487         * testsuite/libgomp.c/cancel-taskgroup-2.c: New test.
488         * testsuite/libgomp.c/taskgroup-1.c: New test.
489         * testsuite/libgomp.c/cancel-parallel-3.c (do_some_work): Use
490         void return type.
492 2013-09-24  Richard Henderson  <rth@redhat.com>
493             Jakub Jelinek  <jakub@redhat.com>
495         * libgomp.map (GOMP_4.0): Export GOMP_barrier_cancel,
496         GOMP_loop_end_cancel, GOMP_sections_end_cancel.
497         * parallel.c (GOMP_cancellation_point): Add WHICH argument, do nothing
498         if gomp_cancel_var is false, handle workshare and parallel
499         cancellation point, add ialias.
500         (GOMP_cancel): Add WHICH and DO_CANCEL arguments, do nothing if
501         gomp_cancel_var is false, call GOMP_cancellation_point if DO_CANCEL
502         is false, handle workshare and parallel cancellation.
503         * config/posix/bar.c (gomp_barrier_init): Clear cancellable field.
504         (gomp_team_barrier_wait_end): Clear BAR_CANCELLED from state.
505         Set work_share_cancelled to 0 on last thread, use __atomic_load_n.
506         (gomp_team_barrier_wait_cancel_end, gomp_team_barrier_wait_cancel,
507         gomp_team_barrier_cancel): New functions.
508         * config/posix/bar.h (gomp_barrier_t): Add cancellable field.
509         (BAR_CANCELLED): Define.
510         (BAR_INCR): Set to 8.
511         (gomp_team_barrier_wait_cancel, gomp_team_barrier_wait_cancel_end,
512         gomp_team_barrier_cancel): New prototypes.
513         (gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.
514         (gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final,
515         gomp_team_barrier_cancelled): New inline functions.
516         * config/linux/bar.c (gomp_team_barrier_wait_end): Clear BAR_CANCELLED
517         from state where needed.  Set work_share_cancelled to 0 on last thread.
518         (gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel_end,
519         gomp_team_barrier_wait_cancel, gomp_team_barrier_cancel): New
520         functions.
521         * config/linux/bar.h (gomp_barrier_t): Add awaited_final field.
522         (BAR_CANCELLED): Define.
523         (BAR_INCR): Set to 8.
524         (gomp_barrier_init): Initialize awaited_final field.
525         (gomp_team_barrier_wait_final, gomp_team_barrier_wait_cancel,
526         gomp_team_barrier_wait_cancel_end, gomp_team_barrier_cancel): New
527         prototypes.
528         (gomp_barrier_wait_start): Preserve BAR_CANCELLED bit.
529         (gomp_barrier_wait_cancel_start, gomp_team_barrier_wait_final_start,
530         gomp_team_barrier_cancelled): New inline functions.
531         * work.c (gomp_work_share_end, gomp_work_share_end_nowait): Set
532         team->work_shares_to_free to thr->ts.work_share before calling
533         free_work_share.
534         (gomp_work_share_end_cancel): New function.
535         * team.c (gomp_thread_start): Use gomp_team_barrier_wait_final
536         instead of gomp_team_barrier_wait.
537         (gomp_new_team): Initialize work_shares_to_free, work_share_cancelled
538         and team_cancelled fields.
539         (gomp_team_end): Use gomp_team_barrier_wait_final instead of
540         gomp_team_barrier_wait.  If team->team_cancelled, call
541         gomp_fini_worshare on ws chain starting at team->work_shares_to_free
542         rather than thr->ts.work_share.
543         * env.c (gomp_global_icv): Initialize target_data field.
544         (gomp_cancel_var): New global variable.
545         (handle_omp_display_env): Print cancel-var ICV.
546         (initialize_env): Parse OMP_CANCELLATION env var.
547         (omp_get_cancellation): Return gomp_cancel_var.
548         * barrier.c (GOMP_barrier_cancel): New function.
549         * libgomp.h (gomp_cancel_var): New extern decl.
550         (struct gomp_team): Add work_shares_to_free, work_share_cancelled
551         and team_cancelled fields.
552         (gomp_cancel_kind): New enum.
553         (gomp_work_share_end_cancel): New prototype.
554         * libgomp_g.h (GOMP_barrier_cancel, GOMP_loop_end_cancel,
555         GOMP_sections_end_cancel): New prototypes.
556         (GOMP_cancel, GOMP_cancellation_point): Adjust prototypes.
557         * task.c (GOMP_task): If gomp_team_barrier_cancelled, don't
558         queue or start new tasks.
559         (gomp_barrier_handle_tasks): If gomp_team_barrier_cancelled,
560         don't start any new tasks, just free all tasks.
561         * sections.c (GOMP_sections_end_cancel): New function.
562         * loop.c (GOMP_loop_end_cancel): New function.
563         * testsuite/libgomp.c/cancel-parallel-1.c: New test.
564         * testsuite/libgomp.c/cancel-parallel-2.c: New test.
565         * testsuite/libgomp.c/cancel-parallel-3.c: New test.
566         * testsuite/libgomp.c/cancel-for-1.c: New test.
567         * testsuite/libgomp.c/cancel-for-2.c: New test.
568         * testsuite/libgomp.c/cancel-sections-1.c: New test.
570 2013-09-23  Michael Zolotukhin  <michael.v.zolotukhin@intel.com>
572         * configure.ac: Add checks for plugins support.
573         * config.h.in: Regenerated.
574         * configure: Regenerated.
575         * target.c (struct target_mem_desc): Add device_descr field.
576         (devices): New.
577         (num_devices): New.
578         (struct gomp_device_descr): New.
579         (gomp_get_num_devices): Call gomp_target_init.
580         (resolve_device): Return device_descr instead of int.
581         (gomp_map_vars): Add devicep argument and update the function
582         accordingly.
583         (gomp_unmap_tgt): Likewise.
584         (gomp_unmap_vars): Likewise.
585         (gomp_update): Likewise.
586         (GOMP_target): Use device_descr struct.
587         (GOMP_target_data): Likewise.
588         (GOMP_target_update): Likewise.
589         (gomp_check_plugin_file_name): New.
590         (gomp_load_plugin_for_device): New.
591         (gomp_find_available_plugins): New.
592         (gomp_target_init): New.
594 2013-09-19  Jakub Jelinek  <jakub@redhat.com>
596         * libgomp_g.h (GOMP_target): Change 3rd argument to const void *.
597         (GOMP_target_data, GOMP_target_update): Add openmp_target argument.
598         * target.c (GOMP_target): Change fnname argument to openmp_target,
599         with const void * type.
600         (GOMP_target_data, GOMP_target_update): Add openmp_target argument.
602         * testsuite/libgomp.c/simd-4.c: New test.
603         * testsuite/libgomp.c/simd-5.c: New test.
604         * testsuite/libgomp.c/udr-1.c: New test.
605         * testsuite/libgomp.c/udr-2.c: New test.
606         * testsuite/libgomp.c/udr-3.c: New test.
607         * testsuite/libgomp.c++/udr-9.C: New test.
609 2013-09-18  Jakub Jelinek  <jakub@redhat.com>
611         * testsuite/libgomp.c++/simd-4.C: New test.
612         * testsuite/libgomp.c++/simd-5.C: New test.
613         * testsuite/libgomp.c++/simd-6.C: New test.
614         * testsuite/libgomp.c++/simd-7.C: New test.
615         * testsuite/libgomp.c++/udr-1.C: New test.
616         * testsuite/libgomp.c++/udr-2.C: New test.
617         * testsuite/libgomp.c++/udr-3.C: New test.
618         * testsuite/libgomp.c++/udr-4.C: New test.
619         * testsuite/libgomp.c++/udr-5.C: New test.
620         * testsuite/libgomp.c++/udr-6.C: New test.
621         * testsuite/libgomp.c++/udr-7.C: New test.
622         * testsuite/libgomp.c++/udr-8.C: New test.
624 2013-09-16  Jakub Jelinek  <jakub@redhat.com>
626         * splay-tree.h: New file.
627         * target.c: Include stdbool.h.
628         (splay_tree_node, splay_tree, splay_tree_key): New typedefs.
629         (struct target_mem_desc, struct splay_tree_key_s): New structures.
630         (splay_compare): New inline function.
631         (gomp_get_num_devices): New function.
632         (resolve_device): Use default_device_var ICV.  Add temporarily
633         magic testing device number 257.
634         (dev_splay_tree, dev_env_lock): New variables.
635         (gomp_map_vars_existing, gomp_map_vars, gomp_unmap_tgt,
636         gomp_unmap_vars, gomp_update): New functions.
637         (GOMP_target, GOMP_target_data, GOMP_target_end_data,
638         GOMP_target_update): Add support for magic testing device number 257.
639         * libgomp.h (struct target_mem_desc): Forward declare.
640         (struct gomp_task_icv): Add default_device_var and target_data.
641         (gomp_get_num_devices): New prototype.
642         * env.c (gomp_global_icv): Add default_device_var initializer.
643         (parse_int): New function.
644         (handle_omp_display_env): Print OMP_DEFAULT_DEVICE.
645         (initialize_env): Initialize default_device_var.
646         (omp_set_default_device): Set default_device_var ICV.
647         (omp_get_default_device): Query default_device_var ICV.
648         (omp_get_num_devices): Call gomp_get_num_devices.
649         (omp_get_num_teams, omp_get_team_num, omp_is_initial_device): Add
650         comments.
652 2013-09-13  Jakub Jelinek  <jakub@redhat.com>
654         PR tree-optimization/58392
655         * testsuite/libgomp.c/pr58392.c: New test.
657 2013-09-06  Jakub Jelinek  <jakub@redhat.com>
659         * testsuite/libgomp.c/target-2.c: New test.
660         * testsuite/libgomp.c++/target-3.C: New test.
662 2013-09-05  Jakub Jelinek  <jakub@redhat.com>
664         * testsuite/libgomp.c++/target-2.C: New test.
665         * testsuite/libgomp.c++/target-2-aux.cc: New file.
667         * libgomp.map (GOMP_4.0): Add GOMP_target, GOMP_target_data,
668         GOMP_target_end_data, GOMP_target_update and GOMP_teams.
669         * Makefile.am (libgomp_la_SOURCES): Add target.c.
670         * Makefile.in: Regenerated.
671         * target.c: New file.
672         * libgomp_g.h (GOMP_target, GOMP_target_data,
673         GOMP_target_end_data, GOMP_target_update, GOMP_teams): New prototypes.
674         * testsuite/libgomp.c++/for-11.C (main): Uncomment
675         #pragma omp target teams directive.
676         * testsuite/libgomp.c/for-3.c (main): Likewise.
677         * testsuite/libgomp.c++/target-1.C: New test.
678         * testsuite/libgomp.c/target-1.c: New test.
680 2013-07-06  Jakub Jelinek  <jakub@redhat.com>
682         * testsuite/libgomp.c/for-3.c: New test.
683         * testsuite/libgomp.c/simd-1.c: New test.
684         * testsuite/libgomp.c/simd-2.c: New test.
685         * testsuite/libgomp.c/simd-3.c: New test.
687 2013-07-05  Richard Henderson  <rth@redhat.com>
689         * config/linux/bar.c (gomp_team_barrier_wait_end): Remove one more
690         hard-coded constant.
692 2013-07-03  Richard Henderson  <rth@redhat.com>
694         * config/linux/bar.h (BAR_TASK_PENDING, BAR_WAS_LAST,
695         BAR_WAITING_FOR_TASK, BAR_INCR): New.
696         (gomp_barrier_wait_start, gomp_barrier_last_thread, 
697         gomp_team_barrier_set_task_pending,
698         gomp_team_barrier_clear_task_pending,
699         gomp_team_barrier_set_waiting_for_tasks,
700         gomp_team_barrier_waiting_for_tasks,
701         gomp_team_barrier_done): Use them.
702         * config/linux/bar.c (gomp_barrier_wait_end,
703         gomp_barrier_wait_last, gomp_team_barrier_wait_end): Likewise.
704         * config/posix/bar.h, config/posix/bar.c: Similarly.
706 2013-07-03  Jakub Jelinek  <jakub@redhat.com>
708         * testsuite/libgomp.c++/atomic-14.C: Adjust for stricter atomic
709         seq_cst parser.
710         * testsuite/libgomp.c++/atomic-15.C: Likewise.
711         * testsuite/libgomp.c/atomic-17.c: Likewise.
713 2013-06-28  Jakub Jelinek  <jakub@redhat.com>
715         * testsuite/libgomp.c++/simd-1.C: New test.
716         * testsuite/libgomp.c++/simd-2.C: New test.
717         * testsuite/libgomp.c++/simd-3.C: New test.
719 2013-06-21  Jakub Jelinek  <jakub@redhat.com>
721         * testsuite/libgomp.c/for-1.h: New file.
722         * testsuite/libgomp.c/for-2.h: New file.
723         * testsuite/libgomp.c/for-1.c: New test.
724         * testsuite/libgomp.c/for-2.c: New test.
725         * testsuite/libgomp.c++/for-9.C: New test.
726         * testsuite/libgomp.c++/for-10.C: New test.
727         * testsuite/libgomp.c++/for-11.C: New test.
729 2013-06-12  Jakub Jelinek  <jakub@redhat.com>
731         * fortran.c (omp_is_initial_device): Add ialias_redirect.
732         (omp_is_initial_device_): New function.
733         * omp_lib.f90.in (omp_is_initial_device): New interface.
734         * omp.h.in (omp_is_initial_device): New prototype.
735         * libgomp.map (omp_is_initial_device, omp_is_initial_device_):
736         Export @@OMP_4.0.
737         * env.c (omp_is_initial_device): New function.  Add ialias for it.
738         * omp_lib.h.in (omp_is_initial_device): New external.
740         * omp_lib.f90.in (omp_get_dynamic, omp_get_nested,
741         omp_in_parallel, omp_get_max_threads, omp_get_num_procs,
742         omp_get_num_threads, omp_get_thread_num, omp_get_thread_limit,
743         omp_set_max_active_levels, omp_get_max_active_levels,
744         omp_get_level, omp_get_ancestor_thread_num,
745         omp_get_team_size, omp_get_active_level, omp_in_final,
746         omp_get_cancellation, omp_get_default_device,
747         omp_get_num_devices, omp_get_num_teams, omp_get_team_num): Remove
748         useless use omp_lib_kinds.
750 2013-04-30  Jakub Jelinek  <jakub@redhat.com>
752         * testsuite/libgomp.c/atomic-17.c: New test.
753         * testsuite/libgomp.c++/atomic-14.C: New test.
754         * testsuite/libgomp.c++/atomic-15.C: New test.
756 2013-04-10  Jakub Jelinek  <jakub@redhat.com>
758         * libgomp.map (omp_get_cancellation, omp_get_cancellation_,
759         omp_get_proc_bind, omp_get_proc_bind_, omp_set_default_device,
760         omp_set_default_device_, omp_set_default_device_8_,
761         omp_get_default_device, omp_get_default_device_,
762         omp_get_num_devices, omp_get_num_devices_, omp_get_num_teams,
763         omp_get_num_teams_, omp_get_team_num, omp_get_team_num_): Export
764         @@OMP_4.0.
765         (GOMP_cancel, GOMP_cancellation_point, GOMP_parallel_loop_dynamic,
766         GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime,
767         GOMP_parallel_loop_static, GOMP_parallel_sections, GOMP_parallel,
768         GOMP_taskgroup_start, GOMP_taskgroup_end): Export @@GOMP_4.0.
769         * parallel.c (GOMP_parallel_end): Add ialias.
770         (GOMP_parallel, GOMP_cancel, GOMP_cancellation_point): New
771         functions.
772         * omp.h.in (omp_proc_bind_t): New typedef.
773         (omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
774         omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
775         omp_get_team_num): New prototypes.
776         * env.c (omp_get_cancellation, omp_get_proc_bind,
777         omp_set_default_device, omp_get_default_device, omp_get_num_devices,
778         omp_get_num_teams, omp_get_team_num): New functions.
779         * fortran.c (ULP, STR1, STR2, ialias_redirect): Removed.
780         (omp_get_cancellation_, omp_get_proc_bind_, omp_set_default_device_,
781         omp_set_default_device_8_, omp_get_default_device_,
782         omp_get_num_devices_, omp_get_num_teams_, omp_get_team_num_): New
783         functions.
784         * libgomp.h (ialias_ulp, ialias_str1, ialias_str2, ialias_redirect,
785         ialias_call): Define.
786         * libgomp_g.h (GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
787         GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime, GOMP_parallel,
788         GOMP_cancel, GOMP_cancellation_point, GOMP_taskgroup_start,
789         GOMP_taskgroup_end, GOMP_parallel_sections): New prototypes.
790         * task.c (GOMP_taskgroup_start, GOMP_taskgroup_end): New functions.
791         * sections.c (GOMP_parallel_sections): New function.
792         * loop.c (GOMP_parallel_loop_static, GOMP_parallel_loop_dynamic,
793         GOMP_parallel_loop_guided, GOMP_parallel_loop_runtime): New
794         functions.
795         (GOMP_parallel_end): Add ialias_redirect.
796         * omp_lib.f90.in (omp_proc_bind_kind, omp_proc_bind_false,
797         omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
798         omp_proc_bind_spread): New params.
799         (omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
800         omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
801         omp_get_team_num): New interfaces.
802         * omp_lib.h.in (omp_proc_bind_kind, omp_proc_bind_false,
803         omp_proc_bind_true, omp_proc_bind_master, omp_proc_bind_close,
804         omp_proc_bind_spread): New params.
805         (omp_get_cancellation, omp_get_proc_bind, omp_set_default_device,
806         omp_get_default_device, omp_get_num_devices, omp_get_num_teams,
807         omp_get_team_num): New externals.
809 2013-03-20  Tobias Burnus  <burnus@net-b.de>
811         * libgomp.texi (Environment Variables): Minor cleanup,
812         update section refs to OpenMP 4.0rc2.
813         (OMP_DISPLAY_ENV, GOMP_SPINCOUNT): Document these
814         environment variables.
816 2013-03-20  Tobias Burnus  <burnus@net-b.de>
818         * env.c (handle_omp_display_env): New function.
819         (initialize_env): Use it.
821 2013-03-20  Jakub Jelinek  <jakub@redhat.com>
823         * testsuite/libgomp.c/atomic-14.c: Add parens to make it valid.
824         * testsuite/libgomp.c/atomic-15.c: New test.
825         * testsuite/libgomp.c/atomic-16.c: New test.
827         * testsuite/libgomp.c++/atomic-10.C: New test.
828         * testsuite/libgomp.c++/atomic-11.C: New test.
829         * testsuite/libgomp.c++/atomic-12.C: New test.
830         * testsuite/libgomp.c++/atomic-13.C: New test.
832 Copyright (C) 2013-2014 Free Software Foundation, Inc.
834 Copying and distribution of this file, with or without modification,
835 are permitted in any medium without royalty provided the copyright
836 notice and this notice are preserved.