gpu.c: at_each_domain: look up gpu_stmt first
[ppcg.git] / ppcg_options.c
blob1513f8afa593bf789aed3ccc4a30258dbf36ad97
1 /*
2 * Copyright 2010-2011 INRIA Saclay
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8 * 91893 Orsay, France
9 */
11 #include "ppcg_options.h"
13 static struct isl_arg_choice target[] = {
14 {"c", PPCG_TARGET_C},
15 {"cuda", PPCG_TARGET_CUDA},
16 {"opencl", PPCG_TARGET_OPENCL},
17 {0}
20 ISL_ARGS_START(struct ppcg_debug_options, ppcg_debug_options_args)
21 ISL_ARG_BOOL(struct ppcg_debug_options, dump_schedule_constraints, 0,
22 "dump-schedule-constraints", 0, "dump schedule constraints")
23 ISL_ARG_BOOL(struct ppcg_debug_options, dump_schedule, 0,
24 "dump-schedule", 0, "dump isl computed schedule")
25 ISL_ARG_BOOL(struct ppcg_debug_options, dump_sizes, 0,
26 "dump-sizes", 0,
27 "dump effectively used per kernel tile, grid and block sizes")
28 ISL_ARG_BOOL(struct ppcg_debug_options, verbose, 'v', "verbose", 0, NULL)
29 ISL_ARGS_END
31 ISL_ARGS_START(struct ppcg_options, ppcg_opencl_options_args)
32 ISL_ARG_STR(struct ppcg_options, opencl_compiler_options, 0, "compiler-options",
33 "options", NULL, "options to pass to the OpenCL compiler")
34 ISL_ARG_BOOL(struct ppcg_options, opencl_use_gpu, 0, "use-gpu", 1,
35 "use GPU device (if available)")
36 ISL_ARG_STR_LIST(struct ppcg_options, opencl_n_include_file,
37 opencl_include_files, 0, "include-file", "filename",
38 "file to #include in generated OpenCL code")
39 ISL_ARG_BOOL(struct ppcg_options, opencl_print_kernel_types, 0,
40 "print-kernel-types", 1,
41 "print definitions of types in the kernel file")
42 ISL_ARG_BOOL(struct ppcg_options, opencl_embed_kernel_code, 0,
43 "embed-kernel-code", 0, "embed kernel code into host code")
44 ISL_ARGS_END
46 ISL_ARGS_START(struct ppcg_options, ppcg_options_args)
47 ISL_ARG_CHILD(struct ppcg_options, debug, NULL, &ppcg_debug_options_args,
48 "debugging options")
49 ISL_ARG_BOOL(struct ppcg_options, scale_tile_loops, 0,
50 "scale-tile-loops", 1, NULL)
51 ISL_ARG_BOOL(struct ppcg_options, wrap, 0, "wrap", 1, NULL)
52 ISL_ARG_BOOL(struct ppcg_options, use_shared_memory, 0, "shared-memory", 1,
53 "use shared memory in kernel code")
54 ISL_ARG_BOOL(struct ppcg_options, use_private_memory, 0, "private-memory", 1,
55 "use private memory in kernel code")
56 ISL_ARG_STR(struct ppcg_options, ctx, 0, "ctx", "context", NULL,
57 "Constraints on parameters")
58 ISL_ARG_INT(struct ppcg_options, tile_size, 'S', "tile-size", "size", 32, NULL)
59 ISL_ARG_STR(struct ppcg_options, sizes, 0, "sizes", "sizes", NULL,
60 "Per kernel tile, grid and block sizes")
61 ISL_ARG_INT(struct ppcg_options, max_shared_memory, 0,
62 "max-shared-memory", "size", 8192, "maximal amount of shared memory")
63 ISL_ARG_BOOL(struct ppcg_options, openmp, 0, "openmp", 0,
64 "Generate OpenMP macros (only for C target)")
65 ISL_ARG_CHOICE(struct ppcg_options, target, 0, "target", target,
66 PPCG_TARGET_CUDA, "the target to generate code for")
67 ISL_ARG_BOOL(struct ppcg_options, linearize_device_arrays, 0,
68 "linearize-device-arrays", 1,
69 "linearize all device arrays, even those of fixed size")
70 ISL_ARG_BOOL(struct ppcg_options, live_range_reordering, 0,
71 "live-range-reordering", 1,
72 "allow successive live ranges on the same memory element "
73 "to be reordered")
74 ISL_ARG_GROUP("opencl", &ppcg_opencl_options_args, "OpenCL options")
75 ISL_ARGS_END