gcc/libgomp
Ilya Verbin a51df54e48 libgomp: rework initialization of offloading
gcc/
	* config/i386/intelmic-mkoffload.c (generate_host_descr_file): Call
	GOMP_offload_unregister from the destructor.
libgomp/
	* libgomp-plugin.h (struct mapping_table): Replace with addr_pair.
	* libgomp.h (struct gomp_memory_mapping): Remove.
	(struct target_mem_desc): Change type of mem_map from
	gomp_memory_mapping * to splay_tree_s *.
	(struct gomp_device_descr): Remove register_image_func, get_table_func.
	Add load_image_func, unload_image_func.
	Change type of mem_map from gomp_memory_mapping to splay_tree_s.
	Remove offload_regions_registered.
	(gomp_init_tables): Remove.
	(gomp_free_memmap): Change type of argument from gomp_memory_mapping *
	to splay_tree_s *.
	* libgomp.map (GOMP_4.0.1): Add GOMP_offload_unregister.
	* oacc-host.c (host_dispatch): Do not initialize register_image_func,
	get_table_func, mem_map.is_initialized, mem_map.splay_tree.root,
	offload_regions_registered.
	Initialize load_image_func, unload_image_func, mem_map.root.
	(goacc_host_init): Do not initialize host_dispatch.mem_map.lock.
	* oacc-init.c (lazy_open): Don't call gomp_init_tables.
	(acc_shutdown_1): Use dev's lock and splay_tree instead of mem_map's.
	* oacc-mem.c (lookup_host): Get gomp_device_descr *dev instead of
	gomp_memory_mapping *.  Use dev's lock and splay_tree.
	(lookup_dev): Use dev's lock.
	(acc_deviceptr): Pass dev to lookup_host instead of mem_map.
	(acc_is_present): Likewise.
	(acc_map_data): Likewise.
	(acc_unmap_data): Likewise.  Use dev's lock.
	(present_create_copy): Likewise.
	(delete_copyout): Pass dev to lookup_host instead of mem_map.
	(update_dev_host): Likewise.
	(gomp_acc_remove_pointer): Likewise.  Use dev's lock.
	* oacc-parallel.c (GOACC_parallel): Use dev's lock and splay_tree.
	* plugin/plugin-host.c (GOMP_OFFLOAD_register_image): Remove.
	(GOMP_OFFLOAD_get_table): Remove
	(GOMP_OFFLOAD_load_image): New function.
	(GOMP_OFFLOAD_unload_image): New function.
	* target.c (register_lock): New mutex for offload image registration.
	(num_devices): Do not guard with PLUGIN_SUPPORT.
	(gomp_realloc_unlock): New static function.
	(gomp_map_vars_existing): Add device descriptor argument.  Unlock mutex
	before gomp_fatal.
	(gomp_map_vars): Use dev's lock and splay_tree instead of mem_map's.
	Pass devicep to gomp_map_vars_existing.  Unlock mutex before gomp_fatal.
	(gomp_copy_from_async): Use dev's lock and splay_tree instead of
	mem_map's.
	(gomp_unmap_vars): Likewise.
	(gomp_update): Remove gomp_memory_mapping argument.  Use dev's lock and
	splay_tree instead of mm's.  Unlock mutex before gomp_fatal.
	(gomp_offload_image_to_device): New static function.
	(GOMP_offload_register): Add mutex lock.
	Call gomp_offload_image_to_device for all initialized devices.
	Replace gomp_realloc with gomp_realloc_unlock.
	(GOMP_offload_unregister): New function.
	(gomp_init_tables): Replace with gomp_init_device.  Replace a call to
	get_table_func from the plugin with calls to init_device_func and
	gomp_offload_image_to_device.
	(gomp_free_memmap): Change type of argument from gomp_memory_mapping *
	to splay_tree_s *.
	(GOMP_target): Do not call gomp_init_tables.  Use dev's lock and
	splay_tree instead of mem_map's.  Unlock mutex before gomp_fatal.
	(GOMP_target_data): Do not call gomp_init_tables.
	(GOMP_target_update): Likewise.  Remove argument from gomp_update.
	(gomp_load_plugin_for_device): Replace register_image and get_table
	with load_image and unload_image in DLSYM ().
	(gomp_register_images_for_device): Remove function.
	(gomp_target_init): Do not initialize current_device.mem_map.*,
	current_device.offload_regions_registered.
	Remove call to gomp_register_images_for_device.
	Do not free offload_images and num_offload_images.
liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp: Include map.
	(AddrVect, DevAddrVect, ImgDevAddrMap): New typedefs.
	(num_devices, num_images, address_table): New static vars.
	(num_libraries, lib_descrs): Remove static vars.
	(set_mic_lib_path): Rename to ...
	(init): ... this.  Allocate address_table and get num_devices.
	(GOMP_OFFLOAD_get_num_devices): return num_devices.
	(load_lib_and_get_table): Remove static function.
	(offload_image): New static function.
	(GOMP_OFFLOAD_get_table): Remove function.
	(GOMP_OFFLOAD_load_image, GOMP_OFFLOAD_unload_image): New functions.

From-SVN: r221878
2015-04-06 12:40:28 +00:00
..
config re PR libgomp/64635 (darwin produces libgomp-plugin-host_nonshm.1.dylib but tries to load libgomp-plugin-host_nonshm.so.1) 2015-02-01 22:31:31 -05:00
plugin libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
testsuite re PR middle-end/65597 (ICE in build_outer_var_ref, at omp-low.c:1043) 2015-03-30 19:54:05 +02:00
ChangeLog libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
ChangeLog.graphite Add forgotten ChangeLog entries. 2010-03-08 17:49:42 +00:00
Makefile.am Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
Makefile.in Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
acinclude.m4 Fix Solaris symbol versioning (PR libstdc++/52188) 2012-02-27 13:51:50 +00:00
aclocal.m4 re PR libstdc++/36104 (gnu-versioned-namespace is broken) 2011-01-20 23:41:24 +00:00
alloc.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
barrier.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
config.h.in Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
configure libgomp: Add RTEMS support 2015-03-13 10:57:07 +00:00
configure.ac libgomp: Add RTEMS support 2015-03-13 10:57:07 +00:00
configure.tgt libgomp: Add RTEMS support 2015-03-13 10:57:07 +00:00
critical.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
env.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
error.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
fortran.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
hashtab.h Update copyright years. 2015-01-05 13:33:28 +01:00
iter.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
iter_ull.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
libgomp-plugin.c libgomp: Make GOMP_PLUGIN_debug actually work... 2015-02-17 19:24:07 +01:00
libgomp-plugin.h libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
libgomp.h libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
libgomp.map libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
libgomp.spec.in Generally link to libgomp for -ftree-parallelize-loops=*. 2013-11-07 16:07:34 +01:00
libgomp.texi Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
libgomp_f.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
libgomp_g.h [PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter. 2015-01-19 13:03:35 +01:00
loop.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
loop_ull.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
oacc-async.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-cuda.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-host.c libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
oacc-init.c libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
oacc-int.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-mem.c libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
oacc-parallel.c libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
oacc-plugin.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-plugin.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
oacc-ptx.h libgomp: Make nvptx helper routines self-contained. 2015-02-17 19:05:24 +01:00
omp.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
omp_lib.f90.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
omp_lib.h.in libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
openacc.f90 Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
openacc.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
openacc_lib.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
ordered.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
parallel.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
sections.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
single.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
splay-tree.c Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
splay-tree.h Merge current set of OpenACC changes from gomp-4_0-branch. 2015-01-15 21:11:12 +01:00
target.c libgomp: rework initialization of offloading 2015-04-06 12:40:28 +00:00
task.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
team.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00
work.c libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library. 2015-01-10 20:10:37 +01:00