PR72792 PR72793 relax requirements on rebind members
[official-gcc.git] / gcc / omp-general.h
blobd89e8c179bf1e901dd713cc175aaebd3a941bdf5
1 /* General types and functions that are uselful for processing of OpenMP,
2 OpenACC and similar directivers at various stages of compilation.
4 Copyright (C) 2005-2017 Free Software Foundation, Inc.
6 This file is part of GCC.
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.
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.
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/>. */
22 #ifndef GCC_OMP_GENERAL_H
23 #define GCC_OMP_GENERAL_H
25 #include "gomp-constants.h"
27 /* Flags for an OpenACC loop. */
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). */
35 /* Explicitly specified loop axes. */
36 OLF_DIM_BASE = 4,
37 OLF_DIM_GANG = 1u << (OLF_DIM_BASE + GOMP_DIM_GANG),
38 OLF_DIM_WORKER = 1u << (OLF_DIM_BASE + GOMP_DIM_WORKER),
39 OLF_DIM_VECTOR = 1u << (OLF_DIM_BASE + GOMP_DIM_VECTOR),
41 OLF_MAX = OLF_DIM_BASE + GOMP_DIM_MAX
44 /* A structure holding the elements of:
45 for (V = N1; V cond N2; V += STEP) [...] */
47 struct omp_for_data_loop
49 tree v, n1, n2, step;
50 enum tree_code cond_code;
53 /* A structure describing the main elements of a parallel loop. */
55 struct omp_for_data
57 struct omp_for_data_loop loop;
58 tree chunk_size;
59 gomp_for *for_stmt;
60 tree pre, iter_type;
61 int collapse;
62 int ordered;
63 bool have_nowait, have_ordered, simd_schedule;
64 unsigned char sched_modifiers;
65 enum omp_clause_schedule_kind sched_kind;
66 struct omp_for_data_loop *loops;
69 #define OACC_FN_ATTRIB "oacc function"
71 extern tree omp_find_clause (tree clauses, enum omp_clause_code kind);
72 extern bool omp_is_reference (tree decl);
73 extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code,
74 tree *n2);
75 extern tree omp_get_for_step_from_incr (location_t loc, tree incr);
76 extern void omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
77 struct omp_for_data_loop *loops);
78 extern gimple *omp_build_barrier (tree lhs);
79 extern int omp_max_vf (void);
80 extern int omp_max_simt_vf (void);
81 extern tree oacc_launch_pack (unsigned code, tree device, unsigned op);
82 extern void oacc_replace_fn_attrib (tree fn, tree dims);
83 extern void oacc_set_fn_attrib (tree fn, tree clauses, bool is_kernel,
84 vec<tree> *args);
85 extern tree oacc_build_routine_dims (tree clauses);
86 extern tree oacc_get_fn_attrib (tree fn);
87 extern bool oacc_fn_attrib_kernels_p (tree attr);
88 extern int oacc_get_fn_dim_size (tree fn, int axis);
89 extern int oacc_get_ifn_dim_arg (const gimple *stmt);
91 #endif /* GCC_OMP_GENERAL_H */