annotate gcc/omp-general.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* General types and functions that are uselful for processing of OpenMP,
kono
parents:
diff changeset
2 OpenACC and similar directivers at various stages of compilation.
kono
parents:
diff changeset
3
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
4 Copyright (C) 2005-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #ifndef GCC_OMP_GENERAL_H
kono
parents:
diff changeset
23 #define GCC_OMP_GENERAL_H
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 #include "gomp-constants.h"
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 /* Flags for an OpenACC loop. */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 enum oacc_loop_flags {
kono
parents:
diff changeset
30 OLF_SEQ = 1u << 0, /* Explicitly sequential */
kono
parents:
diff changeset
31 OLF_AUTO = 1u << 1, /* Compiler chooses axes. */
kono
parents:
diff changeset
32 OLF_INDEPENDENT = 1u << 2, /* Iterations are known independent. */
kono
parents:
diff changeset
33 OLF_GANG_STATIC = 1u << 3, /* Gang partitioning is static (has op). */
kono
parents:
diff changeset
34 OLF_TILE = 1u << 4, /* Tiled loop. */
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 /* Explicitly specified loop axes. */
kono
parents:
diff changeset
37 OLF_DIM_BASE = 5,
kono
parents:
diff changeset
38 OLF_DIM_GANG = 1u << (OLF_DIM_BASE + GOMP_DIM_GANG),
kono
parents:
diff changeset
39 OLF_DIM_WORKER = 1u << (OLF_DIM_BASE + GOMP_DIM_WORKER),
kono
parents:
diff changeset
40 OLF_DIM_VECTOR = 1u << (OLF_DIM_BASE + GOMP_DIM_VECTOR),
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 OLF_MAX = OLF_DIM_BASE + GOMP_DIM_MAX
kono
parents:
diff changeset
43 };
kono
parents:
diff changeset
44
kono
parents:
diff changeset
45 /* A structure holding the elements of:
kono
parents:
diff changeset
46 for (V = N1; V cond N2; V += STEP) [...] */
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 struct omp_for_data_loop
kono
parents:
diff changeset
49 {
kono
parents:
diff changeset
50 tree v, n1, n2, step;
kono
parents:
diff changeset
51 enum tree_code cond_code;
kono
parents:
diff changeset
52 };
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* A structure describing the main elements of a parallel loop. */
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 struct omp_for_data
kono
parents:
diff changeset
57 {
kono
parents:
diff changeset
58 struct omp_for_data_loop loop;
kono
parents:
diff changeset
59 tree chunk_size;
kono
parents:
diff changeset
60 gomp_for *for_stmt;
kono
parents:
diff changeset
61 tree pre, iter_type;
kono
parents:
diff changeset
62 tree tiling; /* Tiling values (if non null). */
kono
parents:
diff changeset
63 int collapse; /* Collapsed loops, 1 for a non-collapsed loop. */
kono
parents:
diff changeset
64 int ordered;
kono
parents:
diff changeset
65 bool have_nowait, have_ordered, simd_schedule;
kono
parents:
diff changeset
66 unsigned char sched_modifiers;
kono
parents:
diff changeset
67 enum omp_clause_schedule_kind sched_kind;
kono
parents:
diff changeset
68 struct omp_for_data_loop *loops;
kono
parents:
diff changeset
69 };
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 #define OACC_FN_ATTRIB "oacc function"
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 extern tree omp_find_clause (tree clauses, enum omp_clause_code kind);
kono
parents:
diff changeset
74 extern bool omp_is_reference (tree decl);
kono
parents:
diff changeset
75 extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code,
kono
parents:
diff changeset
76 tree *n2);
kono
parents:
diff changeset
77 extern tree omp_get_for_step_from_incr (location_t loc, tree incr);
kono
parents:
diff changeset
78 extern void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
kono
parents:
diff changeset
79 struct omp_for_data_loop *loops);
kono
parents:
diff changeset
80 extern gimple *omp_build_barrier (tree lhs);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
81 extern poly_uint64 omp_max_vf (void);
111
kono
parents:
diff changeset
82 extern int omp_max_simt_vf (void);
kono
parents:
diff changeset
83 extern tree oacc_launch_pack (unsigned code, tree device, unsigned op);
kono
parents:
diff changeset
84 extern void oacc_replace_fn_attrib (tree fn, tree dims);
kono
parents:
diff changeset
85 extern void oacc_set_fn_attrib (tree fn, tree clauses, vec<tree> *args);
kono
parents:
diff changeset
86 extern tree oacc_build_routine_dims (tree clauses);
kono
parents:
diff changeset
87 extern tree oacc_get_fn_attrib (tree fn);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
88 extern bool offloading_function_p (tree fn);
111
kono
parents:
diff changeset
89 extern int oacc_get_fn_dim_size (tree fn, int axis);
kono
parents:
diff changeset
90 extern int oacc_get_ifn_dim_arg (const gimple *stmt);
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 #endif /* GCC_OMP_GENERAL_H */