+2019-01-07 Tom de Vries <tdevries@suse.de>
+
+ * config/nvptx/nvptx.c (PTX_VECTOR_LENGTH): Remove.
+ (PTX_DEFAULT_VECTOR_LENGTH, PTX_MAX_VECTOR_LENGTH): Define.
+ (nvptx_goacc_validate_dims_1, nvptx_dim_limit)
+ (nvptx_goacc_reduction_fini): Use PTX_DEFAULT_VECTOR_LENGTH,
+ PTX_MAX_VECTOR_LENGTH and PTX_WARP_SIZE instead of PTX_VECTOR_LENGTH.
+
2019-01-07 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.c (nvptx_goacc_validate_dims): Add asserts.
#define WORKAROUND_PTXJIT_BUG_3 1
#define PTX_WARP_SIZE 32
-#define PTX_VECTOR_LENGTH 32
+#define PTX_DEFAULT_VECTOR_LENGTH PTX_WARP_SIZE
+#define PTX_MAX_VECTOR_LENGTH PTX_WARP_SIZE
#define PTX_WORKER_LENGTH 32
#define PTX_DEFAULT_RUNTIME_DIM 0 /* Defer to runtime. */
}
if (dims[GOMP_DIM_VECTOR] >= 0
- && dims[GOMP_DIM_VECTOR] != PTX_VECTOR_LENGTH)
+ && dims[GOMP_DIM_VECTOR] != PTX_WARP_SIZE)
{
warning_at (decl ? DECL_SOURCE_LOCATION (decl) : UNKNOWN_LOCATION, 0,
dims[GOMP_DIM_VECTOR]
? G_("using vector_length (%d), ignoring %d")
: G_("using vector_length (%d), ignoring runtime setting"),
- PTX_VECTOR_LENGTH, dims[GOMP_DIM_VECTOR]);
- dims[GOMP_DIM_VECTOR] = PTX_VECTOR_LENGTH;
+ PTX_DEFAULT_VECTOR_LENGTH, dims[GOMP_DIM_VECTOR]);
+ dims[GOMP_DIM_VECTOR] = PTX_DEFAULT_VECTOR_LENGTH;
}
/* Check the num workers is not too large. */
if (oacc_default_dims_p)
{
- dims[GOMP_DIM_VECTOR] = PTX_VECTOR_LENGTH;
+ dims[GOMP_DIM_VECTOR] = PTX_DEFAULT_VECTOR_LENGTH;
if (dims[GOMP_DIM_WORKER] < 0)
dims[GOMP_DIM_WORKER] = PTX_DEFAULT_RUNTIME_DIM;
if (dims[GOMP_DIM_GANG] < 0)
switch (axis)
{
case GOMP_DIM_VECTOR:
- return PTX_VECTOR_LENGTH;
+ return PTX_MAX_VECTOR_LENGTH;
default:
break;
/* Emit binary shuffle tree. TODO. Emit this as an actual loop,
but that requires a method of emitting a unified jump at the
gimple level. */
- for (int shfl = PTX_VECTOR_LENGTH / 2; shfl > 0; shfl = shfl >> 1)
+ for (int shfl = PTX_WARP_SIZE / 2; shfl > 0; shfl = shfl >> 1)
{
tree other_var = make_ssa_name (TREE_TYPE (var));
nvptx_generate_vector_shuffle (gimple_location (call),