xref: /freebsd/contrib/llvm-project/llvm/include/llvm/Support/NVPTXAddrSpace.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===---------------- NVPTXAddrSpace.h -------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// NVPTX address space definition
11 ///
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_SUPPORT_NVPTXADDRSPACE_H
16 #define LLVM_SUPPORT_NVPTXADDRSPACE_H
17 
18 namespace llvm {
19 namespace NVPTXAS {
20 
21 enum AddressSpace : unsigned {
22   ADDRESS_SPACE_GENERIC = 0,
23   ADDRESS_SPACE_GLOBAL = 1,
24   ADDRESS_SPACE_SHARED = 3,
25   ADDRESS_SPACE_CONST = 4,
26   ADDRESS_SPACE_LOCAL = 5,
27   ADDRESS_SPACE_TENSOR = 6,
28   ADDRESS_SPACE_SHARED_CLUSTER = 7,
29 
30   ADDRESS_SPACE_PARAM = 101,
31 };
32 
33 // According to official PTX Writer's Guide, DWARF debug information should
34 // contain DW_AT_address_class attribute for all variables and parameters.
35 // It's required for cuda-gdb to be able to properly reflect the memory space
36 // of variable address. Acceptable address class codes are listed in this enum.
37 //
38 // More detailed information:
39 // https://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#cuda-specific-dwarf-definitions
40 enum DWARF_AddressSpace : unsigned {
41   DWARF_ADDR_code_space = 1,
42   DWARF_ADDR_reg_space = 2,
43   DWARF_ADDR_sreg_space = 3,
44   DWARF_ADDR_const_space = 4,
45   DWARF_ADDR_global_space = 5,
46   DWARF_ADDR_local_space = 6,
47   DWARF_ADDR_param_space = 7,
48   DWARF_ADDR_shared_space = 8,
49   DWARF_ADDR_surf_space = 9,
50   DWARF_ADDR_tex_space = 10,
51   DWARF_ADDR_tex_sampler_space = 11,
52   DWARF_ADDR_generic_space = 12
53 };
54 
55 } // end namespace NVPTXAS
56 } // end namespace llvm
57 
58 #endif // LLVM_SUPPORT_NVPTXADDRSPACE_H
59