From 605219e7c74bc8039a994847729fb948230d66d3 Mon Sep 17 00:00:00 2001 From: Cesar Philippidis Date: Mon, 30 Jul 2018 01:16:52 -0700 Subject: [PATCH] [nvptx, offloading] Determine default workers at runtime Currently, if the user doesn't specify the number of workers for an openacc region, the compiler hardcodes it to a default value. This patch removes this functionality, such that the libgomp runtime can decide on a default value. 2018-07-30 Cesar Philippidis Tom de Vries * config/nvptx/nvptx.c (PTX_GANG_DEFAULT): Rename to ... (PTX_DEFAULT_RUNTIME_DIM): ... this. (nvptx_goacc_validate_dims): Set default worker and gang dims to PTX_DEFAULT_RUNTIME_DIM. (nvptx_dim_limit): Ignore GOMP_DIM_WORKER. Co-Authored-By: Tom de Vries From-SVN: r263060 --- gcc/ChangeLog | 9 +++++++++ gcc/config/nvptx/nvptx.c | 9 +++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d70b4678e3..5da43787528 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-07-30 Cesar Philippidis + Tom de Vries + + * config/nvptx/nvptx.c (PTX_GANG_DEFAULT): Rename to ... + (PTX_DEFAULT_RUNTIME_DIM): ... this. + (nvptx_goacc_validate_dims): Set default worker and gang dims to + PTX_DEFAULT_RUNTIME_DIM. + (nvptx_dim_limit): Ignore GOMP_DIM_WORKER. + 2018-07-29 John David Anglin * config/pa/pa.c (pa_output_addr_vec): Align address table. diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 5608bee8a8d..c1946e75f42 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -5165,7 +5165,7 @@ nvptx_expand_builtin (tree exp, rtx target, rtx ARG_UNUSED (subtarget), /* Define dimension sizes for known hardware. */ #define PTX_VECTOR_LENGTH 32 #define PTX_WORKER_LENGTH 32 -#define PTX_GANG_DEFAULT 0 /* Defer to runtime. */ +#define PTX_DEFAULT_RUNTIME_DIM 0 /* Defer to runtime. */ /* Implement TARGET_SIMT_VF target hook: number of threads in a warp. */ @@ -5214,9 +5214,9 @@ nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level) { dims[GOMP_DIM_VECTOR] = PTX_VECTOR_LENGTH; if (dims[GOMP_DIM_WORKER] < 0) - dims[GOMP_DIM_WORKER] = PTX_WORKER_LENGTH; + dims[GOMP_DIM_WORKER] = PTX_DEFAULT_RUNTIME_DIM; if (dims[GOMP_DIM_GANG] < 0) - dims[GOMP_DIM_GANG] = PTX_GANG_DEFAULT; + dims[GOMP_DIM_GANG] = PTX_DEFAULT_RUNTIME_DIM; changed = true; } @@ -5230,9 +5230,6 @@ nvptx_dim_limit (int axis) { switch (axis) { - case GOMP_DIM_WORKER: - return PTX_WORKER_LENGTH; - case GOMP_DIM_VECTOR: return PTX_VECTOR_LENGTH; -- 2.30.2