diff mbox series

[openacc,committed] Add oacc_get_default_dim

Message ID 59bf3552-b97c-6395-6273-0260518b2d15@suse.de
State New
Headers show
Series [openacc,committed] Add oacc_get_default_dim | expand

Commit Message

Tom de Vries Dec. 19, 2018, 3:27 p.m. UTC
[ Adding gcc-patches ]

-------- Forwarded Message --------
Subject: [openacc, committed] Add oacc_get_default_dim
Date: Wed, 19 Dec 2018 16:24:25 +0100
From: Tom de Vries <tdevries@suse.de>
To: Thomas Schwinge <Thomas_Schwinge@mentor.com>

[ was: Re: [nvptx] vector length patch series -- openacc parts ]

On 19-12-18 11:40, Thomas Schwinge wrote:
> Hi Tom!
> 
> Thanks for picking up this series!
> 
> 
> And just to note:
> 
> On Tue, 18 Dec 2018 00:52:30 +0100, Tom de Vries <tdevries@suse.de> wrote:
>> On 14-12-18 20:58, Tom de Vries wrote:
>>
>>> 0003-openacc-Add-target-hook-TARGET_GOACC_ADJUST_PARALLEL.patch
>>
>>> 0017-nvptx-Enable-large-vectors.patch
>>
>>> 0023-nvptx-Force-vl32-if-calling-vector-partitionable-rou.patch
>>
>> Thomas,
>>
>> these patches are openacc (0003) or have openacc components (0017, 0023).
>>
>> Can you review and possibly approve the openacc parts?
> 
> I've seen this (and your earlier questions), and will get to it
> eventually, thanks.
> 
> 

In that case, let's make the review for the IMO trivial bits post-commit.

Committed the openacc component of 0017 ...

Thanks,
- Tom
diff mbox series

Patch

[openacc] Add oacc_get_default_dim

Expose oacc_default_dims to backends.

2018-12-17  Tom de Vries  <tdevries@suse.de>

	* omp-offload.c (oacc_get_default_dim): New function.
	* omp-offload.h (oacc_get_default_dim): Declare.

---
 gcc/omp-offload.c | 7 +++++++
 gcc/omp-offload.h | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c
index 4457e1a3079..9c7bd7328d1 100644
--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -573,6 +573,13 @@  oacc_xform_tile (gcall *call)
 static int oacc_default_dims[GOMP_DIM_MAX];
 static int oacc_min_dims[GOMP_DIM_MAX];
 
+int
+oacc_get_default_dim (int dim)
+{
+  gcc_assert (0 <= dim && dim < GOMP_DIM_MAX);
+  return oacc_default_dims[dim];
+}
+
 /* Parse the default dimension parameter.  This is a set of
    :-separated optional compute dimensions.  Each specified dimension
    is a positive integer.  When device type support is added, it is
diff --git a/gcc/omp-offload.h b/gcc/omp-offload.h
index 6186f03649e..14edcad8a7d 100644
--- a/gcc/omp-offload.h
+++ b/gcc/omp-offload.h
@@ -22,6 +22,8 @@  along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_OMP_DEVICE_H
 #define GCC_OMP_DEVICE_H
 
+extern int oacc_get_default_dim (int dim);
+
 extern GTY(()) vec<tree, va_gc> *offload_funcs;
 extern GTY(()) vec<tree, va_gc> *offload_vars;