cuda.c: use isl_map_from_union_map instead of isl_union_map_copy_map
[ppcg.git] / ppcg.c
blob3616eb2acc304d80a57ff7bf97b8c08964dae71a
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 <clan/clan.h>
16 #include "ppcg_options.h"
17 #include "cuda.h"
19 struct options {
20 struct isl_options *isl;
21 struct ppcg_options *ppcg;
22 char *input;
25 struct isl_arg options_arg[] = {
26 ISL_ARG_CHILD(struct options, isl, "isl", isl_options_arg, "isl options")
27 ISL_ARG_CHILD(struct options, ppcg, NULL, ppcg_options_arg, NULL)
28 ISL_ARG_ARG(struct options, input, "input", NULL)
29 ISL_ARG_END
32 ISL_ARG_DEF(options, struct options, options_arg)
34 int main(int argc, char **argv)
36 isl_ctx *ctx;
37 struct options *options;
38 clan_options_p clan_options;
39 scoplib_scop_p scop;
40 FILE *input;
42 options = options_new_with_defaults();
43 assert(options);
44 argc = options_parse(options, argc, argv, ISL_ARG_ALL);
46 ctx = isl_ctx_alloc_with_options(options_arg, options);
48 clan_options = clan_options_malloc();
50 input = fopen(options->input, "r");
51 if (!input) {
52 fprintf(stderr, "unable to open input file '%s'\n",
53 options->input);
54 return -1;
56 scop = clan_scop_extract(input, clan_options);
57 clan_options_free(clan_options);
59 return cuda_scop(ctx, scop, options->ppcg, options->input);