示例#1
0
/* Create a space for a parameter domain.
 */
__isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam)
{
	isl_space *space;
	space = isl_space_alloc(ctx, nparam, 0, 0);
	space = mark_as_params(space);
	return space;
}
static
isl_space* build_isl_space(scoplib_scop_p scop, scoplib_statement_p s,
			                  int array_id, isl_ctx* ctxt)
{
  isl_space* space;
  int i;
  int dout = compute_array_dimensionality (scop, array_id);

  space = isl_space_alloc(ctxt, scop->nb_parameters, s->nb_iterators, dout);
  const char* name;
  // Set the names.
  for (i = 0; i < s->nb_iterators; ++i)
    {
      name = strdup (((SgVariableSymbol*)(s->iterators[i]))->get_name().str());
      space = isl_space_set_dim_name (space, isl_dim_in, i, name);
    }
  for (i = 0; i < scop->nb_parameters; ++i)
    {
      name = strdup (((SgVariableSymbol*)(scop->parameters[i]))->get_name().str());
      space = isl_space_set_dim_name (space, isl_dim_param, i, name);
    }
  char buffer[32];
  for (i = 0; i < dout; ++i)
    {
      sprintf (buffer, "o%d", i);
      name = strdup (buffer);
      space = isl_space_set_dim_name (space, isl_dim_out, i, name);
    }

  return space;
}
示例#3
0
__isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
			unsigned nparam, unsigned dim)
{
	isl_space *space;
	space = isl_space_alloc(ctx, nparam, 0, dim);
	space = mark_as_set(space);
	return space;
}