Debian Codegraph @

rts/c/gpu_prototypes.h

raw
1 // Start of gpu_prototypes.h
2
3 // Constants used for transpositions. In principle these should be configurable.
4 #define TR_BLOCK_DIM 16
5 #define TR_TILE_DIM (TR_BLOCK_DIM*2)
6 #define TR_ELEMS_PER_THREAD 8
7
8 // Config stuff included in every GPU backend.
9 struct gpu_config {
10 size_t default_block_size;
11 size_t default_grid_size;
12 size_t default_tile_size;
13 size_t default_reg_tile_size;
14 size_t default_cache;
15 size_t default_shared_memory;
16 size_t default_registers;
17 size_t default_threshold;
18
19 int default_block_size_changed;
20 int default_grid_size_changed;
21 int default_tile_size_changed;
22 };
23
24 // The following are dummy sizes that mean the concrete defaults
25 // will be set during initialisation via hardware-inspection-based
26 // heuristics.
27 struct gpu_config gpu_config_initial = {
28 0
29 };
30
31 // Must be defined by the user.
32 static int gpu_macros(struct futhark_context *ctx, char*** names, int64_t** values);
33
34 static void gpu_init_log(struct futhark_context *ctx);
35 struct builtin_kernels* init_builtin_kernels(struct futhark_context* ctx);
36 void free_builtin_kernels(struct futhark_context* ctx, struct builtin_kernels* kernels);
37 static int gpu_free_all(struct futhark_context *ctx);
38
39 // End of gpu_prototypes.h