aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2021-09-14 10:49:08 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-13 08:04:43 +0000
commita2cff9e9af15b179ff7a2c7e147e88ec8ce52936 (patch)
tree875ff769e9ec405dc2eaca642428b1b63b5009d8 /gcc/ada/gcc-interface
parente3584606f5cb9bfc717a19e96731bc35ea11a40e (diff)
downloadgcc-a2cff9e9af15b179ff7a2c7e147e88ec8ce52936.zip
gcc-a2cff9e9af15b179ff7a2c7e147e88ec8ce52936.tar.gz
gcc-a2cff9e9af15b179ff7a2c7e147e88ec8ce52936.tar.bz2
[Ada] CUDA: use binder to generate kernel-registration code
Compiling CUDA code requires compiling code for the host (= CPU) and for the device (= GPU). Device code is embedded into the host code and must be registered with the CUDA runtime by the host. The original approach we took for registering CUDA kernels was to generate the registration-code on a unit basis, i.e. each unit took care of registering its own kernels. Unfortunately, this makes linking kernels and device functions that belong to different units much harder. We thus rework this approach in order to have GNAT generate kernel names in ALI files. The binder reads the ALI files and generates kernel registration code for each of the kernels found in ALI files. gcc/ada/ * ali.adb: Introduce new 'K' line in ALI files, used to represent CUDA kernel entries. * ali.ads: Create new CUDA_Kernels table, which contains entries of type CUDA_Kernel_Record. Each CUDA_Kernel_Record corresponds to a K line in an ali file. * bindgen.adb: Introduce new Gen_CUDA_Init procedure in the binder, which generates CUDA kernel registration code. * gnat_cuda.adb: Move Get_CUDA_Kernels spec to package spec to make it available to bindgen.adb. * gnat_cuda.ads: Likewise. * lib-writ.adb: Introduce new Output_CUDA_Symbols procedure, which generates one 'K' line in the ALI file per visible CUDA kernel. * opt.ads: Introduce Enable_CUDA_Expansion option, triggered by using the -gnatd_c flag. * switch-b.adb: Likewise. * switch-c.adb: Likewise.
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions