1 #ifndef PPCG_OPTIONS_H
2 #define PPCG_OPTIONS_H
3 
4 #include <isl/arg.h>
5 #include <isl/options.h>
6 
7 struct ppcg_debug_options {
8 	int dump_schedule_constraints;
9 	int dump_schedule;
10 	int dump_final_schedule;
11 	int dump_sizes;
12 	int verbose;
13 };
14 
15 struct ppcg_options {
16 	struct isl_options *isl;
17 	struct ppcg_debug_options *debug;
18 
19 	/* Group chains of consecutive statements before scheduling. */
20 	int group_chains;
21 
22 	/* Use isl to compute a schedule replacing the original schedule. */
23 	int reschedule;
24 	int scale_tile_loops;
25 	int wrap;
26 
27 	/* Assume all parameters are non-negative. */
28 	int non_negative_parameters;
29 	char *ctx;
30 	char *sizes;
31 
32 	/* Perform tiling (C target). */
33 	int tile;
34 	int tile_size;
35 
36 	/* Isolate full tiles from partial tiles. */
37 	int isolate_full_tiles;
38 
39 	/* Take advantage of private memory. */
40 	int use_private_memory;
41 
42 	/* Take advantage of shared memory. */
43 	int use_shared_memory;
44 
45 	/* Maximal amount of shared memory. */
46 	int max_shared_memory;
47 
48 	/* The target we generate code for. */
49 	int target;
50 
51 	/* Generate OpenMP macros (C target only). */
52 	int openmp;
53 
54 	/* Linearize all device arrays. */
55 	int linearize_device_arrays;
56 
57 	/* Allow the use of GNU extensions in generated code. */
58 	int allow_gnu_extensions;
59 
60 	/* Allow live range to be reordered. */
61 	int live_range_reordering;
62 
63 	/* Allow hybrid tiling whenever a suitable input pattern is found. */
64 	int hybrid;
65 
66 	/* Unroll the code for copying to/from shared memory. */
67 	int unroll_copy_shared;
68 	/* Unroll code inside tile on GPU targets. */
69 	int unroll_gpu_tile;
70 
71 	/* Options to pass to the OpenCL compiler.  */
72 	char *opencl_compiler_options;
73 	/* Prefer GPU device over CPU. */
74 	int opencl_use_gpu;
75 	/* Number of files to include. */
76 	int opencl_n_include_file;
77 	/* Files to include. */
78 	const char **opencl_include_files;
79 	/* Print definitions of types in kernels. */
80 	int opencl_print_kernel_types;
81 	/* Embed OpenCL kernel code in host code. */
82 	int opencl_embed_kernel_code;
83 
84 	/* Name of file for saving isl computed schedule or NULL. */
85 	char *save_schedule_file;
86 	/* Name of file for loading schedule or NULL. */
87 	char *load_schedule_file;
88 };
89 
90 ISL_ARG_DECL(ppcg_debug_options, struct ppcg_debug_options,
91 	ppcg_debug_options_args)
92 ISL_ARG_DECL(ppcg_options, struct ppcg_options, ppcg_options_args)
93 
94 #define		PPCG_TARGET_C		0
95 #define		PPCG_TARGET_CUDA	1
96 #define		PPCG_TARGET_OPENCL      2
97 
98 void ppcg_options_set_target_defaults(struct ppcg_options *options);
99 
100 #endif
101