gpu.c: mark_outer_tilable: split tilable band to match tile length
[ppcg.git] / gpu_array_tile.h
bloba68afc139102aecd3e25e8dcdd37693fb707f81e
1 #ifndef GPU_ARRAY_TILE_H
2 #define GPU_ARRAY_TILE_H
4 #include <isl/aff_type.h>
5 #include <isl/map_type.h>
6 #include <isl/val.h>
8 /* The fields stride and shift only contain valid information
9 * if shift != NULL.
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 shared_len dimensions of the computed schedule.
13 * The spaces of "lb" and "shift" are of the form
15 * D -> [b]
17 struct gpu_array_bound {
18 isl_val *size;
19 isl_aff *lb;
21 isl_val *stride;
22 isl_aff *shift;
25 /* A tile of an array.
27 * n is the dimension of the array.
28 * bound is an array of size "n" representing the lower bound
29 * and size for each index.
31 * tiling maps a tile in the global array to the corresponding
32 * shared/private memory tile and is of the form
34 * { [D[i] -> A[a]] -> T[(a + shift(i))/stride - lb(i)] }
36 * where D represents the initial shared_len dimensions
37 * of the computed schedule.
39 struct gpu_array_tile {
40 isl_ctx *ctx;
41 int n;
42 struct gpu_array_bound *bound;
43 isl_multi_aff *tiling;
46 struct gpu_array_tile *gpu_array_tile_create(isl_ctx *ctx, int n_index);
47 struct gpu_array_tile *gpu_array_tile_free(struct gpu_array_tile *tile);
49 __isl_give isl_val *gpu_array_tile_size(struct gpu_array_tile *tile);
51 #endif