diff options
author | Ghjuvan Lacambre <lacambre@adacore.com> | 2022-03-28 16:40:46 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-05-17 08:25:49 +0000 |
commit | a51b6016c96e221fbbfcdf75baa87fcdbc0a2904 (patch) | |
tree | 8fda3b668f1d08d7adcc6f03c23e8ceb6c91ba32 /gcc/ada/gnat_cuda.ads | |
parent | 5ab656c5e90219ce2d11a9c88d06ff927b275297 (diff) | |
download | gcc-a51b6016c96e221fbbfcdf75baa87fcdbc0a2904.zip gcc-a51b6016c96e221fbbfcdf75baa87fcdbc0a2904.tar.gz gcc-a51b6016c96e221fbbfcdf75baa87fcdbc0a2904.tar.bz2 |
[Ada] CUDA: remove code performing kernel registration
A previous commit implemented a new kernel registration scheme, using
the binder to generate registration code rather than inserting
registration code in packages. Now that this new approach has had time
to be thoroughly tested, it is time to remove the old approach.
gcc/ada/
* gnat_cuda.ads: Update package-level comments.
(Build_And_Insert_CUDA_Initialization): Remove function.
* gnat_cuda.adb (Build_And_Insert_CUDA_Initialization): Remove
function.
(Expand_CUDA_Package): Remove call to
Build_And_Insert_CUDA_Initialization.
Diffstat (limited to 'gcc/ada/gnat_cuda.ads')
-rw-r--r-- | gcc/ada/gnat_cuda.ads | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/ada/gnat_cuda.ads b/gcc/ada/gnat_cuda.ads index e756162..1333a65 100644 --- a/gcc/ada/gnat_cuda.ads +++ b/gcc/ada/gnat_cuda.ads @@ -43,14 +43,13 @@ -- compiling for the host, the frontend stores procedures marked with -- CUDA_Global in a hash table the key of which is the Node_Id of the package -- body that contains the CUDA_Global procedure. This is done in sem_prag.adb. --- Once the declarations of a package body have been analyzed, variable, type --- and procedure declarations necessary for the initialization of the CUDA --- runtime are appended to the package that contains the CUDA_Global --- procedure. --- --- These declarations are used to register the CUDA kernel with the CUDA --- runtime when the program is launched. Registering a CUDA kernel with the --- CUDA runtime requires multiple function calls: +-- When emitting an ALI file for a compilation unit, the frontend emits 'K' +-- lines for each visible CUDA kernel (see Output_CUDA_Symbols in +-- lib-writ.adb). This allows the binder to see all kernels in a program and +-- emit code to register the kernels with the CUDA runtime. + +-- Registering a CUDA kernel with the CUDA runtime requires multiple function +-- calls: -- - The first one registers the fat binary which corresponds to the package -- with the CUDA runtime. -- - Then, as many function calls as there are kernels in order to bind them @@ -58,9 +57,7 @@ -- fat binary. -- - The last call lets the CUDA runtime know that we are done initializing -- CUDA. --- Expansion of the CUDA_Global aspect is triggered in sem_ch7.adb, during --- analysis of the package. All of this expansion is performed in the --- Insert_CUDA_Initialization procedure defined in GNAT_CUDA. +-- All of that is performed by the code emitted by bindgen.adb. -- -- Once a CUDA package is initialized, its kernels are ready to be used. -- Launching CUDA kernels is done by using the CUDA_Execute pragma. When @@ -87,8 +84,6 @@ package GNAT_CUDA is procedure Expand_CUDA_Package (N : Node_Id); -- When compiling for the host: - -- - Generate code to register kernels with the CUDA runtime and - -- post-process kernels. -- - Empty content of CUDA_Global procedures. -- - Remove declarations of CUDA_Device entities. |