| 1 | /* |
|---|---|
| 2 | * Copyright 2016 Sven Verdoolaege |
| 3 | * |
| 4 | * Use of this software is governed by the MIT license |
| 5 | * |
| 6 | * Written by Sven Verdoolaege. |
| 7 | */ |
| 8 | |
| 9 | /* This program takes an isl_schedule_constraints object as input and |
| 10 | * prints a schedule that satisfies those constraints. |
| 11 | */ |
| 12 | |
| 13 | #include <stdlib.h> |
| 14 | #include <isl/options.h> |
| 15 | #include <isl/schedule.h> |
| 16 | #include <isl/printer.h> |
| 17 | |
| 18 | int main(int argc, char **argv) |
| 19 | { |
| 20 | isl_ctx *ctx; |
| 21 | isl_printer *p; |
| 22 | isl_schedule_constraints *sc; |
| 23 | isl_schedule *schedule; |
| 24 | struct isl_options *options; |
| 25 | |
| 26 | options = isl_options_new_with_defaults(); |
| 27 | argc = isl_options_parse(opt: options, argc, argv, ISL_ARG_ALL); |
| 28 | ctx = isl_ctx_alloc_with_options(args: &isl_options_args, opt: options); |
| 29 | |
| 30 | sc = isl_schedule_constraints_read_from_file(ctx, stdin); |
| 31 | schedule = isl_schedule_constraints_compute_schedule(sc); |
| 32 | |
| 33 | p = isl_printer_to_file(ctx, stdout); |
| 34 | p = isl_printer_set_yaml_style(p, ISL_YAML_STYLE_BLOCK); |
| 35 | p = isl_printer_print_schedule(p, schedule); |
| 36 | isl_printer_free(printer: p); |
| 37 | |
| 38 | isl_schedule_free(sched: schedule); |
| 39 | |
| 40 | isl_ctx_free(ctx); |
| 41 | |
| 42 | return p ? EXIT_SUCCESS : EXIT_FAILURE; |
| 43 | } |
| 44 |
