From b75e9c83dea4357b09eb505f03570be8fa4f3d99 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 19 Dec 2018 15:19:56 +0000 Subject: [PATCH] [openacc] Add oacc_get_default_dim Expose oacc_default_dims to backends. 2018-12-19 Tom de Vries * omp-offload.c (oacc_get_default_dim): New function. * omp-offload.h (oacc_get_default_dim): Declare. From-SVN: r267274 --- gcc/ChangeLog | 5 +++++ gcc/omp-offload.c | 7 +++++++ gcc/omp-offload.h | 2 ++ 3 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2118d8de8d..8dc0e289f21 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-12-19 Tom de Vries + + * omp-offload.c (oacc_get_default_dim): New function. + * omp-offload.h (oacc_get_default_dim): Declare. + 2018-12-19 David Malcolm PR c++/87504 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 *offload_funcs; extern GTY(()) vec *offload_vars; -- 2.30.2