MCPcopy Create free account
hub / github.com/UCLA-VAST/AutoSA / gpu_array_tile_create

Function gpu_array_tile_create

gpu_array_tile.c:28–52  ·  view source on GitHub ↗

Create a gpu_array_tile for an array of dimension "n_index". */

Source from the content-addressed store, hash-verified

26/* Create a gpu_array_tile for an array of dimension "n_index".
27 */
28struct gpu_array_tile *gpu_array_tile_create(isl_ctx *ctx, int n_index)
29{
30 int i;
31 struct gpu_array_tile *tile;
32
33 tile = isl_calloc_type(ctx, struct gpu_array_tile);
34 if (!tile)
35 return NULL;
36
37 tile->ctx = ctx;
38 tile->bound = isl_alloc_array(ctx, struct gpu_array_bound, n_index);
39 if (!tile->bound)
40 return gpu_array_tile_free(tile);
41
42 tile->n = n_index;
43
44 for (i = 0; i < n_index; ++i) {
45 tile->bound[i].size = NULL;
46 tile->bound[i].lb = NULL;
47 tile->bound[i].stride = NULL;
48 tile->bound[i].shift = NULL;
49 }
50
51 return tile;
52}
53
54/* Compute the size of the tile specified by "tile"
55 * in number of elements and return the result.

Callers 1

Calls 1

gpu_array_tile_freeFunction · 0.85

Tested by

no test coverage detected