+2019-01-12 Tom de Vries <tdevries@suse.de>
+
+ * config/nvptx/nvptx.c (nvptx_goacc_validate_dims_1)
+ (nvptx_goacc_validate_dims): Add used parameter.
+ * doc/tm.texi: Regenerate.
+ * omp-offload.c (oacc_parse_default_dims, oacc_validate_dims): Add
+ argument to call to targetm.goacc.validate_dims.
+ (default_goacc_validate_dims): Add used
+ parameter.
+ * target.def (validate_dims): Add used parameter in DEFHOOK.
+ * targhooks.h (default_goacc_validate_dims): Add used parameter.
+
2019-01-11 Jakub Jelinek <jakub@redhat.com>
PR middle-end/85956
DIMS has changed. */
static void
-nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level)
+nvptx_goacc_validate_dims_1 (tree decl, int dims[], int fn_level, unsigned used)
{
bool oacc_default_dims_p = false;
bool oacc_min_dims_p = false;
DECL is null, we are validating the default dimensions. */
static bool
-nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level)
+nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level, unsigned used)
{
int old_dims[GOMP_DIM_MAX];
unsigned int i;
for (i = 0; i < GOMP_DIM_MAX; ++i)
old_dims[i] = dims[i];
- nvptx_goacc_validate_dims_1 (decl, dims, fn_level);
+ nvptx_goacc_validate_dims_1 (decl, dims, fn_level, used);
gcc_assert (dims[GOMP_DIM_VECTOR] != 0);
if (dims[GOMP_DIM_WORKER] > 0 && dims[GOMP_DIM_VECTOR] > 0)
Return number of threads in SIMT thread group on the target.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_GOACC_VALIDATE_DIMS (tree @var{decl}, int *@var{dims}, int @var{fn_level})
+@deftypefn {Target Hook} bool TARGET_GOACC_VALIDATE_DIMS (tree @var{decl}, int *@var{dims}, int @var{fn_level}, unsigned @var{used})
This hook should check the launch dimensions provided for an OpenACC
compute region, or routine. Defaulted values are represented as -1
and non-constant values as 0. The @var{fn_level} is negative for the
}
/* Allow the backend to validate the dimensions. */
- targetm.goacc.validate_dims (NULL_TREE, oacc_default_dims, -1);
- targetm.goacc.validate_dims (NULL_TREE, oacc_min_dims, -2);
+ targetm.goacc.validate_dims (NULL_TREE, oacc_default_dims, -1, 0);
+ targetm.goacc.validate_dims (NULL_TREE, oacc_min_dims, -2, 0);
}
/* Validate and update the dimensions for offloaded FN. ATTRS is the
pos = TREE_CHAIN (pos);
}
- bool changed = targetm.goacc.validate_dims (fn, dims, level);
+ bool changed = targetm.goacc.validate_dims (fn, dims, level, used);
/* Default anything left to 1 or a partitioned default. */
for (ix = 0; ix != GOMP_DIM_MAX; ix++)
bool
default_goacc_validate_dims (tree ARG_UNUSED (decl), int *dims,
- int ARG_UNUSED (fn_level))
+ int ARG_UNUSED (fn_level),
+ unsigned ARG_UNUSED (used))
{
bool changed = false;
Diagnostics should be issued as appropriate. Return\n\
true, if changes have been made. You must override this hook to\n\
provide dimensions larger than 1.",
-bool, (tree decl, int *dims, int fn_level),
+bool, (tree decl, int *dims, int fn_level, unsigned used),
default_goacc_validate_dims)
DEFHOOK
extern void default_destroy_cost_data (void *);
/* OpenACC hooks. */
-extern bool default_goacc_validate_dims (tree, int [], int);
+extern bool default_goacc_validate_dims (tree, int [], int, unsigned);
extern int default_goacc_dim_limit (int);
extern bool default_goacc_fork_join (gcall *, const int [], bool);
extern void default_goacc_reduction (gcall *);