tinygrad 0.10.2__py3-none-any.whl → 0.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. tinygrad/__init__.py +1 -1
  2. tinygrad/apps/llm.py +206 -0
  3. tinygrad/codegen/__init__.py +116 -0
  4. tinygrad/codegen/devectorizer.py +315 -172
  5. tinygrad/codegen/expander.py +8 -16
  6. tinygrad/codegen/gpudims.py +89 -0
  7. tinygrad/codegen/linearize.py +205 -203
  8. tinygrad/codegen/lowerer.py +92 -139
  9. tinygrad/codegen/opt/__init__.py +38 -0
  10. tinygrad/codegen/opt/heuristic.py +125 -0
  11. tinygrad/codegen/opt/kernel.py +510 -0
  12. tinygrad/{engine → codegen/opt}/search.py +51 -35
  13. tinygrad/codegen/opt/swizzler.py +134 -0
  14. tinygrad/codegen/opt/tc.py +127 -0
  15. tinygrad/codegen/quantize.py +67 -0
  16. tinygrad/device.py +122 -132
  17. tinygrad/dtype.py +152 -35
  18. tinygrad/engine/jit.py +81 -54
  19. tinygrad/engine/memory.py +46 -27
  20. tinygrad/engine/realize.py +82 -41
  21. tinygrad/engine/schedule.py +70 -445
  22. tinygrad/frontend/__init__.py +0 -0
  23. tinygrad/frontend/onnx.py +1253 -0
  24. tinygrad/frontend/torch.py +5 -0
  25. tinygrad/gradient.py +19 -27
  26. tinygrad/helpers.py +95 -47
  27. tinygrad/nn/__init__.py +7 -8
  28. tinygrad/nn/optim.py +72 -41
  29. tinygrad/nn/state.py +37 -23
  30. tinygrad/renderer/__init__.py +40 -60
  31. tinygrad/renderer/cstyle.py +143 -128
  32. tinygrad/renderer/llvmir.py +113 -62
  33. tinygrad/renderer/ptx.py +50 -32
  34. tinygrad/renderer/wgsl.py +27 -23
  35. tinygrad/runtime/autogen/am/am.py +5861 -0
  36. tinygrad/runtime/autogen/am/pm4_nv.py +962 -0
  37. tinygrad/runtime/autogen/am/pm4_soc15.py +931 -0
  38. tinygrad/runtime/autogen/am/sdma_4_0_0.py +5209 -0
  39. tinygrad/runtime/autogen/am/sdma_4_4_2.py +5209 -0
  40. tinygrad/runtime/autogen/am/sdma_5_0_0.py +7103 -0
  41. tinygrad/runtime/autogen/am/sdma_6_0_0.py +8085 -0
  42. tinygrad/runtime/autogen/am/smu_v13_0_0.py +3068 -0
  43. tinygrad/runtime/autogen/am/smu_v14_0_2.py +3605 -0
  44. tinygrad/runtime/autogen/amd_gpu.py +1433 -67197
  45. tinygrad/runtime/autogen/comgr.py +35 -9
  46. tinygrad/runtime/autogen/comgr_3.py +906 -0
  47. tinygrad/runtime/autogen/cuda.py +2419 -494
  48. tinygrad/runtime/autogen/hsa.py +57 -16
  49. tinygrad/runtime/autogen/ib.py +7171 -0
  50. tinygrad/runtime/autogen/io_uring.py +917 -118
  51. tinygrad/runtime/autogen/kfd.py +748 -26
  52. tinygrad/runtime/autogen/libc.py +613 -218
  53. tinygrad/runtime/autogen/libusb.py +1643 -0
  54. tinygrad/runtime/autogen/nv/nv.py +8602 -0
  55. tinygrad/runtime/autogen/nv_gpu.py +7218 -2072
  56. tinygrad/runtime/autogen/opencl.py +2 -4
  57. tinygrad/runtime/autogen/sqtt.py +1789 -0
  58. tinygrad/runtime/autogen/vfio.py +3 -3
  59. tinygrad/runtime/autogen/webgpu.py +273 -264
  60. tinygrad/runtime/graph/cuda.py +3 -3
  61. tinygrad/runtime/graph/hcq.py +68 -29
  62. tinygrad/runtime/graph/metal.py +29 -13
  63. tinygrad/runtime/graph/remote.py +114 -0
  64. tinygrad/runtime/ops_amd.py +537 -320
  65. tinygrad/runtime/ops_cpu.py +108 -7
  66. tinygrad/runtime/ops_cuda.py +12 -14
  67. tinygrad/runtime/ops_disk.py +13 -10
  68. tinygrad/runtime/ops_dsp.py +47 -40
  69. tinygrad/runtime/ops_gpu.py +13 -11
  70. tinygrad/runtime/ops_hip.py +6 -9
  71. tinygrad/runtime/ops_llvm.py +35 -15
  72. tinygrad/runtime/ops_metal.py +29 -19
  73. tinygrad/runtime/ops_npy.py +5 -3
  74. tinygrad/runtime/ops_null.py +28 -0
  75. tinygrad/runtime/ops_nv.py +306 -234
  76. tinygrad/runtime/ops_python.py +62 -52
  77. tinygrad/runtime/ops_qcom.py +28 -39
  78. tinygrad/runtime/ops_remote.py +482 -0
  79. tinygrad/runtime/ops_webgpu.py +28 -28
  80. tinygrad/runtime/support/am/amdev.py +114 -249
  81. tinygrad/runtime/support/am/ip.py +211 -172
  82. tinygrad/runtime/support/amd.py +138 -0
  83. tinygrad/runtime/support/{compiler_hip.py → compiler_amd.py} +40 -8
  84. tinygrad/runtime/support/compiler_cuda.py +8 -11
  85. tinygrad/runtime/support/elf.py +2 -1
  86. tinygrad/runtime/support/hcq.py +184 -97
  87. tinygrad/runtime/support/ib.py +172 -0
  88. tinygrad/runtime/support/llvm.py +3 -4
  89. tinygrad/runtime/support/memory.py +251 -0
  90. tinygrad/runtime/support/nv/__init__.py +0 -0
  91. tinygrad/runtime/support/nv/ip.py +581 -0
  92. tinygrad/runtime/support/nv/nvdev.py +183 -0
  93. tinygrad/runtime/support/system.py +170 -0
  94. tinygrad/runtime/support/usb.py +268 -0
  95. tinygrad/runtime/support/webgpu.py +18 -0
  96. tinygrad/schedule/__init__.py +0 -0
  97. tinygrad/schedule/grouper.py +119 -0
  98. tinygrad/schedule/kernelize.py +368 -0
  99. tinygrad/schedule/multi.py +231 -0
  100. tinygrad/shape/shapetracker.py +40 -46
  101. tinygrad/shape/view.py +88 -52
  102. tinygrad/tensor.py +968 -542
  103. tinygrad/uop/__init__.py +117 -0
  104. tinygrad/{codegen/transcendental.py → uop/decompositions.py} +125 -38
  105. tinygrad/uop/mathtraits.py +169 -0
  106. tinygrad/uop/ops.py +1021 -0
  107. tinygrad/uop/spec.py +228 -0
  108. tinygrad/{codegen → uop}/symbolic.py +239 -216
  109. tinygrad/uop/upat.py +163 -0
  110. tinygrad/viz/assets/cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/languages/x86asm.min.js +19 -0
  111. tinygrad/viz/assets/d3js.org/d3.v7.min.js +2 -0
  112. tinygrad/viz/assets/dagrejs.github.io/project/dagre/latest/dagre.min.js +801 -0
  113. tinygrad/viz/index.html +203 -403
  114. tinygrad/viz/js/index.js +718 -0
  115. tinygrad/viz/js/worker.js +29 -0
  116. tinygrad/viz/serve.py +224 -102
  117. {tinygrad-0.10.2.dist-info → tinygrad-0.11.0.dist-info}/METADATA +24 -16
  118. tinygrad-0.11.0.dist-info/RECORD +141 -0
  119. {tinygrad-0.10.2.dist-info → tinygrad-0.11.0.dist-info}/WHEEL +1 -1
  120. tinygrad/codegen/kernel.py +0 -693
  121. tinygrad/engine/multi.py +0 -161
  122. tinygrad/ops.py +0 -1003
  123. tinygrad/runtime/ops_cloud.py +0 -220
  124. tinygrad/runtime/support/allocator.py +0 -94
  125. tinygrad/spec.py +0 -155
  126. tinygrad/viz/assets/d3js.org/d3.v5.min.js +0 -2
  127. tinygrad/viz/assets/dagrejs.github.io/project/dagre-d3/latest/dagre-d3.min.js +0 -4816
  128. tinygrad/viz/perfetto.html +0 -178
  129. tinygrad-0.10.2.dist-info/RECORD +0 -99
  130. {tinygrad-0.10.2.dist-info → tinygrad-0.11.0.dist-info/licenses}/LICENSE +0 -0
  131. {tinygrad-0.10.2.dist-info → tinygrad-0.11.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,962 @@
1
+ # mypy: ignore-errors
2
+ # -*- coding: utf-8 -*-
3
+ #
4
+ # TARGET arch is: []
5
+ # WORD_SIZE is: 8
6
+ # POINTER_SIZE is: 8
7
+ # LONGDOUBLE_SIZE is: 16
8
+ #
9
+ import ctypes
10
+
11
+
12
+ class AsDictMixin:
13
+ @classmethod
14
+ def as_dict(cls, self):
15
+ result = {}
16
+ if not isinstance(self, AsDictMixin):
17
+ # not a structure, assume it's already a python object
18
+ return self
19
+ if not hasattr(cls, "_fields_"):
20
+ return result
21
+ # sys.version_info >= (3, 5)
22
+ # for (field, *_) in cls._fields_: # noqa
23
+ for field_tuple in cls._fields_: # noqa
24
+ field = field_tuple[0]
25
+ if field.startswith('PADDING_'):
26
+ continue
27
+ value = getattr(self, field)
28
+ type_ = type(value)
29
+ if hasattr(value, "_length_") and hasattr(value, "_type_"):
30
+ # array
31
+ if not hasattr(type_, "as_dict"):
32
+ value = [v for v in value]
33
+ else:
34
+ type_ = type_._type_
35
+ value = [type_.as_dict(v) for v in value]
36
+ elif hasattr(value, "contents") and hasattr(value, "_type_"):
37
+ # pointer
38
+ try:
39
+ if not hasattr(type_, "as_dict"):
40
+ value = value.contents
41
+ else:
42
+ type_ = type_._type_
43
+ value = type_.as_dict(value.contents)
44
+ except ValueError:
45
+ # nullptr
46
+ value = None
47
+ elif isinstance(value, AsDictMixin):
48
+ # other structure
49
+ value = type_.as_dict(value)
50
+ result[field] = value
51
+ return result
52
+
53
+
54
+ class Structure(ctypes.Structure, AsDictMixin):
55
+
56
+ def __init__(self, *args, **kwds):
57
+ # We don't want to use positional arguments fill PADDING_* fields
58
+
59
+ args = dict(zip(self.__class__._field_names_(), args))
60
+ args.update(kwds)
61
+ super(Structure, self).__init__(**args)
62
+
63
+ @classmethod
64
+ def _field_names_(cls):
65
+ if hasattr(cls, '_fields_'):
66
+ return (f[0] for f in cls._fields_ if not f[0].startswith('PADDING'))
67
+ else:
68
+ return ()
69
+
70
+ @classmethod
71
+ def get_type(cls, field):
72
+ for f in cls._fields_:
73
+ if f[0] == field:
74
+ return f[1]
75
+ return None
76
+
77
+ @classmethod
78
+ def bind(cls, bound_fields):
79
+ fields = {}
80
+ for name, type_ in cls._fields_:
81
+ if hasattr(type_, "restype"):
82
+ if name in bound_fields:
83
+ if bound_fields[name] is None:
84
+ fields[name] = type_()
85
+ else:
86
+ # use a closure to capture the callback from the loop scope
87
+ fields[name] = (
88
+ type_((lambda callback: lambda *args: callback(*args))(
89
+ bound_fields[name]))
90
+ )
91
+ del bound_fields[name]
92
+ else:
93
+ # default callback implementation (does nothing)
94
+ try:
95
+ default_ = type_(0).restype().value
96
+ except TypeError:
97
+ default_ = None
98
+ fields[name] = type_((
99
+ lambda default_: lambda *args: default_)(default_))
100
+ else:
101
+ # not a callback function, use default initialization
102
+ if name in bound_fields:
103
+ fields[name] = bound_fields[name]
104
+ del bound_fields[name]
105
+ else:
106
+ fields[name] = type_()
107
+ if len(bound_fields) != 0:
108
+ raise ValueError(
109
+ "Cannot bind the following unknown callback(s) {}.{}".format(
110
+ cls.__name__, bound_fields.keys()
111
+ ))
112
+ return cls(**fields)
113
+
114
+
115
+ class Union(ctypes.Union, AsDictMixin):
116
+ pass
117
+
118
+
119
+
120
+
121
+
122
+ F32_MES_PM4_PACKETS_H = True # macro
123
+ uint32_t = True # macro
124
+ int32_t = True # macro
125
+ PM4_MES_HEADER_DEFINED = True # macro
126
+ PM4_MEC_RELEASE_MEM_DEFINED = True # macro
127
+ PM4_MEC_WRITE_DATA_DEFINED = True # macro
128
+ class union_PM4_MES_TYPE_3_HEADER(Union):
129
+ pass
130
+
131
+ class struct_PM4_MES_TYPE_3_HEADER_0(Structure):
132
+ pass
133
+
134
+ struct_PM4_MES_TYPE_3_HEADER_0._pack_ = 1 # source:False
135
+ struct_PM4_MES_TYPE_3_HEADER_0._fields_ = [
136
+ ('reserved1', ctypes.c_uint32, 8),
137
+ ('opcode', ctypes.c_uint32, 8),
138
+ ('count', ctypes.c_uint32, 14),
139
+ ('type', ctypes.c_uint32, 2),
140
+ ]
141
+
142
+ union_PM4_MES_TYPE_3_HEADER._pack_ = 1 # source:False
143
+ union_PM4_MES_TYPE_3_HEADER._anonymous_ = ('_0',)
144
+ union_PM4_MES_TYPE_3_HEADER._fields_ = [
145
+ ('_0', struct_PM4_MES_TYPE_3_HEADER_0),
146
+ ('u32All', ctypes.c_uint32),
147
+ ]
148
+
149
+
150
+ # values for enumeration 'c_uint32'
151
+ c_uint32__enumvalues = {
152
+ 5: 'event_index__mec_release_mem__end_of_pipe',
153
+ 6: 'event_index__mec_release_mem__shader_done',
154
+ }
155
+ event_index__mec_release_mem__end_of_pipe = 5
156
+ event_index__mec_release_mem__shader_done = 6
157
+ c_uint32 = ctypes.c_uint32 # enum
158
+
159
+ # values for enumeration 'c_uint32'
160
+ c_uint32__enumvalues = {
161
+ 0: 'cache_policy__mec_release_mem__lru',
162
+ 1: 'cache_policy__mec_release_mem__stream',
163
+ }
164
+ cache_policy__mec_release_mem__lru = 0
165
+ cache_policy__mec_release_mem__stream = 1
166
+ c_uint32 = ctypes.c_uint32 # enum
167
+
168
+ # values for enumeration 'c_uint32'
169
+ c_uint32__enumvalues = {
170
+ 0: 'pq_exe_status__mec_release_mem__default',
171
+ 1: 'pq_exe_status__mec_release_mem__phase_update',
172
+ }
173
+ pq_exe_status__mec_release_mem__default = 0
174
+ pq_exe_status__mec_release_mem__phase_update = 1
175
+ c_uint32 = ctypes.c_uint32 # enum
176
+
177
+ # values for enumeration 'c_uint32'
178
+ c_uint32__enumvalues = {
179
+ 0: 'dst_sel__mec_release_mem__memory_controller',
180
+ 1: 'dst_sel__mec_release_mem__tc_l2',
181
+ 2: 'dst_sel__mec_release_mem__queue_write_pointer_register',
182
+ 3: 'dst_sel__mec_release_mem__queue_write_pointer_poll_mask_bit',
183
+ }
184
+ dst_sel__mec_release_mem__memory_controller = 0
185
+ dst_sel__mec_release_mem__tc_l2 = 1
186
+ dst_sel__mec_release_mem__queue_write_pointer_register = 2
187
+ dst_sel__mec_release_mem__queue_write_pointer_poll_mask_bit = 3
188
+ c_uint32 = ctypes.c_uint32 # enum
189
+
190
+ # values for enumeration 'c_uint32'
191
+ c_uint32__enumvalues = {
192
+ 0: 'int_sel__mec_release_mem__none',
193
+ 1: 'int_sel__mec_release_mem__send_interrupt_only',
194
+ 2: 'int_sel__mec_release_mem__send_interrupt_after_write_confirm',
195
+ 3: 'int_sel__mec_release_mem__send_data_after_write_confirm',
196
+ 4: 'int_sel__mec_release_mem__unconditionally_send_int_ctxid',
197
+ 5: 'int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_32_bit_compare',
198
+ 6: 'int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_64_bit_compare',
199
+ }
200
+ int_sel__mec_release_mem__none = 0
201
+ int_sel__mec_release_mem__send_interrupt_only = 1
202
+ int_sel__mec_release_mem__send_interrupt_after_write_confirm = 2
203
+ int_sel__mec_release_mem__send_data_after_write_confirm = 3
204
+ int_sel__mec_release_mem__unconditionally_send_int_ctxid = 4
205
+ int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_32_bit_compare = 5
206
+ int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_64_bit_compare = 6
207
+ c_uint32 = ctypes.c_uint32 # enum
208
+
209
+ # values for enumeration 'c_uint32'
210
+ c_uint32__enumvalues = {
211
+ 0: 'data_sel__mec_release_mem__none',
212
+ 1: 'data_sel__mec_release_mem__send_32_bit_low',
213
+ 2: 'data_sel__mec_release_mem__send_64_bit_data',
214
+ 3: 'data_sel__mec_release_mem__send_gpu_clock_counter',
215
+ 4: 'data_sel__mec_release_mem__send_cp_perfcounter_hi_lo',
216
+ 5: 'data_sel__mec_release_mem__store_gds_data_to_memory',
217
+ }
218
+ data_sel__mec_release_mem__none = 0
219
+ data_sel__mec_release_mem__send_32_bit_low = 1
220
+ data_sel__mec_release_mem__send_64_bit_data = 2
221
+ data_sel__mec_release_mem__send_gpu_clock_counter = 3
222
+ data_sel__mec_release_mem__send_cp_perfcounter_hi_lo = 4
223
+ data_sel__mec_release_mem__store_gds_data_to_memory = 5
224
+ c_uint32 = ctypes.c_uint32 # enum
225
+ class struct_pm4_mec_release_mem(Structure):
226
+ pass
227
+
228
+ class union_pm4_mec_release_mem_0(Union):
229
+ pass
230
+
231
+ union_pm4_mec_release_mem_0._pack_ = 1 # source:False
232
+ union_pm4_mec_release_mem_0._fields_ = [
233
+ ('header', union_PM4_MES_TYPE_3_HEADER),
234
+ ('ordinal1', ctypes.c_uint32),
235
+ ]
236
+
237
+ class union_pm4_mec_release_mem_1(Union):
238
+ pass
239
+
240
+ class struct_pm4_mec_release_mem_1_bitfields2(Structure):
241
+ pass
242
+
243
+ struct_pm4_mec_release_mem_1_bitfields2._pack_ = 1 # source:False
244
+ struct_pm4_mec_release_mem_1_bitfields2._fields_ = [
245
+ ('event_type', ctypes.c_uint32, 6),
246
+ ('reserved1', ctypes.c_uint32, 2),
247
+ ('event_index', c_uint32, 4),
248
+ ('tcl1_vol_action_ena', ctypes.c_uint32, 1),
249
+ ('tc_vol_action_ena', ctypes.c_uint32, 1),
250
+ ('reserved2', ctypes.c_uint32, 1),
251
+ ('tc_wb_action_ena', ctypes.c_uint32, 1),
252
+ ('tcl1_action_ena', ctypes.c_uint32, 1),
253
+ ('tc_action_ena', ctypes.c_uint32, 1),
254
+ ('reserved3', ctypes.c_uint32, 1),
255
+ ('tc_nc_action_ena', ctypes.c_uint32, 1),
256
+ ('tc_wc_action_ena', ctypes.c_uint32, 1),
257
+ ('tc_md_action_ena', ctypes.c_uint32, 1),
258
+ ('reserved4', ctypes.c_uint32, 3),
259
+ ('cache_policy', c_uint32, 2),
260
+ ('reserved5', ctypes.c_uint32, 2),
261
+ ('pq_exe_status', c_uint32, 1),
262
+ ('reserved6', ctypes.c_uint32, 2),
263
+ ]
264
+
265
+ union_pm4_mec_release_mem_1._pack_ = 1 # source:False
266
+ union_pm4_mec_release_mem_1._fields_ = [
267
+ ('bitfields2', struct_pm4_mec_release_mem_1_bitfields2),
268
+ ('ordinal2', ctypes.c_uint32),
269
+ ]
270
+
271
+ class union_pm4_mec_release_mem_2(Union):
272
+ pass
273
+
274
+ class struct_pm4_mec_release_mem_2_bitfields3(Structure):
275
+ pass
276
+
277
+ struct_pm4_mec_release_mem_2_bitfields3._pack_ = 1 # source:False
278
+ struct_pm4_mec_release_mem_2_bitfields3._fields_ = [
279
+ ('reserved7', ctypes.c_uint32, 16),
280
+ ('dst_sel', c_uint32, 2),
281
+ ('reserved8', ctypes.c_uint32, 6),
282
+ ('int_sel', c_uint32, 3),
283
+ ('reserved9', ctypes.c_uint32, 2),
284
+ ('data_sel', c_uint32, 3),
285
+ ]
286
+
287
+ union_pm4_mec_release_mem_2._pack_ = 1 # source:False
288
+ union_pm4_mec_release_mem_2._fields_ = [
289
+ ('bitfields3', struct_pm4_mec_release_mem_2_bitfields3),
290
+ ('ordinal3', ctypes.c_uint32),
291
+ ]
292
+
293
+ class union_pm4_mec_release_mem_3(Union):
294
+ pass
295
+
296
+ class struct_pm4_mec_release_mem_3_bitfields4(Structure):
297
+ pass
298
+
299
+ struct_pm4_mec_release_mem_3_bitfields4._pack_ = 1 # source:False
300
+ struct_pm4_mec_release_mem_3_bitfields4._fields_ = [
301
+ ('reserved10', ctypes.c_uint32, 2),
302
+ ('address_lo_32b', ctypes.c_uint32, 30),
303
+ ]
304
+
305
+ class struct_pm4_mec_release_mem_3_bitfields4b(Structure):
306
+ pass
307
+
308
+ struct_pm4_mec_release_mem_3_bitfields4b._pack_ = 1 # source:False
309
+ struct_pm4_mec_release_mem_3_bitfields4b._fields_ = [
310
+ ('reserved11', ctypes.c_uint32, 3),
311
+ ('address_lo_64b', ctypes.c_uint32, 29),
312
+ ]
313
+
314
+ union_pm4_mec_release_mem_3._pack_ = 1 # source:False
315
+ union_pm4_mec_release_mem_3._fields_ = [
316
+ ('bitfields4', struct_pm4_mec_release_mem_3_bitfields4),
317
+ ('bitfields4b', struct_pm4_mec_release_mem_3_bitfields4b),
318
+ ('reserved12', ctypes.c_uint32),
319
+ ('ordinal4', ctypes.c_uint32),
320
+ ]
321
+
322
+ class union_pm4_mec_release_mem_4(Union):
323
+ pass
324
+
325
+ union_pm4_mec_release_mem_4._pack_ = 1 # source:False
326
+ union_pm4_mec_release_mem_4._fields_ = [
327
+ ('address_hi', ctypes.c_uint32),
328
+ ('reserved13', ctypes.c_uint32),
329
+ ('ordinal5', ctypes.c_uint32),
330
+ ]
331
+
332
+ class union_pm4_mec_release_mem_5(Union):
333
+ pass
334
+
335
+ class struct_pm4_mec_release_mem_5_bitfields6c(Structure):
336
+ pass
337
+
338
+ struct_pm4_mec_release_mem_5_bitfields6c._pack_ = 1 # source:False
339
+ struct_pm4_mec_release_mem_5_bitfields6c._fields_ = [
340
+ ('dw_offset', ctypes.c_uint32, 16),
341
+ ('num_dwords', ctypes.c_uint32, 16),
342
+ ]
343
+
344
+ union_pm4_mec_release_mem_5._pack_ = 1 # source:False
345
+ union_pm4_mec_release_mem_5._fields_ = [
346
+ ('data_lo', ctypes.c_uint32),
347
+ ('cmp_data_lo', ctypes.c_uint32),
348
+ ('bitfields6c', struct_pm4_mec_release_mem_5_bitfields6c),
349
+ ('reserved14', ctypes.c_uint32),
350
+ ('ordinal6', ctypes.c_uint32),
351
+ ]
352
+
353
+ class union_pm4_mec_release_mem_6(Union):
354
+ pass
355
+
356
+ union_pm4_mec_release_mem_6._pack_ = 1 # source:False
357
+ union_pm4_mec_release_mem_6._fields_ = [
358
+ ('data_hi', ctypes.c_uint32),
359
+ ('cmp_data_hi', ctypes.c_uint32),
360
+ ('reserved15', ctypes.c_uint32),
361
+ ('reserved16', ctypes.c_uint32),
362
+ ('ordinal7', ctypes.c_uint32),
363
+ ]
364
+
365
+ struct_pm4_mec_release_mem._pack_ = 1 # source:False
366
+ struct_pm4_mec_release_mem._anonymous_ = ('_0', '_1', '_2', '_3', '_4', '_5', '_6',)
367
+ struct_pm4_mec_release_mem._fields_ = [
368
+ ('_0', union_pm4_mec_release_mem_0),
369
+ ('_1', union_pm4_mec_release_mem_1),
370
+ ('_2', union_pm4_mec_release_mem_2),
371
+ ('_3', union_pm4_mec_release_mem_3),
372
+ ('_4', union_pm4_mec_release_mem_4),
373
+ ('_5', union_pm4_mec_release_mem_5),
374
+ ('_6', union_pm4_mec_release_mem_6),
375
+ ('int_ctxid', ctypes.c_uint32),
376
+ ]
377
+
378
+
379
+ # values for enumeration 'WRITE_DATA_dst_sel_enum'
380
+ WRITE_DATA_dst_sel_enum__enumvalues = {
381
+ 0: 'dst_sel___write_data__mem_mapped_register',
382
+ 2: 'dst_sel___write_data__tc_l2',
383
+ 3: 'dst_sel___write_data__gds',
384
+ 5: 'dst_sel___write_data__memory',
385
+ 6: 'dst_sel___write_data__memory_mapped_adc_persistent_state',
386
+ }
387
+ dst_sel___write_data__mem_mapped_register = 0
388
+ dst_sel___write_data__tc_l2 = 2
389
+ dst_sel___write_data__gds = 3
390
+ dst_sel___write_data__memory = 5
391
+ dst_sel___write_data__memory_mapped_adc_persistent_state = 6
392
+ WRITE_DATA_dst_sel_enum = ctypes.c_uint32 # enum
393
+
394
+ # values for enumeration 'WRITE_DATA_addr_incr_enum'
395
+ WRITE_DATA_addr_incr_enum__enumvalues = {
396
+ 0: 'addr_incr___write_data__increment_address',
397
+ 1: 'addr_incr___write_data__do_not_increment_address',
398
+ }
399
+ addr_incr___write_data__increment_address = 0
400
+ addr_incr___write_data__do_not_increment_address = 1
401
+ WRITE_DATA_addr_incr_enum = ctypes.c_uint32 # enum
402
+
403
+ # values for enumeration 'WRITE_DATA_wr_confirm_enum'
404
+ WRITE_DATA_wr_confirm_enum__enumvalues = {
405
+ 0: 'wr_confirm___write_data__do_not_wait_for_write_confirmation',
406
+ 1: 'wr_confirm___write_data__wait_for_write_confirmation',
407
+ }
408
+ wr_confirm___write_data__do_not_wait_for_write_confirmation = 0
409
+ wr_confirm___write_data__wait_for_write_confirmation = 1
410
+ WRITE_DATA_wr_confirm_enum = ctypes.c_uint32 # enum
411
+
412
+ # values for enumeration 'WRITE_DATA_cache_policy_enum'
413
+ WRITE_DATA_cache_policy_enum__enumvalues = {
414
+ 0: 'cache_policy___write_data__lru',
415
+ 1: 'cache_policy___write_data__stream',
416
+ }
417
+ cache_policy___write_data__lru = 0
418
+ cache_policy___write_data__stream = 1
419
+ WRITE_DATA_cache_policy_enum = ctypes.c_uint32 # enum
420
+ class struct_pm4_mec_write_data_mmio(Structure):
421
+ pass
422
+
423
+ class union_pm4_mec_write_data_mmio_0(Union):
424
+ pass
425
+
426
+ union_pm4_mec_write_data_mmio_0._pack_ = 1 # source:False
427
+ union_pm4_mec_write_data_mmio_0._fields_ = [
428
+ ('header', union_PM4_MES_TYPE_3_HEADER),
429
+ ('ordinal1', ctypes.c_uint32),
430
+ ]
431
+
432
+ class union_pm4_mec_write_data_mmio_1(Union):
433
+ pass
434
+
435
+ class struct_pm4_mec_write_data_mmio_1_bitfields2(Structure):
436
+ pass
437
+
438
+ struct_pm4_mec_write_data_mmio_1_bitfields2._pack_ = 1 # source:False
439
+ struct_pm4_mec_write_data_mmio_1_bitfields2._fields_ = [
440
+ ('reserved1', ctypes.c_uint32, 8),
441
+ ('dst_sel', ctypes.c_uint32, 4),
442
+ ('reserved2', ctypes.c_uint32, 4),
443
+ ('addr_incr', ctypes.c_uint32, 1),
444
+ ('reserved3', ctypes.c_uint32, 2),
445
+ ('resume_vf', ctypes.c_uint32, 1),
446
+ ('wr_confirm', ctypes.c_uint32, 1),
447
+ ('reserved4', ctypes.c_uint32, 4),
448
+ ('cache_policy', ctypes.c_uint32, 2),
449
+ ('reserved5', ctypes.c_uint32, 5),
450
+ ]
451
+
452
+ union_pm4_mec_write_data_mmio_1._pack_ = 1 # source:False
453
+ union_pm4_mec_write_data_mmio_1._fields_ = [
454
+ ('bitfields2', struct_pm4_mec_write_data_mmio_1_bitfields2),
455
+ ('ordinal2', ctypes.c_uint32),
456
+ ]
457
+
458
+ class union_pm4_mec_write_data_mmio_2(Union):
459
+ pass
460
+
461
+ class struct_pm4_mec_write_data_mmio_2_bitfields3(Structure):
462
+ pass
463
+
464
+ struct_pm4_mec_write_data_mmio_2_bitfields3._pack_ = 1 # source:False
465
+ struct_pm4_mec_write_data_mmio_2_bitfields3._fields_ = [
466
+ ('dst_mmreg_addr', ctypes.c_uint32, 18),
467
+ ('reserved6', ctypes.c_uint32, 14),
468
+ ]
469
+
470
+ union_pm4_mec_write_data_mmio_2._pack_ = 1 # source:False
471
+ union_pm4_mec_write_data_mmio_2._fields_ = [
472
+ ('bitfields3', struct_pm4_mec_write_data_mmio_2_bitfields3),
473
+ ('ordinal3', ctypes.c_uint32),
474
+ ]
475
+
476
+ struct_pm4_mec_write_data_mmio._pack_ = 1 # source:False
477
+ struct_pm4_mec_write_data_mmio._anonymous_ = ('_0', '_1', '_2',)
478
+ struct_pm4_mec_write_data_mmio._fields_ = [
479
+ ('_0', union_pm4_mec_write_data_mmio_0),
480
+ ('_1', union_pm4_mec_write_data_mmio_1),
481
+ ('_2', union_pm4_mec_write_data_mmio_2),
482
+ ('reserved7', ctypes.c_uint32),
483
+ ('data', ctypes.c_uint32),
484
+ ]
485
+
486
+
487
+ # values for enumeration 'c__Ea_CACHE_FLUSH_AND_INV_TS_EVENT'
488
+ c__Ea_CACHE_FLUSH_AND_INV_TS_EVENT__enumvalues = {
489
+ 20: 'CACHE_FLUSH_AND_INV_TS_EVENT',
490
+ }
491
+ CACHE_FLUSH_AND_INV_TS_EVENT = 20
492
+ c__Ea_CACHE_FLUSH_AND_INV_TS_EVENT = ctypes.c_uint32 # enum
493
+ NVD_H = True # macro
494
+ PACKET_TYPE0 = 0 # macro
495
+ PACKET_TYPE1 = 1 # macro
496
+ PACKET_TYPE2 = 2 # macro
497
+ PACKET_TYPE3 = 3 # macro
498
+ def CP_PACKET_GET_TYPE(h): # macro
499
+ return (((h)>>30)&3)
500
+ def CP_PACKET_GET_COUNT(h): # macro
501
+ return (((h)>>16)&0x3FFF)
502
+ def CP_PACKET0_GET_REG(h): # macro
503
+ return ((h)&0xFFFF)
504
+ def CP_PACKET3_GET_OPCODE(h): # macro
505
+ return (((h)>>8)&0xFF)
506
+ def PACKET0(reg, n): # macro
507
+ return ((0<<30)|((reg)&0xFFFF)|((n)&0x3FFF)<<16)
508
+ CP_PACKET2 = 0x80000000 # macro
509
+ PACKET2_PAD_SHIFT = 0 # macro
510
+ PACKET2_PAD_MASK = (0x3fffffff<<0) # macro
511
+ # def PACKET2(v): # macro
512
+ # return (0x80000000|REG_SET(PACKET2_PAD,(v)))
513
+ def PACKET3(op, n): # macro
514
+ return ((3<<30)|(((op)&0xFF)<<8)|((n)&0x3FFF)<<16)
515
+ def PACKET3_COMPUTE(op, n): # macro
516
+ return (PACKET3(op,n)|1<<1)
517
+ PACKET3_NOP = 0x10 # macro
518
+ PACKET3_SET_BASE = 0x11 # macro
519
+ def PACKET3_BASE_INDEX(x): # macro
520
+ return ((x)<<0)
521
+ CE_PARTITION_BASE = 3 # macro
522
+ PACKET3_CLEAR_STATE = 0x12 # macro
523
+ PACKET3_INDEX_BUFFER_SIZE = 0x13 # macro
524
+ PACKET3_DISPATCH_DIRECT = 0x15 # macro
525
+ PACKET3_DISPATCH_INDIRECT = 0x16 # macro
526
+ PACKET3_INDIRECT_BUFFER_END = 0x17 # macro
527
+ PACKET3_INDIRECT_BUFFER_CNST_END = 0x19 # macro
528
+ PACKET3_ATOMIC_GDS = 0x1D # macro
529
+ PACKET3_ATOMIC_MEM = 0x1E # macro
530
+ PACKET3_OCCLUSION_QUERY = 0x1F # macro
531
+ PACKET3_SET_PREDICATION = 0x20 # macro
532
+ PACKET3_REG_RMW = 0x21 # macro
533
+ PACKET3_COND_EXEC = 0x22 # macro
534
+ PACKET3_PRED_EXEC = 0x23 # macro
535
+ PACKET3_DRAW_INDIRECT = 0x24 # macro
536
+ PACKET3_DRAW_INDEX_INDIRECT = 0x25 # macro
537
+ PACKET3_INDEX_BASE = 0x26 # macro
538
+ PACKET3_DRAW_INDEX_2 = 0x27 # macro
539
+ PACKET3_CONTEXT_CONTROL = 0x28 # macro
540
+ PACKET3_INDEX_TYPE = 0x2A # macro
541
+ PACKET3_DRAW_INDIRECT_MULTI = 0x2C # macro
542
+ PACKET3_DRAW_INDEX_AUTO = 0x2D # macro
543
+ PACKET3_NUM_INSTANCES = 0x2F # macro
544
+ PACKET3_DRAW_INDEX_MULTI_AUTO = 0x30 # macro
545
+ PACKET3_INDIRECT_BUFFER_PRIV = 0x32 # macro
546
+ PACKET3_INDIRECT_BUFFER_CNST = 0x33 # macro
547
+ PACKET3_COND_INDIRECT_BUFFER_CNST = 0x33 # macro
548
+ PACKET3_STRMOUT_BUFFER_UPDATE = 0x34 # macro
549
+ PACKET3_DRAW_INDEX_OFFSET_2 = 0x35 # macro
550
+ PACKET3_DRAW_PREAMBLE = 0x36 # macro
551
+ PACKET3_WRITE_DATA = 0x37 # macro
552
+ def WRITE_DATA_DST_SEL(x): # macro
553
+ return ((x)<<8)
554
+ WR_ONE_ADDR = (1<<16) # macro
555
+ WR_CONFIRM = (1<<20) # macro
556
+ def WRITE_DATA_CACHE_POLICY(x): # macro
557
+ return ((x)<<25)
558
+ def WRITE_DATA_ENGINE_SEL(x): # macro
559
+ return ((x)<<30)
560
+ PACKET3_DRAW_INDEX_INDIRECT_MULTI = 0x38 # macro
561
+ PACKET3_MEM_SEMAPHORE = 0x39 # macro
562
+ PACKET3_SEM_USE_MAILBOX = (0x1<<16) # macro
563
+ PACKET3_SEM_SEL_SIGNAL_TYPE = (0x1<<20) # macro
564
+ PACKET3_SEM_SEL_SIGNAL = (0x6<<29) # macro
565
+ PACKET3_SEM_SEL_WAIT = (0x7<<29) # macro
566
+ PACKET3_DRAW_INDEX_MULTI_INST = 0x3A # macro
567
+ PACKET3_COPY_DW = 0x3B # macro
568
+ PACKET3_WAIT_REG_MEM = 0x3C # macro
569
+ def WAIT_REG_MEM_FUNCTION(x): # macro
570
+ return ((x)<<0)
571
+ def WAIT_REG_MEM_MEM_SPACE(x): # macro
572
+ return ((x)<<4)
573
+ def WAIT_REG_MEM_OPERATION(x): # macro
574
+ return ((x)<<6)
575
+ def WAIT_REG_MEM_ENGINE(x): # macro
576
+ return ((x)<<8)
577
+ PACKET3_INDIRECT_BUFFER = 0x3F # macro
578
+ INDIRECT_BUFFER_VALID = (1<<23) # macro
579
+ def INDIRECT_BUFFER_CACHE_POLICY(x): # macro
580
+ return ((x)<<28)
581
+ def INDIRECT_BUFFER_PRE_ENB(x): # macro
582
+ return ((x)<<21)
583
+ def INDIRECT_BUFFER_PRE_RESUME(x): # macro
584
+ return ((x)<<30)
585
+ PACKET3_COND_INDIRECT_BUFFER = 0x3F # macro
586
+ PACKET3_COPY_DATA = 0x40 # macro
587
+ PACKET3_CP_DMA = 0x41 # macro
588
+ PACKET3_PFP_SYNC_ME = 0x42 # macro
589
+ PACKET3_SURFACE_SYNC = 0x43 # macro
590
+ PACKET3_ME_INITIALIZE = 0x44 # macro
591
+ PACKET3_COND_WRITE = 0x45 # macro
592
+ PACKET3_EVENT_WRITE = 0x46 # macro
593
+ def EVENT_TYPE(x): # macro
594
+ return ((x)<<0)
595
+ def EVENT_INDEX(x): # macro
596
+ return ((x)<<8)
597
+ PACKET3_EVENT_WRITE_EOP = 0x47 # macro
598
+ PACKET3_EVENT_WRITE_EOS = 0x48 # macro
599
+ PACKET3_RELEASE_MEM = 0x49 # macro
600
+ def PACKET3_RELEASE_MEM_EVENT_TYPE(x): # macro
601
+ return ((x)<<0)
602
+ def PACKET3_RELEASE_MEM_EVENT_INDEX(x): # macro
603
+ return ((x)<<8)
604
+ PACKET3_RELEASE_MEM_GCR_GLM_WB = (1<<12) # macro
605
+ PACKET3_RELEASE_MEM_GCR_GLM_INV = (1<<13) # macro
606
+ PACKET3_RELEASE_MEM_GCR_GLV_INV = (1<<14) # macro
607
+ PACKET3_RELEASE_MEM_GCR_GL1_INV = (1<<15) # macro
608
+ PACKET3_RELEASE_MEM_GCR_GL2_US = (1<<16) # macro
609
+ PACKET3_RELEASE_MEM_GCR_GL2_RANGE = (1<<17) # macro
610
+ PACKET3_RELEASE_MEM_GCR_GL2_DISCARD = (1<<19) # macro
611
+ PACKET3_RELEASE_MEM_GCR_GL2_INV = (1<<20) # macro
612
+ PACKET3_RELEASE_MEM_GCR_GL2_WB = (1<<21) # macro
613
+ PACKET3_RELEASE_MEM_GCR_SEQ = (1<<22) # macro
614
+ def PACKET3_RELEASE_MEM_CACHE_POLICY(x): # macro
615
+ return ((x)<<25)
616
+ PACKET3_RELEASE_MEM_EXECUTE = (1<<28) # macro
617
+ def PACKET3_RELEASE_MEM_DATA_SEL(x): # macro
618
+ return ((x)<<29)
619
+ def PACKET3_RELEASE_MEM_INT_SEL(x): # macro
620
+ return ((x)<<24)
621
+ def PACKET3_RELEASE_MEM_DST_SEL(x): # macro
622
+ return ((x)<<16)
623
+ PACKET3_PREAMBLE_CNTL = 0x4A # macro
624
+ PACKET3_PREAMBLE_BEGIN_CLEAR_STATE = (2<<28) # macro
625
+ PACKET3_PREAMBLE_END_CLEAR_STATE = (3<<28) # macro
626
+ PACKET3_DMA_DATA = 0x50 # macro
627
+ def PACKET3_DMA_DATA_ENGINE(x): # macro
628
+ return ((x)<<0)
629
+ def PACKET3_DMA_DATA_SRC_CACHE_POLICY(x): # macro
630
+ return ((x)<<13)
631
+ def PACKET3_DMA_DATA_DST_SEL(x): # macro
632
+ return ((x)<<20)
633
+ def PACKET3_DMA_DATA_DST_CACHE_POLICY(x): # macro
634
+ return ((x)<<25)
635
+ def PACKET3_DMA_DATA_SRC_SEL(x): # macro
636
+ return ((x)<<29)
637
+ PACKET3_DMA_DATA_CP_SYNC = (1<<31) # macro
638
+ PACKET3_DMA_DATA_CMD_SAS = (1<<26) # macro
639
+ PACKET3_DMA_DATA_CMD_DAS = (1<<27) # macro
640
+ PACKET3_DMA_DATA_CMD_SAIC = (1<<28) # macro
641
+ PACKET3_DMA_DATA_CMD_DAIC = (1<<29) # macro
642
+ PACKET3_DMA_DATA_CMD_RAW_WAIT = (1<<30) # macro
643
+ PACKET3_CONTEXT_REG_RMW = 0x51 # macro
644
+ PACKET3_GFX_CNTX_UPDATE = 0x52 # macro
645
+ PACKET3_BLK_CNTX_UPDATE = 0x53 # macro
646
+ PACKET3_INCR_UPDT_STATE = 0x55 # macro
647
+ PACKET3_ACQUIRE_MEM = 0x58 # macro
648
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLI_INV(x): # macro
649
+ return ((x)<<0)
650
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL1_RANGE(x): # macro
651
+ return ((x)<<2)
652
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLM_WB(x): # macro
653
+ return ((x)<<4)
654
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLM_INV(x): # macro
655
+ return ((x)<<5)
656
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLK_WB(x): # macro
657
+ return ((x)<<6)
658
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLK_INV(x): # macro
659
+ return ((x)<<7)
660
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GLV_INV(x): # macro
661
+ return ((x)<<8)
662
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL1_INV(x): # macro
663
+ return ((x)<<9)
664
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL2_US(x): # macro
665
+ return ((x)<<10)
666
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL2_RANGE(x): # macro
667
+ return ((x)<<11)
668
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL2_DISCARD(x): # macro
669
+ return ((x)<<13)
670
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL2_INV(x): # macro
671
+ return ((x)<<14)
672
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_GL2_WB(x): # macro
673
+ return ((x)<<15)
674
+ def PACKET3_ACQUIRE_MEM_GCR_CNTL_SEQ(x): # macro
675
+ return ((x)<<16)
676
+ PACKET3_ACQUIRE_MEM_GCR_RANGE_IS_PA = (1<<18) # macro
677
+ PACKET3_REWIND = 0x59 # macro
678
+ PACKET3_INTERRUPT = 0x5A # macro
679
+ PACKET3_GEN_PDEPTE = 0x5B # macro
680
+ PACKET3_INDIRECT_BUFFER_PASID = 0x5C # macro
681
+ PACKET3_PRIME_UTCL2 = 0x5D # macro
682
+ PACKET3_LOAD_UCONFIG_REG = 0x5E # macro
683
+ PACKET3_LOAD_SH_REG = 0x5F # macro
684
+ PACKET3_LOAD_CONFIG_REG = 0x60 # macro
685
+ PACKET3_LOAD_CONTEXT_REG = 0x61 # macro
686
+ PACKET3_LOAD_COMPUTE_STATE = 0x62 # macro
687
+ PACKET3_LOAD_SH_REG_INDEX = 0x63 # macro
688
+ PACKET3_SET_CONFIG_REG = 0x68 # macro
689
+ PACKET3_SET_CONFIG_REG_START = 0x00002000 # macro
690
+ PACKET3_SET_CONFIG_REG_END = 0x00002c00 # macro
691
+ PACKET3_SET_CONTEXT_REG = 0x69 # macro
692
+ PACKET3_SET_CONTEXT_REG_START = 0x0000a000 # macro
693
+ PACKET3_SET_CONTEXT_REG_END = 0x0000a400 # macro
694
+ PACKET3_SET_CONTEXT_REG_INDEX = 0x6A # macro
695
+ PACKET3_SET_VGPR_REG_DI_MULTI = 0x71 # macro
696
+ PACKET3_SET_SH_REG_DI = 0x72 # macro
697
+ PACKET3_SET_CONTEXT_REG_INDIRECT = 0x73 # macro
698
+ PACKET3_SET_SH_REG_DI_MULTI = 0x74 # macro
699
+ PACKET3_GFX_PIPE_LOCK = 0x75 # macro
700
+ PACKET3_SET_SH_REG = 0x76 # macro
701
+ PACKET3_SET_SH_REG_START = 0x00002c00 # macro
702
+ PACKET3_SET_SH_REG_END = 0x00003000 # macro
703
+ PACKET3_SET_SH_REG_OFFSET = 0x77 # macro
704
+ PACKET3_SET_QUEUE_REG = 0x78 # macro
705
+ PACKET3_SET_UCONFIG_REG = 0x79 # macro
706
+ PACKET3_SET_UCONFIG_REG_START = 0x0000c000 # macro
707
+ PACKET3_SET_UCONFIG_REG_END = 0x0000c400 # macro
708
+ PACKET3_SET_UCONFIG_REG_INDEX = 0x7A # macro
709
+ PACKET3_FORWARD_HEADER = 0x7C # macro
710
+ PACKET3_SCRATCH_RAM_WRITE = 0x7D # macro
711
+ PACKET3_SCRATCH_RAM_READ = 0x7E # macro
712
+ PACKET3_LOAD_CONST_RAM = 0x80 # macro
713
+ PACKET3_WRITE_CONST_RAM = 0x81 # macro
714
+ PACKET3_DUMP_CONST_RAM = 0x83 # macro
715
+ PACKET3_INCREMENT_CE_COUNTER = 0x84 # macro
716
+ PACKET3_INCREMENT_DE_COUNTER = 0x85 # macro
717
+ PACKET3_WAIT_ON_CE_COUNTER = 0x86 # macro
718
+ PACKET3_WAIT_ON_DE_COUNTER_DIFF = 0x88 # macro
719
+ PACKET3_SWITCH_BUFFER = 0x8B # macro
720
+ PACKET3_DISPATCH_DRAW_PREAMBLE = 0x8C # macro
721
+ PACKET3_DISPATCH_DRAW_PREAMBLE_ACE = 0x8C # macro
722
+ PACKET3_DISPATCH_DRAW = 0x8D # macro
723
+ PACKET3_DISPATCH_DRAW_ACE = 0x8D # macro
724
+ PACKET3_GET_LOD_STATS = 0x8E # macro
725
+ PACKET3_DRAW_MULTI_PREAMBLE = 0x8F # macro
726
+ PACKET3_FRAME_CONTROL = 0x90 # macro
727
+ FRAME_TMZ = (1<<0) # macro
728
+ def FRAME_CMD(x): # macro
729
+ return ((x)<<28)
730
+ PACKET3_INDEX_ATTRIBUTES_INDIRECT = 0x91 # macro
731
+ PACKET3_WAIT_REG_MEM64 = 0x93 # macro
732
+ PACKET3_COND_PREEMPT = 0x94 # macro
733
+ PACKET3_HDP_FLUSH = 0x95 # macro
734
+ PACKET3_COPY_DATA_RB = 0x96 # macro
735
+ PACKET3_INVALIDATE_TLBS = 0x98 # macro
736
+ def PACKET3_INVALIDATE_TLBS_DST_SEL(x): # macro
737
+ return ((x)<<0)
738
+ def PACKET3_INVALIDATE_TLBS_ALL_HUB(x): # macro
739
+ return ((x)<<4)
740
+ def PACKET3_INVALIDATE_TLBS_PASID(x): # macro
741
+ return ((x)<<5)
742
+ PACKET3_AQL_PACKET = 0x99 # macro
743
+ PACKET3_DMA_DATA_FILL_MULTI = 0x9A # macro
744
+ PACKET3_SET_SH_REG_INDEX = 0x9B # macro
745
+ PACKET3_DRAW_INDIRECT_COUNT_MULTI = 0x9C # macro
746
+ PACKET3_DRAW_INDEX_INDIRECT_COUNT_MULTI = 0x9D # macro
747
+ PACKET3_DUMP_CONST_RAM_OFFSET = 0x9E # macro
748
+ PACKET3_LOAD_CONTEXT_REG_INDEX = 0x9F # macro
749
+ PACKET3_SET_RESOURCES = 0xA0 # macro
750
+ def PACKET3_SET_RESOURCES_VMID_MASK(x): # macro
751
+ return ((x)<<0)
752
+ def PACKET3_SET_RESOURCES_UNMAP_LATENTY(x): # macro
753
+ return ((x)<<16)
754
+ def PACKET3_SET_RESOURCES_QUEUE_TYPE(x): # macro
755
+ return ((x)<<29)
756
+ PACKET3_MAP_PROCESS = 0xA1 # macro
757
+ PACKET3_MAP_QUEUES = 0xA2 # macro
758
+ def PACKET3_MAP_QUEUES_QUEUE_SEL(x): # macro
759
+ return ((x)<<4)
760
+ def PACKET3_MAP_QUEUES_VMID(x): # macro
761
+ return ((x)<<8)
762
+ def PACKET3_MAP_QUEUES_QUEUE(x): # macro
763
+ return ((x)<<13)
764
+ def PACKET3_MAP_QUEUES_PIPE(x): # macro
765
+ return ((x)<<16)
766
+ def PACKET3_MAP_QUEUES_ME(x): # macro
767
+ return ((x)<<18)
768
+ def PACKET3_MAP_QUEUES_QUEUE_TYPE(x): # macro
769
+ return ((x)<<21)
770
+ def PACKET3_MAP_QUEUES_ALLOC_FORMAT(x): # macro
771
+ return ((x)<<24)
772
+ def PACKET3_MAP_QUEUES_ENGINE_SEL(x): # macro
773
+ return ((x)<<26)
774
+ def PACKET3_MAP_QUEUES_NUM_QUEUES(x): # macro
775
+ return ((x)<<29)
776
+ def PACKET3_MAP_QUEUES_CHECK_DISABLE(x): # macro
777
+ return ((x)<<1)
778
+ def PACKET3_MAP_QUEUES_DOORBELL_OFFSET(x): # macro
779
+ return ((x)<<2)
780
+ PACKET3_UNMAP_QUEUES = 0xA3 # macro
781
+ def PACKET3_UNMAP_QUEUES_ACTION(x): # macro
782
+ return ((x)<<0)
783
+ def PACKET3_UNMAP_QUEUES_QUEUE_SEL(x): # macro
784
+ return ((x)<<4)
785
+ def PACKET3_UNMAP_QUEUES_ENGINE_SEL(x): # macro
786
+ return ((x)<<26)
787
+ def PACKET3_UNMAP_QUEUES_NUM_QUEUES(x): # macro
788
+ return ((x)<<29)
789
+ def PACKET3_UNMAP_QUEUES_PASID(x): # macro
790
+ return ((x)<<0)
791
+ def PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET0(x): # macro
792
+ return ((x)<<2)
793
+ def PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET1(x): # macro
794
+ return ((x)<<2)
795
+ def PACKET3_UNMAP_QUEUES_RB_WPTR(x): # macro
796
+ return ((x)<<0)
797
+ def PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET2(x): # macro
798
+ return ((x)<<2)
799
+ def PACKET3_UNMAP_QUEUES_DOORBELL_OFFSET3(x): # macro
800
+ return ((x)<<2)
801
+ PACKET3_QUERY_STATUS = 0xA4 # macro
802
+ def PACKET3_QUERY_STATUS_CONTEXT_ID(x): # macro
803
+ return ((x)<<0)
804
+ def PACKET3_QUERY_STATUS_INTERRUPT_SEL(x): # macro
805
+ return ((x)<<28)
806
+ def PACKET3_QUERY_STATUS_COMMAND(x): # macro
807
+ return ((x)<<30)
808
+ def PACKET3_QUERY_STATUS_PASID(x): # macro
809
+ return ((x)<<0)
810
+ def PACKET3_QUERY_STATUS_DOORBELL_OFFSET(x): # macro
811
+ return ((x)<<2)
812
+ def PACKET3_QUERY_STATUS_ENG_SEL(x): # macro
813
+ return ((x)<<25)
814
+ PACKET3_RUN_LIST = 0xA5 # macro
815
+ PACKET3_MAP_PROCESS_VM = 0xA6 # macro
816
+ PACKET3_SET_Q_PREEMPTION_MODE = 0xF0 # macro
817
+ def PACKET3_SET_Q_PREEMPTION_MODE_IB_VMID(x): # macro
818
+ return ((x)<<0)
819
+ PACKET3_SET_Q_PREEMPTION_MODE_INIT_SHADOW_MEM = (1<<0) # macro
820
+ __all__ = \
821
+ ['CACHE_FLUSH_AND_INV_TS_EVENT', 'CE_PARTITION_BASE',
822
+ 'CP_PACKET2', 'F32_MES_PM4_PACKETS_H', 'FRAME_TMZ',
823
+ 'INDIRECT_BUFFER_VALID', 'NVD_H', 'PACKET2_PAD_MASK',
824
+ 'PACKET2_PAD_SHIFT', 'PACKET3_ACQUIRE_MEM',
825
+ 'PACKET3_ACQUIRE_MEM_GCR_RANGE_IS_PA', 'PACKET3_AQL_PACKET',
826
+ 'PACKET3_ATOMIC_GDS', 'PACKET3_ATOMIC_MEM',
827
+ 'PACKET3_BLK_CNTX_UPDATE', 'PACKET3_CLEAR_STATE',
828
+ 'PACKET3_COND_EXEC', 'PACKET3_COND_INDIRECT_BUFFER',
829
+ 'PACKET3_COND_INDIRECT_BUFFER_CNST', 'PACKET3_COND_PREEMPT',
830
+ 'PACKET3_COND_WRITE', 'PACKET3_CONTEXT_CONTROL',
831
+ 'PACKET3_CONTEXT_REG_RMW', 'PACKET3_COPY_DATA',
832
+ 'PACKET3_COPY_DATA_RB', 'PACKET3_COPY_DW', 'PACKET3_CP_DMA',
833
+ 'PACKET3_DISPATCH_DIRECT', 'PACKET3_DISPATCH_DRAW',
834
+ 'PACKET3_DISPATCH_DRAW_ACE', 'PACKET3_DISPATCH_DRAW_PREAMBLE',
835
+ 'PACKET3_DISPATCH_DRAW_PREAMBLE_ACE', 'PACKET3_DISPATCH_INDIRECT',
836
+ 'PACKET3_DMA_DATA', 'PACKET3_DMA_DATA_CMD_DAIC',
837
+ 'PACKET3_DMA_DATA_CMD_DAS', 'PACKET3_DMA_DATA_CMD_RAW_WAIT',
838
+ 'PACKET3_DMA_DATA_CMD_SAIC', 'PACKET3_DMA_DATA_CMD_SAS',
839
+ 'PACKET3_DMA_DATA_CP_SYNC', 'PACKET3_DMA_DATA_FILL_MULTI',
840
+ 'PACKET3_DRAW_INDEX_2', 'PACKET3_DRAW_INDEX_AUTO',
841
+ 'PACKET3_DRAW_INDEX_INDIRECT',
842
+ 'PACKET3_DRAW_INDEX_INDIRECT_COUNT_MULTI',
843
+ 'PACKET3_DRAW_INDEX_INDIRECT_MULTI',
844
+ 'PACKET3_DRAW_INDEX_MULTI_AUTO', 'PACKET3_DRAW_INDEX_MULTI_INST',
845
+ 'PACKET3_DRAW_INDEX_OFFSET_2', 'PACKET3_DRAW_INDIRECT',
846
+ 'PACKET3_DRAW_INDIRECT_COUNT_MULTI',
847
+ 'PACKET3_DRAW_INDIRECT_MULTI', 'PACKET3_DRAW_MULTI_PREAMBLE',
848
+ 'PACKET3_DRAW_PREAMBLE', 'PACKET3_DUMP_CONST_RAM',
849
+ 'PACKET3_DUMP_CONST_RAM_OFFSET', 'PACKET3_EVENT_WRITE',
850
+ 'PACKET3_EVENT_WRITE_EOP', 'PACKET3_EVENT_WRITE_EOS',
851
+ 'PACKET3_FORWARD_HEADER', 'PACKET3_FRAME_CONTROL',
852
+ 'PACKET3_GEN_PDEPTE', 'PACKET3_GET_LOD_STATS',
853
+ 'PACKET3_GFX_CNTX_UPDATE', 'PACKET3_GFX_PIPE_LOCK',
854
+ 'PACKET3_HDP_FLUSH', 'PACKET3_INCREMENT_CE_COUNTER',
855
+ 'PACKET3_INCREMENT_DE_COUNTER', 'PACKET3_INCR_UPDT_STATE',
856
+ 'PACKET3_INDEX_ATTRIBUTES_INDIRECT', 'PACKET3_INDEX_BASE',
857
+ 'PACKET3_INDEX_BUFFER_SIZE', 'PACKET3_INDEX_TYPE',
858
+ 'PACKET3_INDIRECT_BUFFER', 'PACKET3_INDIRECT_BUFFER_CNST',
859
+ 'PACKET3_INDIRECT_BUFFER_CNST_END', 'PACKET3_INDIRECT_BUFFER_END',
860
+ 'PACKET3_INDIRECT_BUFFER_PASID', 'PACKET3_INDIRECT_BUFFER_PRIV',
861
+ 'PACKET3_INTERRUPT', 'PACKET3_INVALIDATE_TLBS',
862
+ 'PACKET3_LOAD_COMPUTE_STATE', 'PACKET3_LOAD_CONFIG_REG',
863
+ 'PACKET3_LOAD_CONST_RAM', 'PACKET3_LOAD_CONTEXT_REG',
864
+ 'PACKET3_LOAD_CONTEXT_REG_INDEX', 'PACKET3_LOAD_SH_REG',
865
+ 'PACKET3_LOAD_SH_REG_INDEX', 'PACKET3_LOAD_UCONFIG_REG',
866
+ 'PACKET3_MAP_PROCESS', 'PACKET3_MAP_PROCESS_VM',
867
+ 'PACKET3_MAP_QUEUES', 'PACKET3_MEM_SEMAPHORE',
868
+ 'PACKET3_ME_INITIALIZE', 'PACKET3_NOP', 'PACKET3_NUM_INSTANCES',
869
+ 'PACKET3_OCCLUSION_QUERY', 'PACKET3_PFP_SYNC_ME',
870
+ 'PACKET3_PREAMBLE_BEGIN_CLEAR_STATE', 'PACKET3_PREAMBLE_CNTL',
871
+ 'PACKET3_PREAMBLE_END_CLEAR_STATE', 'PACKET3_PRED_EXEC',
872
+ 'PACKET3_PRIME_UTCL2', 'PACKET3_QUERY_STATUS', 'PACKET3_REG_RMW',
873
+ 'PACKET3_RELEASE_MEM', 'PACKET3_RELEASE_MEM_EXECUTE',
874
+ 'PACKET3_RELEASE_MEM_GCR_GL1_INV',
875
+ 'PACKET3_RELEASE_MEM_GCR_GL2_DISCARD',
876
+ 'PACKET3_RELEASE_MEM_GCR_GL2_INV',
877
+ 'PACKET3_RELEASE_MEM_GCR_GL2_RANGE',
878
+ 'PACKET3_RELEASE_MEM_GCR_GL2_US',
879
+ 'PACKET3_RELEASE_MEM_GCR_GL2_WB',
880
+ 'PACKET3_RELEASE_MEM_GCR_GLM_INV',
881
+ 'PACKET3_RELEASE_MEM_GCR_GLM_WB',
882
+ 'PACKET3_RELEASE_MEM_GCR_GLV_INV', 'PACKET3_RELEASE_MEM_GCR_SEQ',
883
+ 'PACKET3_REWIND', 'PACKET3_RUN_LIST', 'PACKET3_SCRATCH_RAM_READ',
884
+ 'PACKET3_SCRATCH_RAM_WRITE', 'PACKET3_SEM_SEL_SIGNAL',
885
+ 'PACKET3_SEM_SEL_SIGNAL_TYPE', 'PACKET3_SEM_SEL_WAIT',
886
+ 'PACKET3_SEM_USE_MAILBOX', 'PACKET3_SET_BASE',
887
+ 'PACKET3_SET_CONFIG_REG', 'PACKET3_SET_CONFIG_REG_END',
888
+ 'PACKET3_SET_CONFIG_REG_START', 'PACKET3_SET_CONTEXT_REG',
889
+ 'PACKET3_SET_CONTEXT_REG_END', 'PACKET3_SET_CONTEXT_REG_INDEX',
890
+ 'PACKET3_SET_CONTEXT_REG_INDIRECT',
891
+ 'PACKET3_SET_CONTEXT_REG_START', 'PACKET3_SET_PREDICATION',
892
+ 'PACKET3_SET_QUEUE_REG', 'PACKET3_SET_Q_PREEMPTION_MODE',
893
+ 'PACKET3_SET_Q_PREEMPTION_MODE_INIT_SHADOW_MEM',
894
+ 'PACKET3_SET_RESOURCES', 'PACKET3_SET_SH_REG',
895
+ 'PACKET3_SET_SH_REG_DI', 'PACKET3_SET_SH_REG_DI_MULTI',
896
+ 'PACKET3_SET_SH_REG_END', 'PACKET3_SET_SH_REG_INDEX',
897
+ 'PACKET3_SET_SH_REG_OFFSET', 'PACKET3_SET_SH_REG_START',
898
+ 'PACKET3_SET_UCONFIG_REG', 'PACKET3_SET_UCONFIG_REG_END',
899
+ 'PACKET3_SET_UCONFIG_REG_INDEX', 'PACKET3_SET_UCONFIG_REG_START',
900
+ 'PACKET3_SET_VGPR_REG_DI_MULTI', 'PACKET3_STRMOUT_BUFFER_UPDATE',
901
+ 'PACKET3_SURFACE_SYNC', 'PACKET3_SWITCH_BUFFER',
902
+ 'PACKET3_UNMAP_QUEUES', 'PACKET3_WAIT_ON_CE_COUNTER',
903
+ 'PACKET3_WAIT_ON_DE_COUNTER_DIFF', 'PACKET3_WAIT_REG_MEM',
904
+ 'PACKET3_WAIT_REG_MEM64', 'PACKET3_WRITE_CONST_RAM',
905
+ 'PACKET3_WRITE_DATA', 'PACKET_TYPE0', 'PACKET_TYPE1',
906
+ 'PACKET_TYPE2', 'PACKET_TYPE3', 'PM4_MEC_RELEASE_MEM_DEFINED',
907
+ 'PM4_MEC_WRITE_DATA_DEFINED', 'PM4_MES_HEADER_DEFINED',
908
+ 'WRITE_DATA_addr_incr_enum', 'WRITE_DATA_cache_policy_enum',
909
+ 'WRITE_DATA_dst_sel_enum', 'WRITE_DATA_wr_confirm_enum',
910
+ 'WR_CONFIRM', 'WR_ONE_ADDR',
911
+ 'addr_incr___write_data__do_not_increment_address',
912
+ 'addr_incr___write_data__increment_address',
913
+ 'c__Ea_CACHE_FLUSH_AND_INV_TS_EVENT', 'c_uint32', 'c_uint32',
914
+ 'c_uint32', 'c_uint32', 'c_uint32', 'c_uint32',
915
+ 'cache_policy___write_data__lru',
916
+ 'cache_policy___write_data__stream',
917
+ 'cache_policy__mec_release_mem__lru',
918
+ 'cache_policy__mec_release_mem__stream',
919
+ 'data_sel__mec_release_mem__none',
920
+ 'data_sel__mec_release_mem__send_32_bit_low',
921
+ 'data_sel__mec_release_mem__send_64_bit_data',
922
+ 'data_sel__mec_release_mem__send_cp_perfcounter_hi_lo',
923
+ 'data_sel__mec_release_mem__send_gpu_clock_counter',
924
+ 'data_sel__mec_release_mem__store_gds_data_to_memory',
925
+ 'dst_sel___write_data__gds',
926
+ 'dst_sel___write_data__mem_mapped_register',
927
+ 'dst_sel___write_data__memory',
928
+ 'dst_sel___write_data__memory_mapped_adc_persistent_state',
929
+ 'dst_sel___write_data__tc_l2',
930
+ 'dst_sel__mec_release_mem__memory_controller',
931
+ 'dst_sel__mec_release_mem__queue_write_pointer_poll_mask_bit',
932
+ 'dst_sel__mec_release_mem__queue_write_pointer_register',
933
+ 'dst_sel__mec_release_mem__tc_l2',
934
+ 'event_index__mec_release_mem__end_of_pipe',
935
+ 'event_index__mec_release_mem__shader_done', 'int32_t',
936
+ 'int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_32_bit_compare',
937
+ 'int_sel__mec_release_mem__conditionally_send_int_ctxid_based_on_64_bit_compare',
938
+ 'int_sel__mec_release_mem__none',
939
+ 'int_sel__mec_release_mem__send_data_after_write_confirm',
940
+ 'int_sel__mec_release_mem__send_interrupt_after_write_confirm',
941
+ 'int_sel__mec_release_mem__send_interrupt_only',
942
+ 'int_sel__mec_release_mem__unconditionally_send_int_ctxid',
943
+ 'pq_exe_status__mec_release_mem__default',
944
+ 'pq_exe_status__mec_release_mem__phase_update',
945
+ 'struct_PM4_MES_TYPE_3_HEADER_0', 'struct_pm4_mec_release_mem',
946
+ 'struct_pm4_mec_release_mem_1_bitfields2',
947
+ 'struct_pm4_mec_release_mem_2_bitfields3',
948
+ 'struct_pm4_mec_release_mem_3_bitfields4',
949
+ 'struct_pm4_mec_release_mem_3_bitfields4b',
950
+ 'struct_pm4_mec_release_mem_5_bitfields6c',
951
+ 'struct_pm4_mec_write_data_mmio',
952
+ 'struct_pm4_mec_write_data_mmio_1_bitfields2',
953
+ 'struct_pm4_mec_write_data_mmio_2_bitfields3', 'uint32_t',
954
+ 'union_PM4_MES_TYPE_3_HEADER', 'union_pm4_mec_release_mem_0',
955
+ 'union_pm4_mec_release_mem_1', 'union_pm4_mec_release_mem_2',
956
+ 'union_pm4_mec_release_mem_3', 'union_pm4_mec_release_mem_4',
957
+ 'union_pm4_mec_release_mem_5', 'union_pm4_mec_release_mem_6',
958
+ 'union_pm4_mec_write_data_mmio_0',
959
+ 'union_pm4_mec_write_data_mmio_1',
960
+ 'union_pm4_mec_write_data_mmio_2',
961
+ 'wr_confirm___write_data__do_not_wait_for_write_confirmation',
962
+ 'wr_confirm___write_data__wait_for_write_confirmation']