annotate gcc/omp-general.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
4 Copyright (C) 2005-2020 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;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
65 bool have_nowait, have_ordered, simd_schedule, have_reductemp;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
66 bool have_pointer_condtemp, have_scantemp, have_nonctrl_scantemp;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
67 int lastprivate_conditional;
111
kono
parents:
diff changeset
68 unsigned char sched_modifiers;
kono
parents:
diff changeset
69 enum omp_clause_schedule_kind sched_kind;
kono
parents:
diff changeset
70 struct omp_for_data_loop *loops;
kono
parents:
diff changeset
71 };
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 #define OACC_FN_ATTRIB "oacc function"
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 extern tree omp_find_clause (tree clauses, enum omp_clause_code kind);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 extern bool omp_is_allocatable_or_ptr (tree decl);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
77 extern tree omp_check_optional_argument (tree decl, bool for_present_check);
111
kono
parents:
diff changeset
78 extern bool omp_is_reference (tree decl);
kono
parents:
diff changeset
79 extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
80 tree *n2, tree v, tree step);
111
kono
parents:
diff changeset
81 extern tree omp_get_for_step_from_incr (location_t loc, tree incr);
kono
parents:
diff changeset
82 extern void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
kono
parents:
diff changeset
83 struct omp_for_data_loop *loops);
kono
parents:
diff changeset
84 extern gimple *omp_build_barrier (tree lhs);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
85 extern poly_uint64 omp_max_vf (void);
111
kono
parents:
diff changeset
86 extern int omp_max_simt_vf (void);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
87 extern int omp_constructor_traits_to_codes (tree, enum tree_code *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
88 extern int omp_context_selector_matches (tree);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
89 extern int omp_context_selector_set_compare (const char *, tree, tree);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
90 extern tree omp_get_context_selector (tree, const char *, const char *);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 extern tree omp_resolve_declare_variant (tree);
111
kono
parents:
diff changeset
92 extern tree oacc_launch_pack (unsigned code, tree device, unsigned op);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
93 extern tree oacc_replace_fn_attrib_attr (tree attribs, tree dims);
111
kono
parents:
diff changeset
94 extern void oacc_replace_fn_attrib (tree fn, tree dims);
kono
parents:
diff changeset
95 extern void oacc_set_fn_attrib (tree fn, tree clauses, vec<tree> *args);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
96 extern int oacc_verify_routine_clauses (tree, tree *, location_t,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
97 const char *);
111
kono
parents:
diff changeset
98 extern tree oacc_build_routine_dims (tree clauses);
kono
parents:
diff changeset
99 extern tree oacc_get_fn_attrib (tree fn);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
100 extern bool offloading_function_p (tree fn);
111
kono
parents:
diff changeset
101 extern int oacc_get_fn_dim_size (tree fn, int axis);
kono
parents:
diff changeset
102 extern int oacc_get_ifn_dim_arg (const gimple *stmt);
kono
parents:
diff changeset
103
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
104 enum omp_requires {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
105 OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER = 0xf,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
106 OMP_REQUIRES_UNIFIED_ADDRESS = 0x10,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
107 OMP_REQUIRES_UNIFIED_SHARED_MEMORY = 0x20,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
108 OMP_REQUIRES_DYNAMIC_ALLOCATORS = 0x40,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
109 OMP_REQUIRES_REVERSE_OFFLOAD = 0x80,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
110 OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER_USED = 0x100,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
111 OMP_REQUIRES_TARGET_USED = 0x200
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
112 };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
113
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
114 extern GTY(()) enum omp_requires omp_requires_mask;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
115
111
kono
parents:
diff changeset
116 #endif /* GCC_OMP_GENERAL_H */