This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/5] OpenACC 2.0 support for libgomp - temporarily work around missing __builtin_acc_on_device (repost)


On Tue, 23 Sep 2014 19:19:55 +0100
Julian Brown <julian@codesourcery.com> wrote:

> 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.

This patch remains unchanged from the last posting.

OK to apply?

Julian
>From 99e76023ff0759925403b43e19612fb859c3759e Mon Sep 17 00:00:00 2001
From: Julian Brown <julian@codesourcery.com>
Date: Fri, 19 Sep 2014 11:28:11 -0700
Subject: [PATCH 2/5] Work around lack of __builtin_acc_on_device for now

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.
---
 libgomp/oacc-init.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libgomp/oacc-init.c b/libgomp/oacc-init.c
index 8c91ea7..1cbb4d7 100644
--- a/libgomp/oacc-init.c
+++ b/libgomp/oacc-init.c
@@ -545,8 +545,20 @@ acc_on_device (acc_device_t dev)
       && acc_device_type (thr->dev->type) == acc_device_host_nonshm)
     return dev == acc_device_host_nonshm || dev == acc_device_not_host;
 
+#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)
 
-- 
1.7.10.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]