]>
Commit | Line | Data |
---|---|---|
629b3d75 MJ |
1 | /* General types and functions that are uselful for processing of OpenMP, |
2 | OpenACC and similar directivers at various stages of compilation. | |
3 | ||
8d9254fc | 4 | Copyright (C) 2005-2020 Free Software Foundation, Inc. |
629b3d75 MJ |
5 | |
6 | This file is part of GCC. | |
7 | ||
8 | GCC is free software; you can redistribute it and/or modify it under | |
9 | the terms of the GNU General Public License as published by the Free | |
10 | Software Foundation; either version 3, or (at your option) any later | |
11 | version. | |
12 | ||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 | for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GCC; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. */ | |
21 | ||
22 | #ifndef GCC_OMP_GENERAL_H | |
23 | #define GCC_OMP_GENERAL_H | |
24 | ||
25 | #include "gomp-constants.h" | |
26 | ||
27 | /* Flags for an OpenACC loop. */ | |
28 | ||
29 | enum oacc_loop_flags { | |
30 | OLF_SEQ = 1u << 0, /* Explicitly sequential */ | |
31 | OLF_AUTO = 1u << 1, /* Compiler chooses axes. */ | |
32 | OLF_INDEPENDENT = 1u << 2, /* Iterations are known independent. */ | |
33 | OLF_GANG_STATIC = 1u << 3, /* Gang partitioning is static (has op). */ | |
02889d23 CLT |
34 | OLF_TILE = 1u << 4, /* Tiled loop. */ |
35 | ||
629b3d75 | 36 | /* Explicitly specified loop axes. */ |
02889d23 | 37 | OLF_DIM_BASE = 5, |
629b3d75 MJ |
38 | OLF_DIM_GANG = 1u << (OLF_DIM_BASE + GOMP_DIM_GANG), |
39 | OLF_DIM_WORKER = 1u << (OLF_DIM_BASE + GOMP_DIM_WORKER), | |
40 | OLF_DIM_VECTOR = 1u << (OLF_DIM_BASE + GOMP_DIM_VECTOR), | |
41 | ||
42 | OLF_MAX = OLF_DIM_BASE + GOMP_DIM_MAX | |
43 | }; | |
44 | ||
45 | /* A structure holding the elements of: | |
46 | for (V = N1; V cond N2; V += STEP) [...] */ | |
47 | ||
48 | struct omp_for_data_loop | |
49 | { | |
50 | tree v, n1, n2, step; | |
51 | enum tree_code cond_code; | |
52 | }; | |
53 | ||
54 | /* A structure describing the main elements of a parallel loop. */ | |
55 | ||
56 | struct omp_for_data | |
57 | { | |
58 | struct omp_for_data_loop loop; | |
59 | tree chunk_size; | |
60 | gomp_for *for_stmt; | |
61 | tree pre, iter_type; | |
02889d23 CLT |
62 | tree tiling; /* Tiling values (if non null). */ |
63 | int collapse; /* Collapsed loops, 1 for a non-collapsed loop. */ | |
629b3d75 | 64 | int ordered; |
28567c40 | 65 | bool have_nowait, have_ordered, simd_schedule, have_reductemp; |
2f6bb511 | 66 | bool have_pointer_condtemp, have_scantemp, have_nonctrl_scantemp; |
6c7ae8c5 | 67 | int lastprivate_conditional; |
629b3d75 MJ |
68 | unsigned char sched_modifiers; |
69 | enum omp_clause_schedule_kind sched_kind; | |
70 | struct omp_for_data_loop *loops; | |
71 | }; | |
72 | ||
73 | #define OACC_FN_ATTRIB "oacc function" | |
74 | ||
75 | extern tree omp_find_clause (tree clauses, enum omp_clause_code kind); | |
08c14aaa | 76 | extern bool omp_is_allocatable_or_ptr (tree decl); |
a2c26c50 | 77 | extern tree omp_check_optional_argument (tree decl, bool for_present_check); |
629b3d75 MJ |
78 | extern bool omp_is_reference (tree decl); |
79 | extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code, | |
031c5c8b | 80 | tree *n2, tree v, tree step); |
629b3d75 MJ |
81 | extern tree omp_get_for_step_from_incr (location_t loc, tree incr); |
82 | extern void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, | |
83 | struct omp_for_data_loop *loops); | |
84 | extern gimple *omp_build_barrier (tree lhs); | |
f1f862ae | 85 | extern tree find_combined_omp_for (tree *, int *, void *); |
9d2f08ab | 86 | extern poly_uint64 omp_max_vf (void); |
629b3d75 | 87 | extern int omp_max_simt_vf (void); |
135df52c JJ |
88 | extern int omp_constructor_traits_to_codes (tree, enum tree_code *); |
89 | extern int omp_context_selector_matches (tree); | |
917dd789 | 90 | extern int omp_context_selector_set_compare (const char *, tree, tree); |
d0c464d2 | 91 | extern tree omp_get_context_selector (tree, const char *, const char *); |
135df52c | 92 | extern tree omp_resolve_declare_variant (tree); |
629b3d75 | 93 | extern tree oacc_launch_pack (unsigned code, tree device, unsigned op); |
68034b1b | 94 | extern tree oacc_replace_fn_attrib_attr (tree attribs, tree dims); |
629b3d75 | 95 | extern void oacc_replace_fn_attrib (tree fn, tree dims); |
25651634 | 96 | extern void oacc_set_fn_attrib (tree fn, tree clauses, vec<tree> *args); |
b48f44bf TS |
97 | extern int oacc_verify_routine_clauses (tree, tree *, location_t, |
98 | const char *); | |
629b3d75 MJ |
99 | extern tree oacc_build_routine_dims (tree clauses); |
100 | extern tree oacc_get_fn_attrib (tree fn); | |
46dbeb40 | 101 | extern bool offloading_function_p (tree fn); |
629b3d75 MJ |
102 | extern int oacc_get_fn_dim_size (tree fn, int axis); |
103 | extern int oacc_get_ifn_dim_arg (const gimple *stmt); | |
104 | ||
28567c40 JJ |
105 | enum omp_requires { |
106 | OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER = 0xf, | |
107 | OMP_REQUIRES_UNIFIED_ADDRESS = 0x10, | |
108 | OMP_REQUIRES_UNIFIED_SHARED_MEMORY = 0x20, | |
109 | OMP_REQUIRES_DYNAMIC_ALLOCATORS = 0x40, | |
110 | OMP_REQUIRES_REVERSE_OFFLOAD = 0x80, | |
111 | OMP_REQUIRES_ATOMIC_DEFAULT_MEM_ORDER_USED = 0x100, | |
112 | OMP_REQUIRES_TARGET_USED = 0x200 | |
113 | }; | |
114 | ||
115 | extern GTY(()) enum omp_requires omp_requires_mask; | |
116 | ||
629b3d75 | 117 | #endif /* GCC_OMP_GENERAL_H */ |