Issue 230120.4: Add the HIP Programing Language

Author: Tony Tye
Champion: Michael Eager
Date submitted: 2023-01-20
Date revised:
Date closed: 2023-02-02
Type: Enhancement
Status: Lang code assigned
DWARF Version: 6
Section various, pg various
PROBLEM DESCRIPTION

Add the HIP programming language, which is supported by the AMDGPU.

HIP consists of a language extensions/restrictions to C++ and a runtime API.
The language has syntax for defining host and device functions, and a 
<<<…>>> syntax to launch grid dispatches of device kernels. The device 
functions have language intrinsics to access the thread position in the 
dispatch, have additional language features to support address spaces, 
and the memory model has extra support for both address spaces and memory 
scopes. The address-of operator for device functions is also a bit different 
as it produces an address in the generic address space (able to reference 
storage in multiple other address spaces).

A debugger has to treat the language address spaces differently than 
plain C++ and also support the HIP language specific intrinsics.

HIP as a language has similarities to the OpenCL kernel language and 
the CUDA language.

See: https://rocmdocs.amd.com/en/latest/Programming_Guides/Programming-Guides.html


PROPOSAL for DWARF 5

In Section 3.1.1 "Full and Partial Compilation Unit Entries", add the following

row to Table 3.1 "Language Names":

    ----------------------------------------------------------------------------
    Table 3.1: Language Names
    ==================== =============================
    Language Name        Meaning
    ==================== =============================
    DW_LANG_HIP          HIP
    ==================== =============================

    ----------------------------------------------------------------------------

In Section 7.12 "Source Languages", add the following row to Table 7.17
"Language encodings":

    ----------------------------------------------------------------------------
    Table 7.17: Language encodings
    ==================== ====== ===================
    Language Name        Value  Default Lower Bound
    ==================== ====== ===================
    DW_LANG_HIP          0x0030 0
    ==================== ====== ===================
    ----------------------------------------------------------------------------


PROPOSAL for DWARF 6 

In Section 3.1.1 "Full and Partial Compilation Unit Entries", add the following
row to Table 3.1 "Language Names":

    ----------------------------------------------------------------------------
    Table 3.1: Language Names
    ==================== ================= ==================
    Language name        Meaning           Version Scheme
    ==================== ================= ==================
    DW_LNAME_HIP         HIP
    ==================== ================= ==================
    ----------------------------------------------------------------------------

In Section 7.12 "Source Languages", add the following row to Table 7.17
"Language encodings":

    ----------------------------------------------------------------------------
    Table 7.17: Language encodings
    ==================== ====== ===================
    Language name        Value  Default Lower Bound
    ==================== ====== ===================
    DW_LNAME_HIP ‡       0x001d 0
    ==================== ====== ===================
    ----------------------------------------------------------------------------
--
2023-02-02:  Language code assigned.