]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add OpenACC 2.6 `acc_get_property' support: restore Intel MIC offloading
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 8 Jan 2019 14:21:35 +0000 (15:21 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Tue, 3 Mar 2020 11:17:18 +0000 (12:17 +0100)
The "OpenACC 2.6 `acc_get_property' support" changes regressed the relevant
libgomp OpenMP execution test cases to no longer consider Intel MIC offloading
because of:

    libgomp: while loading libgomp-plugin-intelmic.so.1: [...]/libgomp-plugin-intelmic.so.1: undefined symbol: GOMP_OFFLOAD_get_property

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

(cherry picked from openacc-gcc-9-branch commit
1fa609ba73e9990ae7a65b083047f0ee219167b3)

liboffloadmic/ChangeLog.omp
liboffloadmic/plugin/libgomp-plugin-intelmic.cpp

index 521d4490f0b5419fce3c2102c2884a0e1fa902dc..75f8ee518e4f0fcd5c206d35b8556e2ec178f46c 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-08  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_get_property):
+       New function.
+
 2019-02-26  Chung-Lin Tang  <cltang@codesourcery.com>
 
        * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version):
index d1678d0514e91e775fff7fe361b861f706b53782..ed78c8d9dd4419a28159fdff943350f58f7e81d6 100644 (file)
@@ -174,6 +174,27 @@ GOMP_OFFLOAD_get_num_devices (void)
   return num_devices;
 }
 
+extern "C" union gomp_device_property_value
+GOMP_OFFLOAD_get_property (int n, int prop)
+{
+  union gomp_device_property_value nullval = { .val = 0 };
+
+  if (n >= num_devices)
+    {
+      GOMP_PLUGIN_error
+       ("Request for a property of a non-existing Intel MIC device %i", n);
+      return nullval;
+    }
+
+  switch (prop)
+    {
+    case GOMP_DEVICE_PROPERTY_VENDOR:
+      return (union gomp_device_property_value) { .ptr = /* TODO: "error: invalid conversion from 'const void*' to 'void*' [-fpermissive]" */ (char *) "Intel" };
+    default:
+      return nullval;
+    }
+}
+
 static bool
 offload (const char *file, uint64_t line, int device, const char *name,
         int num_vars, VarDesc *vars, const void **async_data)