aboutsummaryrefslogtreecommitdiff
path: root/libgomp/oacc-host.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2020-01-10 23:24:36 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2020-01-10 23:24:36 +0100
commit6fc0385c0ce39470e137eab27dee8955b3f98258 (patch)
tree0a95a071bafad5393c048a74bec3cdb005499f3d /libgomp/oacc-host.c
parentb3b75e664a619dae98571a0b3ac8034f5fa7c2be (diff)
downloadgcc-6fc0385c0ce39470e137eab27dee8955b3f98258.zip
gcc-6fc0385c0ce39470e137eab27dee8955b3f98258.tar.gz
gcc-6fc0385c0ce39470e137eab27dee8955b3f98258.tar.bz2
OpenACC 'acc_get_property' cleanup
include/ * gomp-constants.h (enum gomp_device_property): Remove. libgomp/ * libgomp-plugin.h (enum goacc_property): New. Adjust all users to use this instead of 'enum gomp_device_property'. (GOMP_OFFLOAD_get_property): Rename to... (GOMP_OFFLOAD_openacc_get_property): ... this. Adjust all users. * libgomp.h (struct gomp_device_descr): Move 'GOMP_OFFLOAD_openacc_get_property'... (struct acc_dispatch_t): ... here. Adjust all users. * plugin/plugin-hsa.c (GOMP_OFFLOAD_get_property): Remove. liboffloadmic/ * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_property): Remove. From-SVN: r280150
Diffstat (limited to 'libgomp/oacc-host.c')
-rw-r--r--libgomp/oacc-host.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/libgomp/oacc-host.c b/libgomp/oacc-host.c
index 22c1894..4638789 100644
--- a/libgomp/oacc-host.c
+++ b/libgomp/oacc-host.c
@@ -59,27 +59,6 @@ host_get_num_devices (void)
return 1;
}
-static union gomp_device_property_value
-host_get_property (int n, int prop)
-{
- union gomp_device_property_value nullval = { .val = 0 };
-
- if (n >= host_get_num_devices ())
- return nullval;
-
- switch (prop)
- {
- case GOMP_DEVICE_PROPERTY_NAME:
- return (union gomp_device_property_value) { .ptr = "GOMP" };
- case GOMP_DEVICE_PROPERTY_VENDOR:
- return (union gomp_device_property_value) { .ptr = "GNU" };
- case GOMP_DEVICE_PROPERTY_DRIVER:
- return (union gomp_device_property_value) { .ptr = VERSION };
- default:
- return nullval;
- }
-}
-
static bool
host_init_device (int n __attribute__ ((unused)))
{
@@ -245,6 +224,29 @@ host_openacc_async_destruct (struct goacc_asyncqueue *aq
return true;
}
+static union goacc_property_value
+host_openacc_get_property (int n, enum goacc_property prop)
+{
+ union goacc_property_value nullval = { .val = 0 };
+
+ if (n >= host_get_num_devices ())
+ return nullval;
+
+ switch (prop)
+ {
+ case GOACC_PROPERTY_NAME:
+ return (union goacc_property_value) { .ptr = "GOMP" };
+ case GOACC_PROPERTY_VENDOR:
+ return (union goacc_property_value) { .ptr = "GNU" };
+ case GOACC_PROPERTY_DRIVER:
+ return (union goacc_property_value) { .ptr = VERSION };
+ case GOACC_PROPERTY_MEMORY:
+ case GOACC_PROPERTY_FREE_MEMORY:
+ default:
+ return nullval;
+ }
+}
+
static void *
host_openacc_create_thread_data (int ord __attribute__ ((unused)))
{
@@ -269,7 +271,6 @@ static struct gomp_device_descr host_dispatch =
.get_caps_func = host_get_caps,
.get_type_func = host_get_type,
.get_num_devices_func = host_get_num_devices,
- .get_property_func = host_get_property,
.init_device_func = host_init_device,
.fini_device_func = host_fini_device,
.version_func = host_version,
@@ -303,6 +304,8 @@ static struct gomp_device_descr host_dispatch =
.host2dev_func = host_openacc_async_host2dev,
},
+ .get_property_func = host_openacc_get_property,
+
.cuda = {
.get_current_device_func = NULL,
.get_current_context_func = NULL,