aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/opt.ads
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2018-09-26 09:17:46 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-09-26 09:17:46 +0000
commit95f2be29446f6d04e4b221b228eac190057d839b (patch)
treeb4e19fae878516ff491fd5168facec2dabd723bf /gcc/ada/opt.ads
parent8e53268102e205b1b10664b53ad41c31a9257b32 (diff)
downloadgcc-95f2be29446f6d04e4b221b228eac190057d839b.zip
gcc-95f2be29446f6d04e4b221b228eac190057d839b.tar.gz
gcc-95f2be29446f6d04e4b221b228eac190057d839b.tar.bz2
[Ada] Front-end support for OpenACC pragmas
This patch introduces the upper part of the Ada front-end support for a first set of OpenACC directives (Acc_Kernels, Acc_Loop, Acc_Parallel, Acc_Data) and their clauses. The pragmas syntax is documented, pragmas are recognized and checked for syntactic correctness, keyed on -fopenacc. A couple of new flags are defined on loop statements in the GNAT tree. 2018-09-26 Olivier Hainque <hainque@adacore.com> gcc/ada/ * opt.ads (OpenAcc_Enabled): New flag. False by default. True when OpenACC pragmas are requested to be honored, when -fopenacc is found on the command line. * back_end.adb (Scan_Compiler_Arguments): Set OpenACC_Enabled if -fopenacc is seen on the command line. * sinfo.adb, sinfo.ads (Is_OpenAcc_Environment): New flag/predicate on Loop statements which embed an Acc_Kernels, Acc_Parallel or Acc_Data pragma. (Is_OpenAcc_Loop): New flag/predicate on Loop statements which embed an Acc_Loop pragma. (Set_Is_OpenAcc_Environment, Set_Is_OpenAcc_Loop): Setters for the new flags. * par-prag.adb (Prag): Handle Acc_Data, Acc_Loop, Acc_Parallel and Acc_Kernels pragmas. Nothing to do here, all handled by sem_prag. * sem_prag.adb (Acc_First, Acc_Next, Validate_Acc_Condition_Clause, Validate_Acc_Data_Clause, Validate_Acc_Int_Expr_Clause, Validate_Acc_Int_Expr_List_Clause, Validate_Acc_Loop_Collapse, Validate_Acc_Loop_Gang, Validate_Acc_Loop_Vector, Validate_Acc_Loop_Worker, Validate_Acc_Name_Reduction, Validate_Acc_Size_Expressions): New helper for Analyze_Pragma, to handle OpenACC pragmas. (Analyze_Pragma): Handle Acc_Data, Acc_Loop, Acc_Parallel and Acc_Kernels pragmas. * sem_ch5.adb (Disable_Constant): Unset Is_True_Constant on variable entity, action for ... (Disable_Constants): Helper for Analyze_Loop_Statement, to ... (Analyze_Loop_Statement): Disable True_Constant on variables referenced within an OpenACC environment. * snames.ads-tmpl: Declare Name_Ids for the OpenACC directives and clauses we can handle. Remove an exraneous whitespace before columns, preventing line length overflow in the generated spec with Ids now reaching beyond 999. * doc/gnat_rm/implementation_defined_pragmas.rst: Document pragma Acc_Parallel, Acc_Loop, Acc_Kernels and Acc_Data. * gnat_rm.texi: Regenerate. From-SVN: r264617
Diffstat (limited to 'gcc/ada/opt.ads')
-rw-r--r--gcc/ada/opt.ads9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index fd45984..ca5dc61 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -2335,6 +2335,15 @@ package Opt is
-- The only special comment sequence allowed is --!
+ -------------
+ -- OpenAcc --
+ -------------
+
+ OpenAcc_Enabled : Boolean := False;
+ -- GNAT
+ -- Indicates whether OpenAcc pragmas should be taken into account.
+ -- Set True by use of -fopenacc.
+
--------------------------
-- Private Declarations --
--------------------------