diff mbox

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

Message ID 20141111135349.74df4488@octopus
State New
Headers show

Commit Message

Julian Brown Nov. 11, 2014, 1:53 p.m. UTC
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

Comments

Jakub Jelinek Nov. 13, 2014, 9:34 a.m. UTC | #1
On Tue, Nov 11, 2014 at 01:53:49PM +0000, Julian Brown wrote:
> 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?

This is ok if the middle-end bits don't make it first, but please file
a PR that it should be removed again in that case.

	Jakub
diff mbox

Patch

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