gcc/include
Maciej W. Rozycki 6c84c8bf9b Add OpenACC 2.6 `acc_get_property' support
Add generic support for the OpenACC 2.6 `acc_get_property' and
`acc_get_property_string' routines, as well as full handlers for the
host and the NVPTX offload targets and minimal handlers for the HSA,
Intel MIC, and AMD GCN offload targets.

Included are C/C++ and Fortran tests that, in particular, print
the property values for acc_property_vendor, acc_property_memory,
acc_property_free_memory, acc_property_name, and acc_property_driver.
The output looks as follows:

Vendor: GNU
Name: GOMP
Total memory: 0
Free memory: 0
Driver: 1.0

with the host driver (where the memory related properties are not
supported for the host device and yield 0, conforming to the standard)
and output like:

Vendor: Nvidia
Total memory: 12651462656
Free memory: 12202737664
Name: TITAN V
Driver: CUDA Driver 9.1

with the NVPTX driver.

2019-12-22  Maciej W. Rozycki  <macro@codesourcery.com>
	    Frederik Harwath  <frederik@codesourcery.com>
	    Thomas Schwinge  <tschwinge@codesourcery.com>

	include/
	* gomp-constants.h (gomp_device_property): New enum.

	libgomp/
	* libgomp.h (gomp_device_descr): Add `get_property_func' member.
	* libgomp-plugin.h (gomp_device_property_value): New union.
	(gomp_device_property_value): New prototype.
	* openacc.h (acc_device_t): Add `acc_device_current' enumeration
	constant.
	(acc_device_property_t): New enum.
	(acc_get_property, acc_get_property_string): New prototypes.
	* oacc-init.c (acc_get_device_type): Also assert that result
	is not `acc_device_current'.
	(get_property_any, acc_get_property, acc_get_property_string):
	New functions.
	* openacc.f90 (openacc_kinds): Add `acc_device_current' and
	`acc_property_memory', `acc_property_free_memory',
	`acc_property_name', `acc_property_vendor' and
	`acc_property_driver' constants.  Add `acc_device_property' data
	type.
	(openacc_internal): Add `acc_get_property' and
	`acc_get_property_string' interfaces.  Add `acc_get_property_h',
	`acc_get_property_string_h', `acc_get_property_l' and
	`acc_get_property_string_l'.
	* oacc-host.c (host_get_property): New function.
	(host_dispatch): Wire it.
	* target.c (gomp_load_plugin_for_device): Handle `get_property'.
	* libgomp.map (OACC_2.6): Add `acc_get_property', `acc_get_property_h_',
	`acc_get_property_string' and `acc_get_property_string_h_' symbols.
	* libgomp.texi (OpenACC Runtime Library Routines): Add
	`acc_get_property'.
	(acc_get_property): New node.
	* plugin/plugin-gcn.c (GOMP_OFFLOAD_get_property): New
	function (stub).
	* plugin/plugin-hsa.c (GOMP_OFFLOAD_get_property): New function.
	* plugin/plugin-nvptx.c (CUDA_CALLS): Add `cuDeviceGetName',
	`cuDeviceTotalMem', `cuDriverGetVersion' and `cuMemGetInfo'
	calls.
	(GOMP_OFFLOAD_get_property): New function.
	(struct ptx_device): Add new field "name".
	(cuda_driver_version_s): Add new static variable ...
	(nvptx_init): ... and init from here.

	* testsuite/libgomp.oacc-c-c++-common/acc_get_property.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-3.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/acc_get_property-aux.c: New file
	with test helper functions.

	* testsuite/libgomp.oacc-fortran/acc_get_property.f90: New test.

	liboffloadmic/
	* plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_property):
	New function.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>


Co-Authored-By: Frederik Harwath <frederik@codesourcery.com>
Co-Authored-By: Thomas Schwinge <tschwinge@codesourcery.com>

From-SVN: r279710
2019-12-22 19:54:09 +00:00
..
gdb Update copyright years. 2019-01-01 13:31:55 +01:00
COPYING
COPYING3
ChangeLog Add OpenACC 2.6 `acc_get_property' support 2019-12-22 19:54:09 +00:00
ChangeLog-9103
ChangeLog.jit
ansidecl.h Add warn_unused_result attribute for memory-related functions in libiberty. 2019-06-10 07:42:43 +00:00
demangle.h [PATCH] Fix slowness in demangler 2019-11-16 10:14:14 -07:00
dwarf2.def Update copyright years. 2019-01-01 13:31:55 +01:00
dwarf2.h Update copyright years. 2019-01-01 13:31:55 +01:00
dyn-string.h Update copyright years. 2019-01-01 13:31:55 +01:00
environ.h Update copyright years. 2019-01-01 13:31:55 +01:00
fibheap.h Update copyright years. 2019-01-01 13:31:55 +01:00
filenames.h Update copyright years. 2019-01-01 13:31:55 +01:00
floatformat.h Update copyright years. 2019-01-01 13:31:55 +01:00
fnmatch.h Update copyright years. 2019-01-01 13:31:55 +01:00
gcc-c-fe.def Update copyright years. 2019-01-01 13:31:55 +01:00
gcc-c-interface.h Update copyright years. 2019-01-01 13:31:55 +01:00
gcc-cp-fe.def Update copyright years. 2019-01-01 13:31:55 +01:00
gcc-cp-interface.h Update copyright years. 2019-01-01 13:31:55 +01:00
gcc-interface.h Update copyright years. 2019-01-01 13:31:55 +01:00
getopt.h Update copyright years. 2019-01-01 13:31:55 +01:00
gomp-constants.h Add OpenACC 2.6 `acc_get_property' support 2019-12-22 19:54:09 +00:00
hashtab.h Update copyright years. 2019-01-01 13:31:55 +01:00
hsa.h Update copyright years. 2019-01-01 13:31:55 +01:00
leb128.h Update copyright years. 2019-01-01 13:31:55 +01:00
libiberty.h Fix file descriptor existence of MinGW. 2019-08-08 07:50:28 +00:00
longlong.h [ARC]PR 88409: miscompilation due to missing cc clobber in longlong.h macros 2019-04-03 11:53:03 +02:00
lto-symtab.h Update copyright years. 2019-01-01 13:31:55 +01:00
md5.h Update copyright years. 2019-01-01 13:31:55 +01:00
objalloc.h Update copyright years. 2019-01-01 13:31:55 +01:00
obstack.h Update copyright years. 2019-01-01 13:31:55 +01:00
partition.h Update copyright years. 2019-01-01 13:31:55 +01:00
plugin-api.h PR other/16615 [2/5] 2019-01-09 16:39:49 -05:00
safe-ctype.h Update copyright years. 2019-01-01 13:31:55 +01:00
sha1.h Update copyright years. 2019-01-01 13:31:55 +01:00
simple-object.h Update copyright years. 2019-01-01 13:31:55 +01:00
sort.h Update copyright years. 2019-01-01 13:31:55 +01:00
splay-tree.h Fix splay tree KEY leak detected in GDB test gdb.base/macscp.exp 2019-02-12 13:02:48 +00:00
symcat.h Update copyright years. 2019-01-01 13:31:55 +01:00
timeval-utils.h Update copyright years. 2019-01-01 13:31:55 +01:00
unique-ptr.h Update copyright years. 2019-01-01 13:31:55 +01:00
vtv-change-permission.h Update copyright years. 2019-01-01 13:31:55 +01:00
xregex.h
xregex2.h Update copyright years. 2019-01-01 13:31:55 +01:00
xtensa-config.h Update copyright years. 2019-01-01 13:31:55 +01:00