1 #ifndef GPU_ARRAY_TILE_H
2 #define GPU_ARRAY_TILE_H
4 #include <isl/aff_type.h>
5 #include <isl/map_type.h>
8 /* The fields stride and shift only contain valid information
10 * If so, they express that current index is such that if you add shift,
11 * then the result is always a multiple of stride.
12 * Let D represent the initial group->depth dimensions of the computed schedule.
13 * The spaces of "lb" and "shift" are of the form
17 struct gpu_array_bound
{
25 /* A tile of an array.
27 * requires_unroll is set if the schedule dimensions that are mapped
28 * to threads need to be unrolled for this (private) tile to be used.
30 * n is the dimension of the array.
31 * bound is an array of size "n" representing the lower bound
32 * and size for each index.
34 * tiling maps a tile in the global array to the corresponding
35 * shared/private memory tile and is of the form
37 * { [D[i] -> A[a]] -> T[(a + shift(i))/stride - lb(i)] }
39 * where D represents the initial group->depth dimensions
40 * of the computed schedule.
42 struct gpu_array_tile
{
46 struct gpu_array_bound
*bound
;
47 isl_multi_aff
*tiling
;
50 struct gpu_array_tile
*gpu_array_tile_create(isl_ctx
*ctx
, int n_index
);
51 struct gpu_array_tile
*gpu_array_tile_free(struct gpu_array_tile
*tile
);
53 __isl_give isl_val
*gpu_array_tile_size(struct gpu_array_tile
*tile
);