Commit 21fbea5c by Tom de Vries Committed by Tom de Vries

[nvptx] Add asserts in nvptx_goacc_validate_dims

Add a few asserts to nvptx_goacc_validate_dims.

2019-01-07  Tom de Vries  <tdevries@suse.de>

	* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add asserts.

From-SVN: r267625
parent 43493c97
2019-01-07 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add asserts.
2019-01-07 Tom de Vries <tdevries@suse.de>
* omp-offload.c (oacc_get_min_dim): New function.
* omp-offload.h (oacc_get_min_dim): Declare.
......
......@@ -5421,6 +5421,10 @@ nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level)
nvptx_goacc_validate_dims_1 (decl, dims, fn_level);
gcc_assert (dims[GOMP_DIM_VECTOR] != 0);
if (dims[GOMP_DIM_WORKER] > 0 && dims[GOMP_DIM_VECTOR] > 0)
gcc_assert (dims[GOMP_DIM_WORKER] * dims[GOMP_DIM_VECTOR] <= PTX_CTA_SIZE);
for (i = 0; i < GOMP_DIM_MAX; ++i)
if (old_dims[i] != dims[i])
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment