This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] adjust default nvptx launch geometry for OpenACC offloaded regions
- From: Tom de Vries <tdevries at suse dot de>
- To: Cesar Philippidis <cesar at codesourcery dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>, Thomas Schwinge <thomas at codesourcery dot com>
- Date: Mon, 30 Jul 2018 12:16:57 +0200
- Subject: Re: [patch] adjust default nvptx launch geometry for OpenACC offloaded regions
- References: <c36981ca-04bc-08df-0af7-c2e1a8201640@codesourcery.com> <7864b0d0-b39f-713b-9d5c-13e91c11bd55@suse.de> <0034e0fb-402e-8681-0f62-3fd274d00a99@codesourcery.com> <130dc2ce-1db1-1fdd-a4a3-63e479466beb@suse.de> <5c0b9b2d-bbe3-dfd9-1ae5-a164a4079e0c@codesourcery.com>
On 07/11/2018 09:13 PM, Cesar Philippidis wrote:
> 2018-07-XX Cesar Philippidis <cesar@codesourcery.com>
> Tom de Vries <tdevries@suse.de>
>
> gcc/
> * 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;
That's an independent patch.
Committed at below.
Thanks,
- Tom
[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-27 Cesar Philippidis <cesar@codesourcery.com>
Tom de Vries <tdevries@suse.de>
* 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.
---
gcc/config/nvptx/nvptx.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
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;