summaryrefslogtreecommitdiff
path: root/gcc/fortran/gfortran.h
diff options
context:
space:
mode:
authorjnorris <jnorris@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-22 16:45:38 +0000
committerjnorris <jnorris@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-22 16:45:38 +0000
commit01d728a4330f09604b1a1e4fec27001765183966 (patch)
tree07e91d9f58d420855371941119707e37a4f2c08e /gcc/fortran/gfortran.h
parent2ec3c6ff4b46d93815c12fde65c6e2ae81a5cd5f (diff)
downloadgcc-01d728a4330f09604b1a1e4fec27001765183966.tar.gz
gcc/fortran/
* dump-parse-tree.c (show_namespace): Handle declares. * gfortran.h (struct symbol_attribute): New fields. (enum gfc_omp_map_map): Add OMP_MAP_DEVICE_RESIDENT and OMP_MAP_LINK. (OMP_LIST_LINK): New enum. (struct gfc_oacc_declare): New structure. (gfc_get_oacc_declare): New definition. (struct gfc_namespace): Change type. (enum gfc_exec_op): Add EXEC_OACC_DECLARE. (struct gfc_code): New field. * module.c (enum ab_attribute): Add AB_OACC_DECLARE_CREATE, AB_OACC_DECLARE_COPYIN, AB_OACC_DECLARE_DEVICEPTR, AB_OACC_DECLARE_DEVICE_RESIDENT, AB_OACC_DECLARE_LINK (attr_bits): Add new initializers. (mio_symbol_attribute): Handle new atributes. * openmp.c (gfc_free_oacc_declare_clauses): New function. (gfc_match_oacc_clause_link: Likewise. (OMP_CLAUSE_LINK): New definition. (gfc_match_omp_clauses): Handle OMP_CLAUSE_LINK. (OACC_DECLARE_CLAUSES): Add OMP_CLAUSE_LINK (gfc_match_oacc_declare): Add checking and module handling. (resolve_omp_clauses): Add array initializer. (gfc_resolve_oacc_declare): Reimplement. * parse.c (case_decl): Add ST_OACC_DECLARE. (parse_spec): Remove handling. (parse_progunit): Remove handling. * parse.h (struct gfc_state_data): Change type. * resolve.c (gfc_resolve_blocks): Handle EXEC_OACC_DECLARE. * st.c (gfc_free_statement): Handle EXEC_OACC_DECLARE. * symbol.c (check_conflict): Add conflict checks. (gfc_add_oacc_declare_create, gfc_add_oacc_declare_copyin, gfc_add_oacc_declare_deviceptr, gfc_add_oacc_declare_device_resident): New functions. (gfc_copy_attr): Handle new symbols. * trans-decl.c (add_clause, find_module_oacc_declare_clauses, finish_oacc_declare): New functions. (gfc_generate_function_code): Replace with call. * trans-openmp.c (gfc_trans_oacc_declare): Reimplement. (gfc_trans_oacc_directive): Handle EXEC_OACC_DECLARE. * trans-stmt.c (gfc_trans_block_construct): Replace with call. * trans-stmt.h (gfc_trans_oacc_declare): Remove argument. * trans.c (trans_code): Handle EXEC_OACC_DECLARE. gcc/testsuite * gfortran.dg/goacc/declare-1.f95: Update test. * gfortran.dg/goacc/declare-2.f95: New test. libgomp/ * testsuite/libgomp.oacc-fortran/declare-1.f90: New test. * testsuite/libgomp.oacc-fortran/declare-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-3.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-4.f90: Likewise. * testsuite/libgomp.oacc-fortran/declare-5.f90: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/gfortran.h')
-rw-r--r--gcc/fortran/gfortran.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index e13b4d48afa..5487c9343e4 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -841,6 +841,13 @@ typedef struct
/* Mentioned in OMP DECLARE TARGET. */
unsigned omp_declare_target:1;
+ /* Mentioned in OACC DECLARE. */
+ unsigned oacc_declare_create:1;
+ unsigned oacc_declare_copyin:1;
+ unsigned oacc_declare_deviceptr:1;
+ unsigned oacc_declare_device_resident:1;
+ unsigned oacc_declare_link:1;
+
/* Attributes set by compiler extensions (!GCC$ ATTRIBUTES). */
unsigned ext_attr:EXT_ATTR_NUM;
@@ -1106,7 +1113,9 @@ enum gfc_omp_map_op
OMP_MAP_FORCE_FROM,
OMP_MAP_FORCE_TOFROM,
OMP_MAP_FORCE_PRESENT,
- OMP_MAP_FORCE_DEVICEPTR
+ OMP_MAP_FORCE_DEVICEPTR,
+ OMP_MAP_DEVICE_RESIDENT,
+ OMP_MAP_LINK
};
/* For use in OpenMP clauses in case we need extra information
@@ -1148,6 +1157,7 @@ enum
OMP_LIST_FROM,
OMP_LIST_REDUCTION,
OMP_LIST_DEVICE_RESIDENT,
+ OMP_LIST_LINK,
OMP_LIST_USE_DEVICE,
OMP_LIST_CACHE,
OMP_LIST_NUM
@@ -1234,6 +1244,20 @@ gfc_omp_clauses;
#define gfc_get_omp_clauses() XCNEW (gfc_omp_clauses)
+/* Node in the linked list used for storing !$oacc declare constructs. */
+
+typedef struct gfc_oacc_declare
+{
+ struct gfc_oacc_declare *next;
+ bool module_var;
+ gfc_omp_clauses *clauses;
+ locus loc;
+}
+gfc_oacc_declare;
+
+#define gfc_get_oacc_declare() XCNEW (gfc_oacc_declare)
+
+
/* Node in the linked list used for storing !$omp declare simd constructs. */
typedef struct gfc_omp_declare_simd
@@ -1645,8 +1669,8 @@ typedef struct gfc_namespace
this namespace. */
struct gfc_data *data, *old_data;
- /* !$ACC DECLARE clauses. */
- gfc_omp_clauses *oacc_declare_clauses;
+ /* !$ACC DECLARE. */
+ gfc_oacc_declare *oacc_declare;
gfc_charlen *cl_list, *old_cl_list;
@@ -2324,6 +2348,7 @@ enum gfc_exec_op
EXEC_OACC_PARALLEL, EXEC_OACC_KERNELS, EXEC_OACC_DATA, EXEC_OACC_HOST_DATA,
EXEC_OACC_LOOP, EXEC_OACC_UPDATE, EXEC_OACC_WAIT, EXEC_OACC_CACHE,
EXEC_OACC_ENTER_DATA, EXEC_OACC_EXIT_DATA, EXEC_OACC_ATOMIC,
+ EXEC_OACC_DECLARE,
EXEC_OMP_CRITICAL, EXEC_OMP_DO, EXEC_OMP_FLUSH, EXEC_OMP_MASTER,
EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
@@ -2405,6 +2430,7 @@ typedef struct gfc_code
struct gfc_code *which_construct;
int stop_code;
gfc_entry_list *entry;
+ gfc_oacc_declare *oacc_declare;
gfc_omp_clauses *omp_clauses;
const char *omp_name;
gfc_omp_namelist *omp_namelist;
@@ -2907,6 +2933,7 @@ gfc_expr *gfc_get_parentheses (gfc_expr *);
/* openmp.c */
struct gfc_omp_saved_state { void *ptrs[2]; int ints[1]; };
void gfc_free_omp_clauses (gfc_omp_clauses *);
+void gfc_free_oacc_declare_clauses (struct gfc_oacc_declare *);
void gfc_free_omp_declare_simd (gfc_omp_declare_simd *);
void gfc_free_omp_declare_simd_list (gfc_omp_declare_simd *);
void gfc_free_omp_udr (gfc_omp_udr *);
@@ -3224,4 +3251,8 @@ gfc_expr *gfc_simplify_ieee_functions (gfc_expr *);
bool gfc_is_reallocatable_lhs (gfc_expr *);
+/* trans-decl.c */
+
+void finish_oacc_declare (gfc_namespace *, gfc_symbol *, bool);
+
#endif /* GCC_GFORTRAN_H */