]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Improve CUDA host-side and device-side binder support
authorSteve Baird <baird@adacore.com>
Wed, 7 Sep 2022 21:15:46 +0000 (14:15 -0700)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 12 Sep 2022 08:16:53 +0000 (10:16 +0200)
On the host-side, the binder now generates CUDA_Execute pragmas to
invoke initialization and finalization on the device-side. The
front end's expansion of these pragmas includes references to
entities declared in package CUDA.Internal. Generate a with-clause so
that unit will be available.

gcc/ada/

* bindgen.adb: When the binder is invoked for the host, generate a
"with CUDA.Internal;" with clause.

gcc/ada/bindgen.adb

index 1b21230458edb29a8968604740f6c65ab018fe7f..b2fa44d2dffd0c623212d375ec9645b6b5ed2bc5 100644 (file)
@@ -2552,6 +2552,9 @@ package body Bindgen is
       if Enable_CUDA_Expansion then
          WBI ("with Interfaces.C;");
          WBI ("with Interfaces.C.Strings;");
+
+         --  with of CUDA.Internal needed for CUDA_Execute pragma expansion
+         WBI ("with CUDA.Internal;");
       end if;
 
       Resolve_Binder_Options (Elab_Order);