initial version of ppcg
[ppcg.git] / schedule.h
blob169e2faf95ba837a4ec2a488510a36d0b766423f
1 #ifndef _SCHEDULE_H
2 #define _SCHEDULE_H
4 /* An access to an array element or an iterator.
5 * Accesses to iterators have an access relation that maps to an unnamed space.
6 * An access may be both read and write.
7 */
8 struct cuda_stmt_access {
9 /* Offset in stmt->text */
10 int text_offset;
11 int text_len;
13 /* Access reads elements */
14 int read;
15 /* Access writes elements */
16 int write;
18 /* Index of the array reference group this reference belong to. */
19 int group;
21 /* Access relation */
22 isl_map *access;
24 struct cuda_stmt_access *next;
27 struct cuda_stmt {
28 isl_set *domain;
29 char *text;
31 /* Number of tile dimensions. */
32 int tile_len;
33 /* Number of initial parallel loops among tile dimensions. */
34 int n_parallel;
36 /* Linked list of accesses. */
37 struct cuda_stmt_access *accesses;
40 __isl_give isl_map *wavefront(__isl_take isl_dim *dim, int len,
41 int first, int wave_len);
42 __isl_give isl_map *project_out(__isl_take isl_dim *dim,
43 int len, int first, int n);
44 __isl_give isl_map *projection(__isl_take isl_dim *dim,
45 int src_len, int dst_len);
46 __isl_give isl_set *extend(__isl_take isl_set *set, int dst_len);
48 void stmt_extract_accesses(struct cuda_stmt *stmt);
50 #endif