Commit Graph

462 Commits

Author SHA1 Message Date
Nathan Sidwell 22be23495a target.c (gomp_offload_image_to_device): Rename to ...
libgomp/
	* target.c (gomp_offload_image_to_device): Rename to ...
	(gomp_load_image_to_device): ... here.
	(GOMP_offload_register): Adjust call.
	(gomp_init_device): Likewise.
	(gomp_unload_image_from_device): New.  Broken out of ...
	(GOMP_offload_unregister): ... here.  Call it.
	(gomp_unload_device): New.
	* libgomp.h (gomp_unload_device): Declare.
	* oacc-init.c (acc_shutdown_1): Unload from device before deleting
	mem maps.

	gcc/
	* config/nvptx/mkoffload.c (process): Add static destructor call.

From-SVN: r226039
2015-07-21 13:30:06 +00:00
Nathan Sidwell a091118d2c oacc-parallel.c (GOACC_parallel): Move variadic handling into wait=-specific if.
* oacc-parallel.c (GOACC_parallel): Move variadic handling into
	wait=-specific if.
	(GOACC_enter_exit_data, GOACC_update): Use consistent num_waits
	!=0 condition.
	(goacc_waits): Move !num_waits handling to ...
	(GOACC_wait): ... here, the only caller that might have zero waits.

From-SVN: r226011
2015-07-20 17:31:46 +00:00
Nathan Sidwell f3e9a059a7 plugin-nvptx.c (struct targ_fn_descriptor): Move later.
* plugin/plugin-nvptx.c (struct targ_fn_descriptor): Move later.
	(struct ptx_image_data): Move earlier, add fns field.
	(struct ptx_device): Add images and image_lock fields.
	(ptx_images, ptx_image_lock): Delete.
	(nvptx_open_device): Initialize images and image_lock fields.
	(nvptx_close_device): Destroy image_lock.
	(GOMP_OFFLOAD_load_image): Register image to device-specific fields.
	(GOMP_OFFLOAD_unload_image): Unregister image from device-specific
	fields.

From-SVN: r226004
2015-07-20 16:17:57 +00:00
Nathan Sidwell 896c28a7fa target.c (GOMP_offload_register): Use int for device type arg.
* target.c (GOMP_offload_register): Use int for device type arg.
	(GOMP_offload_unregister): Likewise.

From-SVN: r225944
2015-07-17 17:17:26 +00:00
Nathan Sidwell ebe4a56073 mkoffload.c (process): Constify host data.
gcc/
	* config/nvptx/mkoffload.c (process): Constify host data.
	* config/i386/intelmic-mkoffload.c (generate_target_descr_file):
	Constify host data.
	(generate_host_descr_file): Likewise.

	libgomp/
	* target.c (struct_offload_image_descr): Constify host_table.
	(gomp_offload_image_to_device): Likewise.
	(GOMP_offload_register, GOMP_offload_unregister): Likewise.

	libgcc/
	* offloadstuff.c: Constify host data.

From-SVN: r225943
2015-07-17 17:12:01 +00:00
Nathan Sidwell afb2d80bc5 mkoffload.c (process): Constify target data.
gcc/
	* config/nvptx/mkoffload.c (process): Constify target data.
	* config/i386/intelmic-mkoffload.c (generate_target_descr_file):
	Constify target data.
	(generate_target_offloadend_file): Likewise.

	libgomp/
	* libgomp.h (gomp_device_descr): Constify target data arguments.
	* target.c (struct offload_image_descr): Constify target_data.
	(gomp_offload_image_to_device): Likewise.
	(GOMP_offload_register): Likewise.
	(GOMP_offload_unrefister): Likewise.
	* plugin/plugin-host.c (GOMP_OFFLOAD_load_image,
	GOMP_OFFLOAD_unload_image): Constify target data.
	* plugin/plugin-nvptx.c (struct ptx_image_data): Constify target data.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): Likewise.

	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (ImgDevAddrMap): Constify.
	(offload_image, GOMP_OFFLOAD_load_image,
	OMP_OFFLOAD_unload_image): Constify target data.

From-SVN: r225936
2015-07-17 14:07:53 +00:00
Nathan Sidwell a4cb876dc9 plugin-nvptx.c (link_ptx): Constify string argument.
libgomp/
	* plugin/plugin-nvptx.c (link_ptx): Constify string argument.
	Workaround driver library const error.
	(struct nvptx_tdata, nvptx_tdata_t): New.
	(GOMP_OFFLOAD_load_image): Use struct for target_data's real
	type.

	gcc/
	* config/nvptx/mkoffload.c (process): Constify mapping variables.
	Define target data struct and initialize it.

From-SVN: r225897
2015-07-16 17:17:31 +00:00
Maxim Blumenthal 28ef6a27c8 Fix libgomp tests.
2015-07-15  Maxim Blumenthal  <maxim.blumenthal@intel.com>

libgomp/
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: (main): Change type
	of EPS parameter from integer to real.
	* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: (check): Change
	type of EPS parameter from integer to real.

From-SVN: r225827
2015-07-15 13:13:10 +00:00
Sebastian Huber 6dba011330 [gomp] Recycle last non-nested team if possible
libgomp/ChangeLog
2015-07-15  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* team.c (get_last_team): New.
	(gomp_new_team): Recycle last non-nested team if possible.
	(gomp_team_end): Move team work share list free lock destruction
	to ...
	(free_team): ... here.

From-SVN: r225811
2015-07-15 09:11:11 +00:00
Maxim Blumenthal 4c1cb4da7a simd-3.c: (main): Change type of res and ref from int to double.
2015-07-14  Maxim Blumenthal  <maxim.blumenthal@intel.com>

libgomp/
	* testsuite/libgomp.c/examples-4/simd-3.c: (main): Change type of res
	and ref from int to double.  Replaced their comparison with
	an inequality of their difference and EPS.
	* testsuite/libgomp.c/examples-4/simd-8.c: (main): Replace the
	comparison of pri and a reference number with an inequality of their
	difference and EPS.
	* testsuite/libgomp.fortran/examples-4/simd-3.f90: (main): Replaced
	the comparison of sum and sum_ref with an inequality of their
	difference and EPS.
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: (main): Replace
	the comparison of pri and a reference number with an inequality of
	their difference and EPS.

From-SVN: r225786
2015-07-14 18:54:35 +00:00
Maxim Blumenthal 343587dc64 Update libgomp/testsuite/*/examples-4/* according to latest version (4.0.2)
2015-07-13  Maxim Blumenthal  <maxim.blumenthal@intel.com>

	* testsuite/libgomp.c++/examples-4/e.53.2.C: Renamed to...
	* testsuite/libgomp.c++/examples-4/declare_target-2.C: ...this.
	* testsuite/libgomp.c++/examples-4/e.51.5.C: Renamed to...
	* testsuite/libgomp.c++/examples-4/target_data-5.C: ...this.
	* testsuite/libgomp.c/examples-4/e.56.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/array_sections-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.56.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/array_sections-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.55.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/async_target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.55.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/async_target-2.c: ...this.
	(vec_mult_ref): Remove v1 and v2 arguments, turn them into local
	variables.
	(vec_mult): Likewise.  Add #pragma omp taskwait.
	(main): Adjust caller.
	* testsuite/libgomp.c/examples-4/e.53.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.53.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/declare_target-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.57.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/device-3.c: ...this.
	* testsuite/libgomp.c/examples-4/simd-1.c: New file.
	* testsuite/libgomp.c/examples-4/simd-2.c: New file.
	* testsuite/libgomp.c/examples-4/simd-3.c: New file.
	* testsuite/libgomp.c/examples-4/simd-4.c: New file.
	* testsuite/libgomp.c/examples-4/simd-5.c: New file.
	* testsuite/libgomp.c/examples-4/simd-6.c: New file.
	* testsuite/libgomp.c/examples-4/simd-7.c: New file.
	* testsuite/libgomp.c/examples-4/simd-8.c: New file.
	* testsuite/libgomp.c/examples-4/e.50.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.50.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.6.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-6.c: ...this.
	* testsuite/libgomp.c/examples-4/e.51.7.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_data-7.c: ...this.
	* testsuite/libgomp.c/examples-4/e.52.1.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_update-1.c: ...this.
	* testsuite/libgomp.c/examples-4/e.52.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/target_update-2.c: ...this.
	* testsuite/libgomp.c/examples-4/task_dep-1.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-2.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-3.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-4.c: New file.
	* testsuite/libgomp.c/examples-4/task_dep-5.c: New file.
	* testsuite/libgomp.c/examples-4/e.54.2.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-2.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.3.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-3.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.4.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-4.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.5.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-5.c: ...this.
	* testsuite/libgomp.c/examples-4/e.54.6.c: Renamed to...
	* testsuite/libgomp.c/examples-4/teams-6.c: ...this.
	* testsuite/libgomp.fortran/examples-4/e.56.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/array_sections-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.56.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/array_sections-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.55.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/async_target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.55.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/async_target-2.f90: ...this.
	(vec_mult): Add !$omp taskwait.
	* testsuite/libgomp.fortran/examples-4/e.53.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.53.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/declare_target-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.57.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/device-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/simd-1.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-2.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-3.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-4.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-5.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-6.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-7.f90: New file.
	* testsuite/libgomp.fortran/examples-4/simd-8.f90: New file.
	* testsuite/libgomp.fortran/examples-4/e.50.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.50.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.6.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-6.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.51.7.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_data-7.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.52.1.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_update-1.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.52.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/target_update-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/task_dep-1.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-2.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-3.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-4.f90: New file.
	* testsuite/libgomp.fortran/examples-4/task_dep-5.f90: New file.
	* testsuite/libgomp.fortran/examples-4/e.54.2.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-2.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.3.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-3.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.4.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-4.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.5.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-5.f90: ...this.
	* testsuite/libgomp.fortran/examples-4/e.54.6.f90: Renamed to...
	* testsuite/libgomp.fortran/examples-4/teams-6.f90: ...this.

From-SVN: r225735
2015-07-13 13:08:13 +00:00
Tom de Vries 9f620bf1ea Insert new bound in try_transform_to_exit_first_loop_alt
2015-07-10  Tom de Vries  <tom@codesourcery.com>

	* tree-parloops.c (try_transform_to_exit_first_loop_alt): If not found,
	insert nit + 1 bound.

	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt-2.f95: New test.
	* testsuite/libgomp.fortran/parloops-exit-first-loop-alt.f95: New test.

	* gfortran.dg/parloops-exit-first-loop-alt-2.f95: New test.
	* gfortran.dg/parloops-exit-first-loop-alt.f95: New test.

From-SVN: r225655
2015-07-10 08:25:18 +00:00
Thomas Schwinge a92defdab7 [nvptx offloading] Only 64-bit configurations are currently supported
PR libgomp/65099
	gcc/
	* config/nvptx/mkoffload.c (main): Create an offload image only in
	64-bit configurations.
	libgomp/
	* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return 0 if not
	in a 64-bit configuration.
	* testsuite/libgomp.oacc-c++/c++.exp: Don't attempt nvidia
	offloading testing if no such device is available.
	* testsuite/libgomp.oacc-c/c.exp: Likewise.
	* testsuite/libgomp.oacc-fortran/fortran.exp: Likewise.

From-SVN: r225560
2015-07-08 16:59:59 +02:00
Tom de Vries cadb53a5e6 Fix libgomp.c/parloops-exit-first-loop-alt{,-3}.c testcases
2015-07-08  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Fix
	second call to f.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.

From-SVN: r225548
2015-07-08 12:31:00 +00:00
Tom de Vries 712cb0bbf3 Add empty loop exit block in transform_to_exit_first_loop_alt
2015-07-07  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/66642
	* tree-parloops.c (transform_to_exit_first_loop_alt): Update function
	header comment.  Rename split_edge variable to edge_at_split.  Split
	exit edge to create new loop exit bb.  Insert loop exit phis in new loop
	exit bb.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Test low
	iteration count case.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c (init): New
	function, factor out of ...
	(main): ... here.  Test low iteration count case.

From-SVN: r225521
2015-07-07 16:25:22 +00:00
Sebastian Huber e5210c77a1 libgomp: Add comment to clarify last_team usage
libgomp/ChangeLog
2015-07-06  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	* libgomp.h (gomp_thread_pool): Comment last_team field.

From-SVN: r225444
2015-07-06 07:21:48 +00:00
Uros Bizjak f70360e7b3 pr66702-1.C: Require vect_simd_clones effective target.
* testsuite/libgomp.c++/pr66702-1.C: Require
	vect_simd_clones effective target.
	* testsuite/libgomp.c++/pr66702-2.C: Ditto.

From-SVN: r225301
2015-07-02 10:17:20 +02:00
Tom de Vries b451c27117 Run testsuite/libgomp.oacc-c++/c++.exp at -O2 by default
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.oacc-c++/c++.exp: Set DEFAULT_CFLAGS to -O2 if not
	already set.  Use DEFAULT_CFLAGS in dg-runtest.
	* testsuite/libgomp.oacc-c-c++-common/collapse-3.c: Remove dg-options
	"-O2".

From-SVN: r225194
2015-06-30 15:43:55 +00:00
Tom de Vries f8e89d9f4d Run testsuite/libgomp.c++/c++.exp at -O2 by default
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c++/c++.exp: Set DEFAULT_CFLAGS to -O2 if not
	already set.  Use DEFAULT_CFLAGS in dg-runtest.
	* testsuite/libgomp.c++/atomic-16.C: Remove dg-options "-O2 -fopenmp".
	* testsuite/libgomp.c++/pr64824.C: Same.
	* testsuite/libgomp.c++/pr64868.C: Same.
	* testsuite/libgomp.c++/pr66199-1.C: Same.
	* testsuite/libgomp.c++/pr66199-2.C: Same.
	* testsuite/libgomp.c++/target-2.C: Same.
	* testsuite/libgomp.c++/for-7.C: Use dg-additional-options for
	-std=<standard> option.
	* testsuite/libgomp.c++/udr-11.C: Same.
	* testsuite/libgomp.c++/udr-12.C: Same.
	* testsuite/libgomp.c++/udr-13.C: Same.
	* testsuite/libgomp.c++/udr-14.C: Same.
	* testsuite/libgomp.c++/udr-15.C: Same.
	* testsuite/libgomp.c++/udr-16.C: Same.
	* testsuite/libgomp.c++/udr-17.C: Same.
	* testsuite/libgomp.c++/udr-18.C: Same.
	* testsuite/libgomp.c++/udr-19.C: Same.
	* testsuite/libgomp.c++/atomic-1.C: Remove dg-options "-O2".
	* testsuite/libgomp.c++/simd-1.C: Same.
	* testsuite/libgomp.c++/simd-2.C: Same.
	* testsuite/libgomp.c++/simd-3.C: Same.
	* testsuite/libgomp.c++/simd-4.C: Same.
	* testsuite/libgomp.c++/simd-5.C: Same.
	* testsuite/libgomp.c++/simd-6.C: Same.
	* testsuite/libgomp.c++/simd-7.C: Same.
	* testsuite/libgomp.c++/simd-8.C: Same.
	* testsuite/libgomp.c++/simd-9.C: Same.
	* testsuite/libgomp.c++/simd10.C: Same.
	* testsuite/libgomp.c++/simd11.C: Same.
	* testsuite/libgomp.c++/simd12.C: Same.
	* testsuite/libgomp.c++/simd13.C: Same.

From-SVN: r225181
2015-06-30 12:22:04 +00:00
Jakub Jelinek 3446fe483e re PR middle-end/66702 (#pragma omp declare simd uniform and linear issues)
PR middle-end/66702
	* omp-low.c (simd_clone_adjust): Handle addressable linear
	or uniform parameters or non-gimple type uniform parameters.

	* testsuite/libgomp.c++/pr66702-1.C: New test.
	* testsuite/libgomp.c++/pr66702-2.C: New test.

From-SVN: r225179
2015-06-30 14:12:42 +02:00
Tom de Vries 8a36714a1b Add parloops-exit-first-loop-alt-{5,6,7}.c
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/parloops-exit-first-loop-alt-5.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-6.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-7.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt.c: Update comment.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-5.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-6.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-7.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Update comment.

From-SVN: r225172
2015-06-30 11:00:32 +00:00
Tom de Vries 4f75d60893 Use max_loop_iterations in transform_to_exit_first_loop_alt
2015-06-30  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/66652
	* tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
	max_loop_iterations to determine if nit + 1 overflows.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (f): Rewrite
	using restrict pointers.
	(main): Add arguments to calls to f.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.

	* gcc.dg/parloops-exit-first-loop-alt-pr66652.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-3.c (f):  Rewrite using restrict
	pointers.
	* gcc.dg/parloops-exit-first-loop-alt.c: Same.

From-SVN: r225162
2015-06-30 08:35:57 +00:00
Andreas Tobler 6d9d1eeb97 configure.ac: Fix check for header <sys/sysctl.h>.
2015-06-23  Andreas Tobler  <andreast@gcc.gnu.org>

    * configure.ac: Fix check for header <sys/sysctl.h>.
    * configure: Regenerate.
    * config.h.in: Likewise.

From-SVN: r224855
2015-06-23 19:59:59 +02:00
Tom de Vries 1222f22bd8 Use abort in parloops-exit-first-loop-alt-{3,4}.c
2015-06-23  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c (main): Use
	abort.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c (main): Same.

From-SVN: r224849
2015-06-23 15:02:25 +00:00
Thomas Schwinge bfcd036fbe libgomp: libgomp.oacc-c-c++-common/lib-62.c is for acc_device_nvidia only
libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Only consider for
	acc_device_nvidia.

From-SVN: r224640
2015-06-19 09:41:44 +02:00
Thomas Schwinge d7efbbf6af libgomp: XFAIL two libgomp.oacc-* tests
PR libgomp/66518
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: XFAIL.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.

From-SVN: r224639
2015-06-19 09:41:37 +02:00
Tom de Vries d7bfc710ab Remove dg-options -O2 in libgomp.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/atomic-1.c: Remove dg-options "-O2".  Use
	dg-additional-options for any remaining options.
	* testsuite/libgomp.c/atomic-2.c: Same.
	* testsuite/libgomp.c/atomic-4.c: Same.
	* testsuite/libgomp.c/atomic-5.c: Same.
	* testsuite/libgomp.c/atomic-6.c: Same.
	* testsuite/libgomp.c/autopar-1.c: Same.
	* testsuite/libgomp.c/copyin-1.c: Same.
	* testsuite/libgomp.c/copyin-2.c: Same.
	* testsuite/libgomp.c/copyin-3.c: Same.
	* testsuite/libgomp.c/examples-4/e.53.5.c: Same.
	* testsuite/libgomp.c/nestedfn-5.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.
	* testsuite/libgomp.c/pr32362-1.c: Same.
	* testsuite/libgomp.c/pr32362-2.c: Same.
	* testsuite/libgomp.c/pr32362-3.c: Same.
	* testsuite/libgomp.c/pr39591-1.c: Same.
	* testsuite/libgomp.c/pr39591-2.c: Same.
	* testsuite/libgomp.c/pr39591-3.c: Same.
	* testsuite/libgomp.c/pr58392.c: Same.
	* testsuite/libgomp.c/pr58756.c: Same.
	* testsuite/libgomp.c/simd-1.c: Same.
	* testsuite/libgomp.c/simd-10.c: Same.
	* testsuite/libgomp.c/simd-11.c: Same.
	* testsuite/libgomp.c/simd-12.c: Same.
	* testsuite/libgomp.c/simd-13.c: Same.
	* testsuite/libgomp.c/simd-14.c: Same.
	* testsuite/libgomp.c/simd-15.c: Same.
	* testsuite/libgomp.c/simd-2.c: Same.
	* testsuite/libgomp.c/simd-3.c: Same.
	* testsuite/libgomp.c/simd-4.c: Same.
	* testsuite/libgomp.c/simd-5.c: Same.
	* testsuite/libgomp.c/simd-6.c: Same.
	* testsuite/libgomp.c/simd-7.c: Same.
	* testsuite/libgomp.c/simd-8.c: Same.
	* testsuite/libgomp.c/simd-9.c: Same.

From-SVN: r224489
2015-06-15 18:10:51 +00:00
Tom de Vries fb5b535246 Fix typo in libgomp/testsuite/libgomp.c/pr35625.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/pr35625.c: Fix typo.

From-SVN: r224483
2015-06-15 13:57:04 +00:00
Tom de Vries ca431befaa Remove -fopenmp in dg-options in libgomp.c
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/atomic-18.c: Remove superfluous -fopenmp setting
	in dg-options.
	* testsuite/libgomp.c/atomic-3.c: Same.
	* testsuite/libgomp.c/debug-1.c: Same.
	* testsuite/libgomp.c/nqueens-1.c: Same.
	* testsuite/libgomp.c/pr26171.c: Same.
	* testsuite/libgomp.c/pr48591.c: Same.
	* testsuite/libgomp.c/pr64824.c: Same.
	* testsuite/libgomp.c/pr64868.c: Same.
	* testsuite/libgomp.c/pr66133.c: Same.
	* testsuite/libgomp.c/pr66199-1.c: Same.
	* testsuite/libgomp.c/pr66199-2.c: Same.
	* testsuite/libgomp.c/target-8.c: Same.

From-SVN: r224480
2015-06-15 13:26:12 +00:00
Tom de Vries 0d8a9e2065 Use dg-additional-options for -std={gnu99,c99}
2015-06-15  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/collapse-3.c: Use dg-additional-options for
	-std={gnu99,c99}.
	* testsuite/libgomp.c/for-1.c: Same.
	* testsuite/libgomp.c/for-2.c: Same.
	* testsuite/libgomp.c/for-3.c: Same.
	* testsuite/libgomp.c/pr35625.c: Same.
	* testsuite/libgomp.c/pr39154.c: Same.
	* testsuite/libgomp.c/simd-16.c: Same.
	* testsuite/libgomp.c/simd-17.c: Same.

From-SVN: r224479
2015-06-15 13:26:03 +00:00
Tom de Vries a6860be9c8 Add gcc.dg/parloops-exit-first-loop-alt-4.c
2015-06-13  Tom de Vries  <tom@codesourcery.com>

	* gcc.dg/parloops-exit-first-loop-alt-4.c: New test.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-4.c: New test.

From-SVN: r224453
2015-06-13 08:05:54 +00:00
Tom de Vries ab3306d23c Update parloops-exit-first-loop-alt{,-2,-3}.c
2015-06-13  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: Add comment.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: Same.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: Add comment.
	(N): Define.
	(main): Use N instead of hardcoded constants.

	* gcc.dg/parloops-exit-first-loop-alt-2.c: Add comment.
	(main): Remove superfluous attributes.
	* gcc.dg/parloops-exit-first-loop-alt-3.c: Same.
	* gcc.dg/parloops-exit-first-loop-alt.c: Same.

From-SVN: r224452
2015-06-13 08:05:44 +00:00
Tom de Vries 7c82d82716 Add transform_to_exit_first_loop_alt
2015-06-05  Tom de Vries  <tom@codesourcery.com>

	merge from gomp4 branch:
	2015-05-28  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/65443
	* tree-parloops.c (replace_imm_uses, replace_uses_in_bb_by)
	(replace_uses_in_bbs_by, transform_to_exit_first_loop_alt)
	(try_transform_to_exit_first_loop_alt): New function.
	(transform_to_exit_first_loop): Use
	try_transform_to_exit_first_loop_alt.

	* gcc.dg/parloops-exit-first-loop-alt-2.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt-3.c: New test.
	* gcc.dg/parloops-exit-first-loop-alt.c: New test.

	* testsuite/libgomp.c/parloops-exit-first-loop-alt-2.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt-3.c: New test.
	* testsuite/libgomp.c/parloops-exit-first-loop-alt.c: New test.

From-SVN: r224154
2015-06-05 15:57:34 +00:00
Bernhard Reutner-Fischer c469078de7 testsuite: auto-wipe dump files
gcc/testsuite/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* lib/gcc-dg.exp (cleanup-ipa-dump, cleanup-rtl-dump,
	cleanup-tree-dump, cleanup-dump, cleanup-saved-temps): Remove.
	Adjust all callers.
	(schedule-cleanups, dg-keep-saved-temps): New proc.
	(gcc-dg-test-1): Schedule cleanups.
	* lib/profopt.exp (profopt-execute): Likewise.
	* g++.dg/cdce3.C: Adjust expected line numbers.
	* gcc.dg/cdce1.c: Likewise.
	* gcc.dg/cdce2.c: Likewise.
	* gcc.dg/strlenopt-22.c: Fix comment delimiter.
	* gcc.dg/strlenopt-24.c: Likewise.
	* gcc.dg/tree-ssa/vrp26.c: Likewise.
	* gcc.dg/tree-ssa/vrp28.c: Likewise.
	* obj-c++.dg/encode-2.mm: Likewise.

libgomp/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* testsuite/libgomp.graphite/bounds.c: Adjust for
	cleanup-tree-dump removal.
	* testsuite/libgomp.graphite/force-parallel-1.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-2.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-3.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-4.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-5.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-6.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-7.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-8.c: Likewise.
	* testsuite/libgomp.graphite/force-parallel-9.c: Likewise.
	* testsuite/libgomp.graphite/pr41118.c: Likewise.


gcc/ChangeLog

2015-05-29  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* config/arm/neon-testgen.ml (emit_epilogue): Remove manual call
	to cleanup-saved-temps.
	* doc/sourcebuild.texi (Clean up generated test files): Expand
	introduction.
	(dg-keep-saved-temps): Document new proc.
	(cleanup-ipa-dump, cleanup-rtl-dump, cleanup-tree-dump,
	cleanup-saved-temps): Remove.

From-SVN: r223858
2015-05-29 10:20:29 +02:00
Uros Bizjak bb3caa3577 futex.h (sys_futex0): Remove function.
* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]: Remove function.
	(futex_wait) [!__x86_64__]: Use __asm operand instead of sys_futex0.
	(futex_wake) [!__x86_64__]: Ditto.

From-SVN: r223821
2015-05-28 15:59:17 +02:00
Julian Brown 9fb5fd444b oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument.
* oacc-init.c (resolve_device): Add FAIL_IS_ERROR argument. Update
	function comment. Only call gomp_fatal if new argument is true.
	(acc_dev_num_out_of_range): New function.
	(acc_init_1, acc_shutdown_1): Update call to resolve_device. Call
	acc_dev_num_out_of_range as appropriate.
	(acc_get_num_devices, acc_set_device_type, acc_get_device_type)
	(acc_get_device_num, acc_set_device_num): Update calls to resolve_device.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Update expected test
	output.

From-SVN: r223803
2015-05-28 10:35:39 +00:00
Julian Brown 32eaed9380 re PR libgomp/65742 (Several libgomp.oacc-* failures after r221922.)
PR libgomp/65742

    gcc/
    * builtins.c (expand_builtin_acc_on_device): Don't use open-coded
    sequence for !ACCEL_COMPILER.

    libgomp/
    * oacc-init.c (plugin/plugin-host.h): Include.
    (acc_on_device): Check whether we're in an offloaded region for
    host_nonshm
    plugin. Don't use __builtin_acc_on_device.
    * plugin/plugin-host.c (GOMP_OFFLOAD_openacc_parallel): Set
    nonshm_exec flag in thread-local data.
    (GOMP_OFFLOAD_openacc_create_thread_data): Allocate thread-local
    data for host_nonshm plugin.
    (GOMP_OFFLOAD_openacc_destroy_thread_data): Free thread-local data
    for host_nonshm plugin.
    * plugin/plugin-host.h: New.

From-SVN: r223801
2015-05-28 09:29:19 +00:00
Uros Bizjak 8ed501f167 wait.h (gomp_futex_wait, [...]): Declare as int.
2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	* config/linux/wait.h (gomp_futex_wait, gomp_futex_wake):
	Declare as int.
	(FUTEX_PRIVATE_FLAG): Remove L suffix.
	* config/linux/mutex.c (gomp_futex_wait, gomp_futex_wake):
	Declare as int.

2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	* config/linux/ia64/futex.h (sys_futex0) Change operand "op" to int.

2015-05-27  Uros Bizjak  <ubizjak@gmail.com>

	Revert:
	* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.

From-SVN: r223780
2015-05-27 23:07:09 +02:00
Uros Bizjak ea023bcfd8 futex.h (sys_futex0): Change operand "op" to long.
libgomp/ChangeLog:

	* config/linux/x86/futex.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.
	[__PIC__]: Remove sys_futex0 function.

libitm/ChangeLog:

	* config/linux/x86/futex_bits.h (sys_futex0) [!__x86_64__]:
	Change operand "op" to long.
	[__PIC__]: Remove sys_futex0 function.

From-SVN: r223771
2015-05-27 21:35:58 +02:00
Chung-Lin Tang 1716efeb6d target.c (gomp_map_pointer): New function abstracting out GOMP_MAP_POINTER handling.
2015-05-27  Chung-Lin Tang  <cltang@codesourcery.com>

	libgomp/
	* target.c (gomp_map_pointer): New function abstracting out
	GOMP_MAP_POINTER handling.
	(gomp_map_vars): Remove GOMP_MAP_POINTER handling code and use
	gomp_map_pointer().

From-SVN: r223737
2015-05-27 06:16:37 +00:00
Jakub Jelinek 41b37d5ec1 re PR middle-end/66199 (lastprivate/linear clause issues on combined constructs)
PR middle-end/66199
	* tree.h (OMP_TEAMS_COMBINED): Define.
	* gimplify.c (enum gimplify_omp_var_data): Add
	GOVD_LINEAR_LASTPRIVATE_NO_OUTER.
	(enum omp_region_type): Add ORT_COMBINED_TEAMS.
	(omp_notice_variable): Accept both ORT_TEAMS
	and ORT_COMBINED_TEAMS.  Don't recurse if
	GOVD_LINEAR_LASTPRIVATE_NO_OUTER is set and either
	GOVD_LINEAR is set, or GOVD_LASTPRIVATE without
	GOVD_FIRSTPRIVATE.
	(omp_no_lastprivate): New function.
	(gimplify_scan_omp_clauses): For OMP_CLAUSE_LASTPRIVATE
	and OMP_CLAUSE_LINEAR, if omp_no_lastprivate, don't
	notice_outer and set appropriate bits, otherwise make
	sure default(none) combined constructs won't complain.
	(gimplify_adjust_omp_clauses): Remove OMP_CLAUSE_LINEAR
	outer special casing, for OMP_CLAUSE_LASTPRIVATE if
	omp_no_lastprivate either remove the clause or turn it
	into OMP_CLAUSE_PRIVATE.
	(gimplify_omp_for): Fix up handling of implicit
	lastprivate or linear iterators.
	(gimplify_omp_workshare): For OMP_TEAMS_COMBINED use
	ORT_COMBINED_TEAMS.
	* omp-low.c (lower_omp_for_lastprivate): For combined
	for simd use fd.loop.n2 from the for rather than simd.
gcc/c/
	* c-parser.c (c_parser_omp_for_loop): Don't add
	OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
	OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
	(c_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
	constructs.
gcc/cp/
	* parser.c (cp_parser_omp_for_loop): Don't add
	OMP_CLAUSE_SHARED to OMP_PARALLEL_CLAUSES when moving
	OMP_CLAUSE_LASTPRIVATE clause to OMP_FOR_CLAUSES.
	(cp_parser_omp_teams): Set OMP_TEAMS_COMBINED for combined
	constructs.
gcc/fortran/
	* trans-openmp.c (gfc_trans_omp_teams): Set OMP_TEAMS_COMBINED for
	combined constructs.
	(gfc_trans_omp_target): Make sure BIND_EXPR has non-NULL
	BIND_EXPR_BLOCK.
libgomp/
	* testsuite/libgomp.c/pr66199-1.c: New test.
	* testsuite/libgomp.c/pr66199-2.c: New test.
	* testsuite/libgomp.c++/pr66199-1.C: New test.
	* testsuite/libgomp.c++/pr66199-2.C: New test.
	* testsuite/libgomp.fortran/pr66199-1.f90: New test.
	* testsuite/libgomp.fortran/pr66199-2.f90: New test.

From-SVN: r223387
2015-05-19 18:16:15 +02:00
Julian Brown c831982647 plugin-nvptx.c (nvptx_get_num_devices): Return zero on cuInit failure.
* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return zero
	on cuInit failure.

From-SVN: r223352
2015-05-19 11:06:31 +00:00
Jakub Jelinek b37dddbc77 re PR middle-end/66133 (Wrong-code with noreturn #pragma omp task body)
PR middle-end/66133
	* omp-low.c (expand_omp_taskreg): For GIMPLE_OMP_TASK expansion,
	make sure it is never noreturn, even when the task body does not
	return.
	(lower_omp_taskreg): For GIMPLE_OMP_TASK, emit GIMPLE_OMP_CONTINUE
	right before GIMPLE_OMP_RETURN.
	(make_gimple_omp_edges): Accept GIMPLE_OMP_CONTINUE as ->cont
	for GIMPLE_OMP_TASK.  For GIMPLE_OMP_RETURN corresponding to
	GIMPLE_OMP_TASK add an EDGE_ABNORMAL edge from entry to exit.

	* testsuite/libgomp.c/pr66133.c: New test.

From-SVN: r223171
2015-05-13 18:59:20 +02:00
Michael Haubenwallner 55fba60115 libgomp: Bump to automake 1.11.6
2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>

	* Makefile.in: Regenerated with automake-1.11.6.
	* aclocal.m4: Likewise.
	* config.h.in: Likewise.
	* configure: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r223143
2015-05-13 11:24:38 +00:00
Jason Merrill 1be0899d94 openacc.h (__GOACC_NOTHROW): Fix noexcept syntax.
* openacc.h (__GOACC_NOTHROW): Fix noexcept syntax.

	* testsuite/libgomp.oacc-c-c++-common/reduction-4.c (main): Use
	_Complex.

From-SVN: r222966
2015-05-09 00:50:35 -04:00
Julian Brown d2463960a4 oacc-init.c (acc_device_lock): Add explanatory comment.
* oacc-init.c (acc_device_lock): Add explanatory comment.
	(resolve_device): Add comment about locking requirement.
	(acc_init_1, acc_shutdown_1): Likewise. Add locking around
	gomp_init_device and gomp_fini_device calls.
	(acc_get_num_devices, acc_set_device_type, acc_get_device_type)
	(acc_get_device_num, acc_set_device_num): Add locking around
	resolve_device and gomp_init_device calls.

From-SVN: r222862
2015-05-06 19:10:14 +00:00
Julian Brown e38fdba42b oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for goacc_thread_lock on error paths.
* oacc-init.c (acc_shutdown_1): Call gomp_mutex_unlock for
	goacc_thread_lock on error paths.
	* oacc-mem.c (lookup_host): Remove locking from function. Note
	locking requirement for caller in function comment.
	(lookup_dev): Likewise.
	(acc_free, acc_deviceptr, acc_hostptr, acc_is_present)
	(acc_map_data, acc_unmap_data, present_create_copy, delete_copyout)
	(update_dev_host, gomp_acc_insert_pointer, gomp_acc_remove_pointer):
	Add locking.

From-SVN: r222860
2015-05-06 16:45:49 +00:00
Thomas Schwinge ae8ffbbb8d [PR testsuite/65205, libgomp/65993] Fix dg-shouldfail usage in OpenACC libgomp tests
In dg-output, don't expect "0x" prefix for "%p" format specifier, don't expect
"(nil)" for NULL pointer.

	PR testsuite/65205
	PR libgomp/65993
	libgomp/
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: In dg-output,
	don't expect "0x" prefix for "%p" format specifier, don't expect
	"(nil)" for NULL pointer.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-1.c: More
	accurately specify what we're looking for.
	* testsuite/libgomp.oacc-c-c++-common/data-already-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/data-already-8.c: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-1.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-2.f: Likewise.
	* testsuite/libgomp.oacc-fortran/data-already-8.f: Likewise.

From-SVN: r222799
2015-05-05 11:39:29 +02:00
James Norris 1309f1d25b [PR testsuite/65205] Fix dg-shouldfail usage in OpenACC libgomp tests
PR testsuite/65205
	libgomp/
	* testsuite/lib/libgomp.exp
	(check_effective_target_openacc_host_selected)
	(check_effective_target_openacc_host_nonshm_selected): New
	procedures.
	* testsuite/libgomp.oacc-c-c++-common/clauses-2.c: Fix misuse of
	dg-shouldfail.
	* testsuite/libgomp.oacc-c-c++-common/lib-1.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-11.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-16.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-17.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-18.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-2.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-20.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-21.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-22.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-23.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-25.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-26.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-27.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-28.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-29.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-3.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-30.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-34.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-35.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-36.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-39.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-4.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-40.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-42.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-43.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-44.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-47.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-48.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-52.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-53.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-54.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-57.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-58.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-62.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-63.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-64.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-65.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-67.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-68.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-71.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-77.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/lib-80.c: Likewise.
	* testsuite/libgomp.oacc-c-c++-common/present-1.c: Likewise.

From-SVN: r222620
2015-04-30 14:44:39 +02:00
Julian Brown d93bdab53b mkoffload.c (process): Support variable mapping.
gcc/
	* config/nvptx/mkoffload.c (process): Support variable mapping.

	libgomp/
	* libgomp.h (target_mem_desc: Remove mem_map field.
	(acc_dispatch_t): Remove open_device_func, close_device_func,
	get_device_num_func, set_device_num_func, target_data members.
	Change create_thread_data_func argument to device number instead of
	generic pointer.
	* oacc-async.c (assert.h): Include.
	(acc_async_test, acc_async_test_all, acc_wait, acc_wait_async)
	(acc_wait_all, acc_wait_all_async): Use current host thread's
	active device, not base_dev.
	* oacc-cuda.c (acc_get_current_cuda_device)
	(acc_get_current_cuda_context, acc_get_cuda_stream)
	(acc_set_cuda_stream): Likewise.
	* oacc-host.c (host_dispatch): Don't set open_device_func,
	close_device_func, get_device_num_func or set_device_num_func.
	* oacc-init.c (base_dev, init_key): Remove.
	(cached_base_dev): New.
	(name_of_acc_device_t): New.
	(acc_init_1): Initialise default-numbered device, not zeroth.
	(acc_shutdown_1): Close all devices of a given type.
	(goacc_destroy_thread): Don't use base_dev.
	(lazy_open, lazy_init, lazy_init_and_open): Remove.
	(goacc_attach_host_thread_to_device): New.
	(acc_init): Reimplement with goacc_attach_host_thread_to_device.
	(acc_get_num_devices): Don't use base_dev.
	(acc_set_device_type): Reimplement.
	(acc_get_device_type): Don't use base_dev.
	(acc_get_device_num): Tweak logic.
	(acc_set_device_num): Likewise.
	(acc_on_device): Use acc_get_device_type.
	(goacc_runtime_initialize): Initialize cached_base_dev not base_dev.
	(goacc_lazy_initialize): Reimplement with acc_init and
	goacc_attach_host_thread_to_device.
	* oacc-int.h (goacc_thread): Add base_dev field.
	(base_dev): Remove extern declaration.
	(goacc_attach_host_thread_to_device): Add prototype.
	* oacc-mem.c (acc_malloc): Use current thread's device instead of
	base_dev.
	(acc_free): Likewise.
	(acc_memcpy_to_device): Likewise.
	(acc_memcpy_from_device): Likewise.
	* oacc-parallel.c (select_acc_device): Remove. Replace calls with
	goacc_lazy_initialize (throughout).
	(GOACC_parallel): Use tgt_offset to locate target functions.
	* target.c (gomp_map_vars): Don't set tgt->mem_map.
	(gomp_unmap_vars): Use devicep->mem_map pointer not tgt->mem_map.
	(gomp_load_plugin_for_device): Remove open_device, close_device,
	get_device_num, set_device_num openacc hook initialisation. Don't set
	openacc.target_data.
	* plugin/plugin-host.c (GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_get_device_num)
	(GOMP_OFFLOAD_openacc_set_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change (unused) argument
	to int.
	* plugin/plugin-nvptx.c (ptx_inited): Remove.
	(instantiated_devices, ptx_dev_lock): New.
	(struct ptx_image_data): New.
	(ptx_devices, ptx_images, ptx_image_lock): New.
	(fini_streams_for_device): Reorder cuStreamDestroy call.
	(nvptx_get_num_devices): Remove forward declaration.
	(nvptx_init): Change return type to bool.
	(nvptx_fini): Remove.
	(nvptx_attach_host_thread_to_device): New.
	(nvptx_open_device): Return struct ptx_device* instead of void*.
	(nvptx_close_device): Change argument type to struct ptx_device*,
	return type to void.
	(nvptx_get_num_devices): Use instantiated_devices not ptx_inited.
	(kernel_target_data, kernel_host_table): Remove static globals.
	(GOMP_OFFLOAD_register_image, GOMP_OFFLOAD_get_table): Remove.
	(GOMP_OFFLOAD_init_device): Reimplement.
	(GOMP_OFFLOAD_fini_device): Likewise.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New.
	(GOMP_OFFLOAD_alloc, GOMP_OFFLOAD_free, GOMP_OFFLOAD_dev2host)
	(GOMP_OFFLOAD_host2dev): Use ORD argument.
	(GOMP_OFFLOAD_openacc_open_device)
	(GOMP_OFFLOAD_openacc_close_device)
	(GOMP_OFFLOAD_openacc_set_device_num)
	(GOMP_OFFLOAD_openacc_get_device_num): Remove.
	(GOMP_OFFLOAD_openacc_create_thread_data): Change argument to int
	(device number).

	libgomp/testsuite/
	* libgomp.oacc-c-c++-common/lib-9.c: Fix devnum check in test.

From-SVN: r221922
2015-04-08 15:58:33 +00:00