gcc/libgomp/testsuite
Kwok Cheung Yeung 637e76b90e openmp: Change to using a hashtab to lookup offload target addresses for indirect function calls
A splay-tree was previously used to lookup equivalent target addresses
for a given host address on offload targets. However, as splay-trees can
modify their structure on lookup, they are not suitable for concurrent
access from separate teams/threads without some form of locking.  This
patch changes the lookup data structure to a hashtab instead, which does
not have these issues.

The call to build_indirect_map to initialize the data structure is now
called from just the first thread of the first team to avoid redundant
calls to this function.

2024-03-22  Kwok Cheung Yeung  <kcyeung@baylibre.com>

	libgomp/
	* config/accel/target-indirect.c: Include string.h and hashtab.h.
	Remove include of splay-tree.h.  Update comments.
	(splay_tree_prefix, splay_tree_c): Delete.
	(struct indirect_map_t): New.
	(hash_entry_type, htab_alloc, htab_free, htab_hash, htab_eq): New.
	(GOMP_INDIRECT_ADD_MAP): Remove volatile qualifier.
	(USE_SPLAY_TREE_LOOKUP): Rename to...
	(USE_HASHTAB_LOOKUP): ..this.
	(indirect_map, indirect_array): Delete.
	(indirect_htab): New.
	(build_indirect_map): Remove locking.  Build indirect map using
	hashtab.
	(GOMP_target_map_indirect_ptr): Use indirect_htab to lookup target
	address.
	(GOMP_target_map_indirect_ptr): Remove volatile qualifier.
	* config/gcn/team.c (gomp_gcn_enter_kernel): Call build_indirect_map
	from first thread of first team only.
	* config/nvptx/team.c (gomp_nvptx_main): Likewise.
	* testsuite/libgomp.c-c++-common/declare-target-indirect-2.c (main):
	Add missing break statements.
	* testsuite/libgomp.fortran/declare-target-indirect-2.f90: Remove
	xfail.
2024-03-22 18:09:40 +00:00
..
config Update copyright years. 2024-01-03 12:19:35 +01:00
lib libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] 2023-09-12 11:30:37 +02:00
libgomp.c Revert "Set num_threads to 50 on 32-bit hppa in two libgomp loop tests" 2024-03-06 17:01:59 +00:00
libgomp.c++ Revert "Set num_threads to 50 on 32-bit hppa in two libgomp loop tests" 2024-03-06 17:01:59 +00:00
libgomp.c-c++-common openmp: Change to using a hashtab to lookup offload target addresses for indirect function calls 2024-03-22 18:09:40 +00:00
libgomp.fortran openmp: Change to using a hashtab to lookup offload target addresses for indirect function calls 2024-03-22 18:09:40 +00:00
libgomp.graphite Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp.oacc-c libgomp testsuite: Have each '*.exp' file specify the compiler to use [PR91884] 2023-05-15 12:11:17 +02:00
libgomp.oacc-c++ libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] 2023-09-12 11:30:37 +02:00
libgomp.oacc-c-c++-common OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} 2024-02-27 17:30:38 +01:00
libgomp.oacc-fortran Fix 'char' initialization, copy, check in 'libgomp.oacc-fortran/acc-memcpy.f90' 2024-03-14 15:41:33 +01:00
flock Support parallel testing in libgomp: fallback Perl 'flock' [PR66005] 2023-06-02 09:51:15 +02:00
libgomp-site-extra.exp.in libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] 2023-09-12 11:30:37 +02:00
libgomp-test-support.exp.in libgomp nvptx plugin: Remove '--with-cuda-driver=[...]' etc. configuration option 2022-06-10 17:08:57 +02:00
Makefile.am Support parallel testing in libgomp, part II [PR66005] 2023-05-15 12:11:18 +02:00
Makefile.in libgomp: Consider '--with-build-sysroot=[...]' for target libraries' build-tree testing (instead of build-time 'CC' etc.) [PR91884, PR109951] 2023-09-12 11:30:37 +02:00