update pet for introduction of pet_options
[ppcg.git] / ppcg.c
blobe0cdc85745b6645f568caf24b0289b5829a0b18a
1 /*
2 * Copyright 2011 INRIA Saclay
4 * Use of this software is governed by the GNU LGPLv2.1 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 <assert.h>
12 #include <stdio.h>
13 #include <isl/ctx.h>
14 #include <isl/options.h>
15 #include <isl/schedule.h>
16 #include <pet.h>
17 #include "ppcg_options.h"
18 #include "cuda.h"
20 struct options {
21 struct isl_options *isl;
22 struct pet_options *pet;
23 struct ppcg_options *ppcg;
24 char *input;
27 ISL_ARGS_START(struct options, options_args)
28 ISL_ARG_CHILD(struct options, isl, "isl", &isl_options_args, "isl options")
29 ISL_ARG_CHILD(struct options, pet, "pet", &pet_options_args, "pet options")
30 ISL_ARG_CHILD(struct options, ppcg, NULL, &ppcg_options_args, NULL)
31 ISL_ARG_ARG(struct options, input, "input", NULL)
32 ISL_ARGS_END
34 ISL_ARG_DEF(options, struct options, options_args)
36 int main(int argc, char **argv)
38 int r;
39 isl_ctx *ctx;
40 struct options *options;
41 FILE *input;
42 struct pet_scop *scop;
44 options = options_new_with_defaults();
45 assert(options);
47 ctx = isl_ctx_alloc_with_options(&options_args, options);
48 isl_options_set_schedule_outer_zero_distance(ctx, 1);
49 argc = options_parse(options, argc, argv, ISL_ARG_ALL);
51 scop = pet_scop_extract_from_C_source(ctx, options->input, NULL);
52 r = cuda_pet(ctx, scop, options->ppcg, options->input);
53 pet_scop_free(scop);
55 isl_ctx_free(ctx);
57 return r;