Yet Another eXchange Tool 0.11.1
Loading...
Searching...
No Matches
Features of index sections

Negative global and local sizes

Using negative sizes inverts the order of indices in the respective dimension. The following example illustrate this. The code for the examples can be found in idxsection_examples.c.

Custom strides

With some limitations you can define index sections with custom strides. This is achieved by introducing additional dimensions (see following examples).

Custom stride in x

Xt_int start = 0;
enum { num_dimensions = 3 };
static const Xt_int global_size[3] = {5,5,2};
static const int local_size [3] = {3,4,1};
static const Xt_int local_start[3] = {2,0,1};
// create index section
Xt_idxlist idxsection
= xt_idxsection_new(start, num_dimensions, global_size,
local_size, local_start);
XT_INT Xt_int
Definition xt_core.h:72
Xt_idxlist xt_idxsection_new(Xt_int start, int num_dimensions, const Xt_int global_size[num_dimensions], const int local_size[num_dimensions], const Xt_int local_start[num_dimensions])

Custom stride in x and y

Xt_int start = 0;
enum { num_dimensions = 4 };
static const Xt_int global_size[4] = {3,2,5,2};
static const int local_size [4] = {3,1,4,1};
static const Xt_int local_start[4] = {0,1,1,0};
// create index section
Xt_idxlist idxsection
= xt_idxsection_new(start, num_dimensions, global_size,
local_size, local_start);