ppcg_options.h 2.4 KB

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