Executing CUDA kernels requires registering the kernel with the CUDA
runtime beforehand. This is achieved by keeping track of procedures
marked with CUDA_Global when analyzing packages and then registering
each of the procedures with a fat binary created by the CUDA toolchain.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * debug.adb: Document -gnatd_c flag as being used for CUDA.
        * gnat_cuda.ads: New file.
        * gnat_cuda.adb: New file.
        * rtsfind.ads: Add Interfaces_C_Strings package and
        RE_Fatbin_Wrapper, RE_Register_Fat_Binary,
        RE_Register_Fat_Binary_End, RE_Register_Function, RE_Chars_Ptr,
        RE_New_Char_Array entities.
        * rtsfind.adb: Create new Interfaces_C_Descendant subtype,
        handle it.
        * sem_ch7.adb (Analyze_Package_Body_Helper): Call CUDA init
        procedure.
        * sem_prag.adb (Analyze_Pragma): Call Add_Cuda_Kernel procedure.
        * gcc-interface/Make-lang.in (GNAT_ADA_OBJS): Add gnat_cuda.o.

Attachment: patch.diff.gz
Description: application/gzip

Reply via email to