]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Move Build_And_Insert_CUDA_Initialization to expansion phase
authorGhjuvan Lacambre <lacambre@adacore.com>
Tue, 12 Jan 2021 12:57:59 +0000 (13:57 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 5 May 2021 08:19:02 +0000 (04:19 -0400)
gcc/ada/

* exp_ch7.adb (Expand_N_Package_Body): Add CUDA init call.
* sem_ch7.adb (Analyze_Package_Body_Helper): Remove CUDA init
call.

gcc/ada/exp_ch7.adb
gcc/ada/sem_ch7.adb

index 0d7a644d35a9d4511ba0be8106c5992fd2e6a660..d3c7ca7c5857af1151c466d2a2aad5c8d4a5cfa5 100644 (file)
@@ -43,6 +43,7 @@ with Exp_Prag;  use Exp_Prag;
 with Exp_Tss;   use Exp_Tss;
 with Exp_Util;  use Exp_Util;
 with Freeze;    use Freeze;
+with GNAT_CUDA; use GNAT_CUDA;
 with Lib;       use Lib;
 with Nlists;    use Nlists;
 with Nmake;     use Nmake;
@@ -5756,6 +5757,13 @@ package body Exp_Ch7 is
             Build_Static_Dispatch_Tables (N);
          end if;
 
+         --  If procedures marked with CUDA_Global have been defined within N,
+         --  we need to register them with the CUDA runtime at program startup.
+         --  This requires multiple declarations and function calls which need
+         --  to be appended to N's declarations.
+
+         Build_And_Insert_CUDA_Initialization (N);
+
          Build_Task_Activation_Call (N);
 
          --  Verify the run-time semantics of pragma Initial_Condition at the
index ec510eb1b38167e0451aa04fe1db8c0951183286..dcb2af5a6ae19e74212b8fa14a3d274b39cb1f3c 100644 (file)
@@ -40,7 +40,6 @@ with Exp_Dist;  use Exp_Dist;
 with Exp_Dbug;  use Exp_Dbug;
 with Freeze;    use Freeze;
 with Ghost;     use Ghost;
-with GNAT_CUDA; use GNAT_CUDA;
 with Lib;       use Lib;
 with Lib.Xref;  use Lib.Xref;
 with Namet;     use Namet;
@@ -1000,13 +999,6 @@ package body Sem_Ch7 is
          Analyze_List (Declarations (N));
       end if;
 
-      --  If procedures marked with CUDA_Global have been defined within N, we
-      --  need to register them with the CUDA runtime at program startup. This
-      --  requires multiple declarations and function calls which need to be
-      --  appended to N's declarations.
-
-      Build_And_Insert_CUDA_Initialization (N);
-
       HSS := Handled_Statement_Sequence (N);
 
       if Present (HSS) then
This page took 0.07459 seconds and 5 git commands to generate.