On 09/17/2015 04:40 PM, Nathan Sidwell wrote:

Added call to gomp_fatal, indicating libgomp is out of date. Also added
a default to the switch following with the same effect.  The trouble
with implementing handling of device_type here now, is difficulty in
testing its correctness.  If it were  buggy we'd be in a worse position
than not having it.

Is that so difficult though? See if nvptx ignores (let's say) intelmic arguments in favour of the default and accepts nvptx ones.

+  if (num_waits > 8)
+    gomp_fatal ("too many waits for legacy interface");
+
+  va_start (ap, num_waits);
+  for (ix = 0; ix != num_waits; ix++)
+    waits[ix] = va_arg (ap, int);
+  waits[ix] = 0;
+  va_end (ap);

I still don't like this. I think there are at least two better alternatives: add a new GOMP_LAUNCH_key which makes GOACC_parallel read a number of waits from a va_list * pointer passed after it, or just admit that the legacy function always does host fallback and just truncate the current version after

  if (host_fallback)
    {
      goacc_save_and_set_bind (acc_device_host);
      fn (hostaddrs);
      goacc_restore_bind ();
      return;
    }

(which incidentally ignores all the wait arguments).

Other than that the patch is fine with me, but Jakub should have the last word.


Bernd

Reply via email to