summaryrefslogtreecommitdiff
path: root/gcc/config/nvptx/nvptx.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/nvptx/nvptx.c')
-rw-r--r--gcc/config/nvptx/nvptx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index dafb6954690..0204ad3383e 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -3499,6 +3499,25 @@ nvptx_goacc_validate_dims (tree ARG_UNUSED (decl), int *ARG_UNUSED (dims),
return changed;
}
+/* Return maximum dimension size, or zero for unbounded. */
+
+static int
+nvptx_dim_limit (int axis)
+{
+ switch (axis)
+ {
+ case GOMP_DIM_WORKER:
+ return PTX_WORKER_LENGTH;
+
+ case GOMP_DIM_VECTOR:
+ return PTX_VECTOR_LENGTH;
+
+ default:
+ break;
+ }
+ return 0;
+}
+
/* Determine whether fork & joins are needed. */
static bool
@@ -4016,6 +4035,9 @@ nvptx_goacc_reduction (gcall *call)
#undef TARGET_GOACC_VALIDATE_DIMS
#define TARGET_GOACC_VALIDATE_DIMS nvptx_goacc_validate_dims
+#undef TARGET_GOACC_DIM_LIMIT
+#define TARGET_GOACC_DIM_LIMIT nvptx_dim_limit
+
#undef TARGET_GOACC_FORK_JOIN
#define TARGET_GOACC_FORK_JOIN nvptx_goacc_fork_join