c++: Explicit constructor called in copy-initialization [PR90320]
[gcc.git] / libgomp / oacc-host.c
index 845140f04f52b6ac4898b096452f4cfa2fff5c0e..46387897b13b203f8f3bbe769346fc7becbe49ac 100644 (file)
@@ -1,6 +1,6 @@
 /* OpenACC Runtime Library: acc_device_host.
 
-   Copyright (C) 2013-2019 Free Software Foundation, Inc.
+   Copyright (C) 2013-2020 Free Software Foundation, Inc.
 
    Contributed by Mentor Embedded.
 
@@ -224,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)))
 {
@@ -281,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,