[8/10] OpenACC 2.0 support for libgomp - temporarily work around missing __builtin_acc_on_device
diff mbox

Message ID 20140923191955.51a6f761@octopus
State New
Headers show

Commit Message

Julian Brown Sept. 23, 2014, 6:19 p.m. UTC
The patches implementing __builtin_acc_on_device are still in
processing. For the time being this patch removes the dependency on
that builtin in the OpenACC runtime.

Julian

xxxx-xx-xx  Julian Brown  <julian@codesourcery.com>

	libgomp/
	* oacc-init.c (acc_on_device): Temporarily hard-code for host
	instead of using __builtin_acc_on_device.

Patch
diff mbox

commit b74fb2fcb435b646499e9558a64b3989b64ad943
Author: Julian Brown <julian@codesourcery.com>
Date:   Fri Sep 19 11:28:11 2014 -0700

    Work around lack of __builtin_acc_on_device for now

diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index af2d2aa..35fe643 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -451,8 +451,20 @@  ialias (acc_set_device_num)
 int
 acc_on_device (acc_device_t dev)
 {
+#if 1
+  /* Support for __builtin_acc_on_device comes in later patches.  */
+  switch (dev)
+    {
+    case acc_device_none:
+    case acc_device_host:
+      return 1;
+    default:
+      return 0;
+    }
+#else
   /* Just rely on the compiler builtin.  */
   return __builtin_acc_on_device (dev);
+#endif
 }
 ialias (acc_on_device)