aboutsummaryrefslogtreecommitdiff
path: root/libgcc/config/nvptx
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2015-11-18 13:49:17 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2015-11-18 13:49:17 +0000
commit33f47f427920586a6f21dd8f1b1adc582b9fb7af (patch)
tree91925ad53ac42a3a444905c3ffb894e6ec7c3a18 /libgcc/config/nvptx
parentd085c468179245fdd31c1014d3029ddd9e116e01 (diff)
downloadgcc-33f47f427920586a6f21dd8f1b1adc582b9fb7af.zip
gcc-33f47f427920586a6f21dd8f1b1adc582b9fb7af.tar.gz
gcc-33f47f427920586a6f21dd8f1b1adc582b9fb7af.tar.bz2
nvptx.c (global_lock_var): New.
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. From-SVN: r230545
Diffstat (limited to 'libgcc/config/nvptx')
-rw-r--r--libgcc/config/nvptx/reduction.c31
-rw-r--r--libgcc/config/nvptx/t-nvptx3
2 files changed, 33 insertions, 1 deletions
diff --git a/libgcc/config/nvptx/reduction.c b/libgcc/config/nvptx/reduction.c
new file mode 100644
index 0000000..11bad4c
--- /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 34d68cc..e66188f 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