summaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-18 13:49:17 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-18 13:49:17 +0000
commit1927fff50e07a86001f6e61d8b3cda9fa6465831 (patch)
tree91925ad53ac42a3a444905c3ffb894e6ec7c3a18 /libgcc
parent19f3f4dc085e6ae2a26d5f24b3a60d2a3e3fd5a3 (diff)
downloadgcc-1927fff50e07a86001f6e61d8b3cda9fa6465831.tar.gz
gcc/
* config/nvptx/nvptx.c (global_lock_var): New. (nvptx_global_lock_addr): New. (nvptx_lockless_update): Recomment and adjust for clarity. (nvptx_lockfull_update): New. (nvptx_reduction_update): New. (nvptx_goacc_reduction_fini): Call it. libgcc/ * config/nvptx/reduction.c: New. * config/nvptx/t-nvptx (LIB2ADD): Add it. libgomp/ * testsuite/libgomp.oacc-c-c++-common/reduction-cplx-flt.c: Add worker & gang cases. * testsuite/libgomp.oacc-c-c++-common/reduction-cplx-dbl.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230545 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog5
-rw-r--r--libgcc/config/nvptx/reduction.c31
-rw-r--r--libgcc/config/nvptx/t-nvptx3
3 files changed, 38 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index a4a17e0b2f2..8ab02ab3f08 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-11-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/nvptx/reduction.c: New.
+ * config/nvptx/t-nvptx (LIB2ADD): Add it.
+
2015-11-15 David Edelsohn <dje.gcc@gmail.com>
* config/rs6000/on_exit.c: New file.
diff --git a/libgcc/config/nvptx/reduction.c b/libgcc/config/nvptx/reduction.c
new file mode 100644
index 00000000000..11bad4c3306
--- /dev/null
+++ b/libgcc/config/nvptx/reduction.c
@@ -0,0 +1,31 @@
+/* Oversized reductions lock variable
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ Contributed by Mentor Graphics.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+
+/* We use a global lock variable for reductions on objects larger than
+ 64 bits. Until and unless proven that lock contention for
+ different reduction is a problem, a single lock will suffice. */
+
+unsigned volatile __reduction_lock = 0;
diff --git a/libgcc/config/nvptx/t-nvptx b/libgcc/config/nvptx/t-nvptx
index 34d68cca6cd..e66188f8722 100644
--- a/libgcc/config/nvptx/t-nvptx
+++ b/libgcc/config/nvptx/t-nvptx
@@ -1,6 +1,7 @@
LIB2ADD=$(srcdir)/config/nvptx/malloc.asm \
$(srcdir)/config/nvptx/free.asm \
- $(srcdir)/config/nvptx/realloc.c
+ $(srcdir)/config/nvptx/realloc.c \
+ $(srcdir)/config/nvptx/reduction.c
LIB2ADDEH=
LIB2FUNCS_EXCLUDE=__main