tinygrad 0.8.0__py3-none-any.whl → 0.9.1__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.
- tinygrad/__init__.py +6 -6
- tinygrad/codegen/__init__.py +0 -0
- tinygrad/codegen/kernel.py +253 -225
- tinygrad/codegen/linearizer.py +398 -436
- tinygrad/codegen/uops.py +451 -0
- tinygrad/device.py +268 -274
- tinygrad/dtype.py +56 -40
- tinygrad/engine/__init__.py +0 -0
- tinygrad/engine/graph.py +100 -0
- tinygrad/engine/jit.py +198 -0
- tinygrad/engine/realize.py +192 -0
- tinygrad/engine/schedule.py +370 -0
- tinygrad/engine/search.py +199 -0
- tinygrad/{mlops.py → function.py} +40 -32
- tinygrad/helpers.py +144 -46
- tinygrad/lazy.py +143 -242
- tinygrad/multi.py +173 -0
- tinygrad/nn/__init__.py +180 -9
- tinygrad/nn/datasets.py +8 -0
- tinygrad/nn/optim.py +106 -28
- tinygrad/nn/state.py +87 -19
- tinygrad/ops.py +104 -45
- tinygrad/renderer/__init__.py +65 -0
- tinygrad/renderer/assembly.py +269 -0
- tinygrad/renderer/cstyle.py +308 -210
- tinygrad/renderer/llvmir.py +119 -124
- tinygrad/runtime/__init__.py +0 -0
- tinygrad/runtime/autogen/amd_gpu.py +13403 -0
- tinygrad/runtime/autogen/comgr.py +891 -0
- tinygrad/runtime/autogen/cuda.py +5923 -0
- tinygrad/runtime/autogen/hip.py +5909 -0
- tinygrad/runtime/autogen/hsa.py +5893 -0
- tinygrad/runtime/autogen/io_uring.py +1486 -0
- tinygrad/runtime/autogen/kfd.py +812 -0
- tinygrad/runtime/autogen/nv_gpu.py +33597 -0
- tinygrad/runtime/autogen/opencl.py +1795 -0
- tinygrad/runtime/driver/__init__.py +0 -0
- tinygrad/runtime/driver/hip_comgr.py +56 -0
- tinygrad/runtime/graph/__init__.py +0 -0
- tinygrad/runtime/graph/clang.py +39 -0
- tinygrad/runtime/graph/cuda.py +59 -54
- tinygrad/runtime/graph/hcq.py +187 -0
- tinygrad/runtime/graph/metal.py +37 -41
- tinygrad/runtime/ops_amd.py +550 -0
- tinygrad/runtime/ops_clang.py +16 -14
- tinygrad/runtime/ops_cuda.py +129 -37
- tinygrad/runtime/ops_disk.py +111 -43
- tinygrad/runtime/ops_gpu.py +52 -50
- tinygrad/runtime/ops_llvm.py +36 -56
- tinygrad/runtime/ops_metal.py +41 -24
- tinygrad/runtime/ops_npy.py +9 -0
- tinygrad/runtime/ops_nv.py +625 -0
- tinygrad/runtime/ops_python.py +208 -0
- tinygrad/shape/__init__.py +0 -0
- tinygrad/shape/shapetracker.py +46 -107
- tinygrad/shape/symbolic.py +99 -98
- tinygrad/shape/view.py +162 -45
- tinygrad/tensor.py +2492 -483
- {tinygrad-0.8.0.dist-info → tinygrad-0.9.1.dist-info}/LICENSE +1 -1
- {tinygrad-0.8.0.dist-info → tinygrad-0.9.1.dist-info}/METADATA +31 -13
- tinygrad-0.9.1.dist-info/RECORD +63 -0
- {tinygrad-0.8.0.dist-info → tinygrad-0.9.1.dist-info}/WHEEL +1 -1
- tinygrad/features/image.py +0 -93
- tinygrad/features/multi.py +0 -103
- tinygrad/features/search.py +0 -160
- tinygrad/graph.py +0 -106
- tinygrad/jit.py +0 -152
- tinygrad/realize.py +0 -50
- tinygrad/runtime/graph/hip.py +0 -24
- tinygrad/runtime/ops_cpu.py +0 -45
- tinygrad/runtime/ops_hip.py +0 -97
- tinygrad/runtime/ops_torch.py +0 -49
- tinygrad-0.8.0.dist-info/RECORD +0 -41
- {tinygrad-0.8.0.dist-info → tinygrad-0.9.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,891 @@
|
|
1
|
+
# mypy: ignore-errors
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
#
|
4
|
+
# TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include', '-x', 'c++']
|
5
|
+
# WORD_SIZE is: 8
|
6
|
+
# POINTER_SIZE is: 8
|
7
|
+
# LONGDOUBLE_SIZE is: 16
|
8
|
+
#
|
9
|
+
import ctypes, ctypes.util, os
|
10
|
+
PATHS_TO_TRY = [
|
11
|
+
'/opt/rocm/lib/libamd_comgr.so',
|
12
|
+
os.getenv('ROCM_PATH', '')+'/lib/libamd_comgr.so',
|
13
|
+
]
|
14
|
+
def _try_dlopen_amd_comgr():
|
15
|
+
library = ctypes.util.find_library("amd_comgr")
|
16
|
+
if library: return ctypes.CDLL(library)
|
17
|
+
for candidate in PATHS_TO_TRY:
|
18
|
+
try: return ctypes.CDLL(candidate)
|
19
|
+
except OSError: pass
|
20
|
+
raise RuntimeError("library amd_comgr not found")
|
21
|
+
|
22
|
+
|
23
|
+
def string_cast(char_pointer, encoding='utf-8', errors='strict'):
|
24
|
+
value = ctypes.cast(char_pointer, ctypes.c_char_p).value
|
25
|
+
if value is not None and encoding is not None:
|
26
|
+
value = value.decode(encoding, errors=errors)
|
27
|
+
return value
|
28
|
+
|
29
|
+
|
30
|
+
def char_pointer_cast(string, encoding='utf-8'):
|
31
|
+
if encoding is not None:
|
32
|
+
try:
|
33
|
+
string = string.encode(encoding)
|
34
|
+
except AttributeError:
|
35
|
+
# In Python3, bytes has no encode attribute
|
36
|
+
pass
|
37
|
+
string = ctypes.c_char_p(string)
|
38
|
+
return ctypes.cast(string, ctypes.POINTER(ctypes.c_char))
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
_libraries = {}
|
43
|
+
_libraries['libamd_comgr.so'] = _try_dlopen_amd_comgr()
|
44
|
+
c_int128 = ctypes.c_ubyte*16
|
45
|
+
c_uint128 = c_int128
|
46
|
+
void = None
|
47
|
+
if ctypes.sizeof(ctypes.c_longdouble) == 16:
|
48
|
+
c_long_double_t = ctypes.c_longdouble
|
49
|
+
else:
|
50
|
+
c_long_double_t = ctypes.c_ubyte*16
|
51
|
+
|
52
|
+
class AsDictMixin:
|
53
|
+
@classmethod
|
54
|
+
def as_dict(cls, self):
|
55
|
+
result = {}
|
56
|
+
if not isinstance(self, AsDictMixin):
|
57
|
+
# not a structure, assume it's already a python object
|
58
|
+
return self
|
59
|
+
if not hasattr(cls, "_fields_"):
|
60
|
+
return result
|
61
|
+
# sys.version_info >= (3, 5)
|
62
|
+
# for (field, *_) in cls._fields_: # noqa
|
63
|
+
for field_tuple in cls._fields_: # noqa
|
64
|
+
field = field_tuple[0]
|
65
|
+
if field.startswith('PADDING_'):
|
66
|
+
continue
|
67
|
+
value = getattr(self, field)
|
68
|
+
type_ = type(value)
|
69
|
+
if hasattr(value, "_length_") and hasattr(value, "_type_"):
|
70
|
+
# array
|
71
|
+
if not hasattr(type_, "as_dict"):
|
72
|
+
value = [v for v in value]
|
73
|
+
else:
|
74
|
+
type_ = type_._type_
|
75
|
+
value = [type_.as_dict(v) for v in value]
|
76
|
+
elif hasattr(value, "contents") and hasattr(value, "_type_"):
|
77
|
+
# pointer
|
78
|
+
try:
|
79
|
+
if not hasattr(type_, "as_dict"):
|
80
|
+
value = value.contents
|
81
|
+
else:
|
82
|
+
type_ = type_._type_
|
83
|
+
value = type_.as_dict(value.contents)
|
84
|
+
except ValueError:
|
85
|
+
# nullptr
|
86
|
+
value = None
|
87
|
+
elif isinstance(value, AsDictMixin):
|
88
|
+
# other structure
|
89
|
+
value = type_.as_dict(value)
|
90
|
+
result[field] = value
|
91
|
+
return result
|
92
|
+
|
93
|
+
|
94
|
+
class Structure(ctypes.Structure, AsDictMixin):
|
95
|
+
|
96
|
+
def __init__(self, *args, **kwds):
|
97
|
+
# We don't want to use positional arguments fill PADDING_* fields
|
98
|
+
|
99
|
+
args = dict(zip(self.__class__._field_names_(), args))
|
100
|
+
args.update(kwds)
|
101
|
+
super(Structure, self).__init__(**args)
|
102
|
+
|
103
|
+
@classmethod
|
104
|
+
def _field_names_(cls):
|
105
|
+
if hasattr(cls, '_fields_'):
|
106
|
+
return (f[0] for f in cls._fields_ if not f[0].startswith('PADDING'))
|
107
|
+
else:
|
108
|
+
return ()
|
109
|
+
|
110
|
+
@classmethod
|
111
|
+
def get_type(cls, field):
|
112
|
+
for f in cls._fields_:
|
113
|
+
if f[0] == field:
|
114
|
+
return f[1]
|
115
|
+
return None
|
116
|
+
|
117
|
+
@classmethod
|
118
|
+
def bind(cls, bound_fields):
|
119
|
+
fields = {}
|
120
|
+
for name, type_ in cls._fields_:
|
121
|
+
if hasattr(type_, "restype"):
|
122
|
+
if name in bound_fields:
|
123
|
+
if bound_fields[name] is None:
|
124
|
+
fields[name] = type_()
|
125
|
+
else:
|
126
|
+
# use a closure to capture the callback from the loop scope
|
127
|
+
fields[name] = (
|
128
|
+
type_((lambda callback: lambda *args: callback(*args))(
|
129
|
+
bound_fields[name]))
|
130
|
+
)
|
131
|
+
del bound_fields[name]
|
132
|
+
else:
|
133
|
+
# default callback implementation (does nothing)
|
134
|
+
try:
|
135
|
+
default_ = type_(0).restype().value
|
136
|
+
except TypeError:
|
137
|
+
default_ = None
|
138
|
+
fields[name] = type_((
|
139
|
+
lambda default_: lambda *args: default_)(default_))
|
140
|
+
else:
|
141
|
+
# not a callback function, use default initialization
|
142
|
+
if name in bound_fields:
|
143
|
+
fields[name] = bound_fields[name]
|
144
|
+
del bound_fields[name]
|
145
|
+
else:
|
146
|
+
fields[name] = type_()
|
147
|
+
if len(bound_fields) != 0:
|
148
|
+
raise ValueError(
|
149
|
+
"Cannot bind the following unknown callback(s) {}.{}".format(
|
150
|
+
cls.__name__, bound_fields.keys()
|
151
|
+
))
|
152
|
+
return cls(**fields)
|
153
|
+
|
154
|
+
|
155
|
+
class Union(ctypes.Union, AsDictMixin):
|
156
|
+
pass
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
# values for enumeration 'amd_comgr_status_s'
|
164
|
+
amd_comgr_status_s__enumvalues = {
|
165
|
+
0: 'AMD_COMGR_STATUS_SUCCESS',
|
166
|
+
1: 'AMD_COMGR_STATUS_ERROR',
|
167
|
+
2: 'AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT',
|
168
|
+
3: 'AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES',
|
169
|
+
}
|
170
|
+
AMD_COMGR_STATUS_SUCCESS = 0
|
171
|
+
AMD_COMGR_STATUS_ERROR = 1
|
172
|
+
AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT = 2
|
173
|
+
AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES = 3
|
174
|
+
amd_comgr_status_s = ctypes.c_uint32 # enum
|
175
|
+
amd_comgr_status_t = amd_comgr_status_s
|
176
|
+
amd_comgr_status_t__enumvalues = amd_comgr_status_s__enumvalues
|
177
|
+
|
178
|
+
# values for enumeration 'amd_comgr_language_s'
|
179
|
+
amd_comgr_language_s__enumvalues = {
|
180
|
+
0: 'AMD_COMGR_LANGUAGE_NONE',
|
181
|
+
1: 'AMD_COMGR_LANGUAGE_OPENCL_1_2',
|
182
|
+
2: 'AMD_COMGR_LANGUAGE_OPENCL_2_0',
|
183
|
+
3: 'AMD_COMGR_LANGUAGE_HC',
|
184
|
+
4: 'AMD_COMGR_LANGUAGE_HIP',
|
185
|
+
5: 'AMD_COMGR_LANGUAGE_LLVM_IR',
|
186
|
+
5: 'AMD_COMGR_LANGUAGE_LAST',
|
187
|
+
}
|
188
|
+
AMD_COMGR_LANGUAGE_NONE = 0
|
189
|
+
AMD_COMGR_LANGUAGE_OPENCL_1_2 = 1
|
190
|
+
AMD_COMGR_LANGUAGE_OPENCL_2_0 = 2
|
191
|
+
AMD_COMGR_LANGUAGE_HC = 3
|
192
|
+
AMD_COMGR_LANGUAGE_HIP = 4
|
193
|
+
AMD_COMGR_LANGUAGE_LLVM_IR = 5
|
194
|
+
AMD_COMGR_LANGUAGE_LAST = 5
|
195
|
+
amd_comgr_language_s = ctypes.c_uint32 # enum
|
196
|
+
amd_comgr_language_t = amd_comgr_language_s
|
197
|
+
amd_comgr_language_t__enumvalues = amd_comgr_language_s__enumvalues
|
198
|
+
try:
|
199
|
+
amd_comgr_status_string = _libraries['libamd_comgr.so'].amd_comgr_status_string
|
200
|
+
amd_comgr_status_string.restype = amd_comgr_status_t
|
201
|
+
amd_comgr_status_string.argtypes = [amd_comgr_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))]
|
202
|
+
except AttributeError:
|
203
|
+
pass
|
204
|
+
try:
|
205
|
+
amd_comgr_get_version = _libraries['libamd_comgr.so'].amd_comgr_get_version
|
206
|
+
amd_comgr_get_version.restype = None
|
207
|
+
amd_comgr_get_version.argtypes = [ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)]
|
208
|
+
except AttributeError:
|
209
|
+
pass
|
210
|
+
|
211
|
+
# values for enumeration 'amd_comgr_data_kind_s'
|
212
|
+
amd_comgr_data_kind_s__enumvalues = {
|
213
|
+
0: 'AMD_COMGR_DATA_KIND_UNDEF',
|
214
|
+
1: 'AMD_COMGR_DATA_KIND_SOURCE',
|
215
|
+
2: 'AMD_COMGR_DATA_KIND_INCLUDE',
|
216
|
+
3: 'AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER',
|
217
|
+
4: 'AMD_COMGR_DATA_KIND_DIAGNOSTIC',
|
218
|
+
5: 'AMD_COMGR_DATA_KIND_LOG',
|
219
|
+
6: 'AMD_COMGR_DATA_KIND_BC',
|
220
|
+
7: 'AMD_COMGR_DATA_KIND_RELOCATABLE',
|
221
|
+
8: 'AMD_COMGR_DATA_KIND_EXECUTABLE',
|
222
|
+
9: 'AMD_COMGR_DATA_KIND_BYTES',
|
223
|
+
16: 'AMD_COMGR_DATA_KIND_FATBIN',
|
224
|
+
17: 'AMD_COMGR_DATA_KIND_AR',
|
225
|
+
18: 'AMD_COMGR_DATA_KIND_BC_BUNDLE',
|
226
|
+
19: 'AMD_COMGR_DATA_KIND_AR_BUNDLE',
|
227
|
+
19: 'AMD_COMGR_DATA_KIND_LAST',
|
228
|
+
}
|
229
|
+
AMD_COMGR_DATA_KIND_UNDEF = 0
|
230
|
+
AMD_COMGR_DATA_KIND_SOURCE = 1
|
231
|
+
AMD_COMGR_DATA_KIND_INCLUDE = 2
|
232
|
+
AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER = 3
|
233
|
+
AMD_COMGR_DATA_KIND_DIAGNOSTIC = 4
|
234
|
+
AMD_COMGR_DATA_KIND_LOG = 5
|
235
|
+
AMD_COMGR_DATA_KIND_BC = 6
|
236
|
+
AMD_COMGR_DATA_KIND_RELOCATABLE = 7
|
237
|
+
AMD_COMGR_DATA_KIND_EXECUTABLE = 8
|
238
|
+
AMD_COMGR_DATA_KIND_BYTES = 9
|
239
|
+
AMD_COMGR_DATA_KIND_FATBIN = 16
|
240
|
+
AMD_COMGR_DATA_KIND_AR = 17
|
241
|
+
AMD_COMGR_DATA_KIND_BC_BUNDLE = 18
|
242
|
+
AMD_COMGR_DATA_KIND_AR_BUNDLE = 19
|
243
|
+
AMD_COMGR_DATA_KIND_LAST = 19
|
244
|
+
amd_comgr_data_kind_s = ctypes.c_uint32 # enum
|
245
|
+
amd_comgr_data_kind_t = amd_comgr_data_kind_s
|
246
|
+
amd_comgr_data_kind_t__enumvalues = amd_comgr_data_kind_s__enumvalues
|
247
|
+
class struct_amd_comgr_data_s(Structure):
|
248
|
+
pass
|
249
|
+
|
250
|
+
struct_amd_comgr_data_s._pack_ = 1 # source:False
|
251
|
+
struct_amd_comgr_data_s._fields_ = [
|
252
|
+
('handle', ctypes.c_uint64),
|
253
|
+
]
|
254
|
+
|
255
|
+
amd_comgr_data_t = struct_amd_comgr_data_s
|
256
|
+
class struct_amd_comgr_data_set_s(Structure):
|
257
|
+
pass
|
258
|
+
|
259
|
+
struct_amd_comgr_data_set_s._pack_ = 1 # source:False
|
260
|
+
struct_amd_comgr_data_set_s._fields_ = [
|
261
|
+
('handle', ctypes.c_uint64),
|
262
|
+
]
|
263
|
+
|
264
|
+
amd_comgr_data_set_t = struct_amd_comgr_data_set_s
|
265
|
+
class struct_amd_comgr_action_info_s(Structure):
|
266
|
+
pass
|
267
|
+
|
268
|
+
struct_amd_comgr_action_info_s._pack_ = 1 # source:False
|
269
|
+
struct_amd_comgr_action_info_s._fields_ = [
|
270
|
+
('handle', ctypes.c_uint64),
|
271
|
+
]
|
272
|
+
|
273
|
+
amd_comgr_action_info_t = struct_amd_comgr_action_info_s
|
274
|
+
class struct_amd_comgr_metadata_node_s(Structure):
|
275
|
+
pass
|
276
|
+
|
277
|
+
struct_amd_comgr_metadata_node_s._pack_ = 1 # source:False
|
278
|
+
struct_amd_comgr_metadata_node_s._fields_ = [
|
279
|
+
('handle', ctypes.c_uint64),
|
280
|
+
]
|
281
|
+
|
282
|
+
amd_comgr_metadata_node_t = struct_amd_comgr_metadata_node_s
|
283
|
+
class struct_amd_comgr_symbol_s(Structure):
|
284
|
+
pass
|
285
|
+
|
286
|
+
struct_amd_comgr_symbol_s._pack_ = 1 # source:False
|
287
|
+
struct_amd_comgr_symbol_s._fields_ = [
|
288
|
+
('handle', ctypes.c_uint64),
|
289
|
+
]
|
290
|
+
|
291
|
+
amd_comgr_symbol_t = struct_amd_comgr_symbol_s
|
292
|
+
class struct_amd_comgr_disassembly_info_s(Structure):
|
293
|
+
pass
|
294
|
+
|
295
|
+
struct_amd_comgr_disassembly_info_s._pack_ = 1 # source:False
|
296
|
+
struct_amd_comgr_disassembly_info_s._fields_ = [
|
297
|
+
('handle', ctypes.c_uint64),
|
298
|
+
]
|
299
|
+
|
300
|
+
amd_comgr_disassembly_info_t = struct_amd_comgr_disassembly_info_s
|
301
|
+
class struct_amd_comgr_symbolizer_info_s(Structure):
|
302
|
+
pass
|
303
|
+
|
304
|
+
struct_amd_comgr_symbolizer_info_s._pack_ = 1 # source:False
|
305
|
+
struct_amd_comgr_symbolizer_info_s._fields_ = [
|
306
|
+
('handle', ctypes.c_uint64),
|
307
|
+
]
|
308
|
+
|
309
|
+
amd_comgr_symbolizer_info_t = struct_amd_comgr_symbolizer_info_s
|
310
|
+
try:
|
311
|
+
amd_comgr_get_isa_count = _libraries['libamd_comgr.so'].amd_comgr_get_isa_count
|
312
|
+
amd_comgr_get_isa_count.restype = amd_comgr_status_t
|
313
|
+
amd_comgr_get_isa_count.argtypes = [ctypes.POINTER(ctypes.c_uint64)]
|
314
|
+
except AttributeError:
|
315
|
+
pass
|
316
|
+
size_t = ctypes.c_uint64
|
317
|
+
try:
|
318
|
+
amd_comgr_get_isa_name = _libraries['libamd_comgr.so'].amd_comgr_get_isa_name
|
319
|
+
amd_comgr_get_isa_name.restype = amd_comgr_status_t
|
320
|
+
amd_comgr_get_isa_name.argtypes = [size_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))]
|
321
|
+
except AttributeError:
|
322
|
+
pass
|
323
|
+
try:
|
324
|
+
amd_comgr_get_isa_metadata = _libraries['libamd_comgr.so'].amd_comgr_get_isa_metadata
|
325
|
+
amd_comgr_get_isa_metadata.restype = amd_comgr_status_t
|
326
|
+
amd_comgr_get_isa_metadata.argtypes = [ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_metadata_node_s)]
|
327
|
+
except AttributeError:
|
328
|
+
pass
|
329
|
+
try:
|
330
|
+
amd_comgr_create_data = _libraries['libamd_comgr.so'].amd_comgr_create_data
|
331
|
+
amd_comgr_create_data.restype = amd_comgr_status_t
|
332
|
+
amd_comgr_create_data.argtypes = [amd_comgr_data_kind_t, ctypes.POINTER(struct_amd_comgr_data_s)]
|
333
|
+
except AttributeError:
|
334
|
+
pass
|
335
|
+
try:
|
336
|
+
amd_comgr_release_data = _libraries['libamd_comgr.so'].amd_comgr_release_data
|
337
|
+
amd_comgr_release_data.restype = amd_comgr_status_t
|
338
|
+
amd_comgr_release_data.argtypes = [amd_comgr_data_t]
|
339
|
+
except AttributeError:
|
340
|
+
pass
|
341
|
+
try:
|
342
|
+
amd_comgr_get_data_kind = _libraries['libamd_comgr.so'].amd_comgr_get_data_kind
|
343
|
+
amd_comgr_get_data_kind.restype = amd_comgr_status_t
|
344
|
+
amd_comgr_get_data_kind.argtypes = [amd_comgr_data_t, ctypes.POINTER(amd_comgr_data_kind_s)]
|
345
|
+
except AttributeError:
|
346
|
+
pass
|
347
|
+
try:
|
348
|
+
amd_comgr_set_data = _libraries['libamd_comgr.so'].amd_comgr_set_data
|
349
|
+
amd_comgr_set_data.restype = amd_comgr_status_t
|
350
|
+
amd_comgr_set_data.argtypes = [amd_comgr_data_t, size_t, ctypes.POINTER(ctypes.c_char)]
|
351
|
+
except AttributeError:
|
352
|
+
pass
|
353
|
+
uint64_t = ctypes.c_uint64
|
354
|
+
try:
|
355
|
+
amd_comgr_set_data_from_file_slice = _libraries['libamd_comgr.so'].amd_comgr_set_data_from_file_slice
|
356
|
+
amd_comgr_set_data_from_file_slice.restype = amd_comgr_status_t
|
357
|
+
amd_comgr_set_data_from_file_slice.argtypes = [amd_comgr_data_t, ctypes.c_int32, uint64_t, uint64_t]
|
358
|
+
except AttributeError:
|
359
|
+
pass
|
360
|
+
try:
|
361
|
+
amd_comgr_set_data_name = _libraries['libamd_comgr.so'].amd_comgr_set_data_name
|
362
|
+
amd_comgr_set_data_name.restype = amd_comgr_status_t
|
363
|
+
amd_comgr_set_data_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_char)]
|
364
|
+
except AttributeError:
|
365
|
+
pass
|
366
|
+
try:
|
367
|
+
amd_comgr_get_data = _libraries['libamd_comgr.so'].amd_comgr_get_data
|
368
|
+
amd_comgr_get_data.restype = amd_comgr_status_t
|
369
|
+
amd_comgr_get_data.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
370
|
+
except AttributeError:
|
371
|
+
pass
|
372
|
+
try:
|
373
|
+
amd_comgr_get_data_name = _libraries['libamd_comgr.so'].amd_comgr_get_data_name
|
374
|
+
amd_comgr_get_data_name.restype = amd_comgr_status_t
|
375
|
+
amd_comgr_get_data_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
376
|
+
except AttributeError:
|
377
|
+
pass
|
378
|
+
try:
|
379
|
+
amd_comgr_get_data_isa_name = _libraries['libamd_comgr.so'].amd_comgr_get_data_isa_name
|
380
|
+
amd_comgr_get_data_isa_name.restype = amd_comgr_status_t
|
381
|
+
amd_comgr_get_data_isa_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
382
|
+
except AttributeError:
|
383
|
+
pass
|
384
|
+
try:
|
385
|
+
amd_comgr_create_symbolizer_info = _libraries['libamd_comgr.so'].amd_comgr_create_symbolizer_info
|
386
|
+
amd_comgr_create_symbolizer_info.restype = amd_comgr_status_t
|
387
|
+
amd_comgr_create_symbolizer_info.argtypes = [amd_comgr_data_t, ctypes.CFUNCTYPE(None, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(None)), ctypes.POINTER(struct_amd_comgr_symbolizer_info_s)]
|
388
|
+
except AttributeError:
|
389
|
+
pass
|
390
|
+
try:
|
391
|
+
amd_comgr_destroy_symbolizer_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_symbolizer_info
|
392
|
+
amd_comgr_destroy_symbolizer_info.restype = amd_comgr_status_t
|
393
|
+
amd_comgr_destroy_symbolizer_info.argtypes = [amd_comgr_symbolizer_info_t]
|
394
|
+
except AttributeError:
|
395
|
+
pass
|
396
|
+
try:
|
397
|
+
amd_comgr_symbolize = _libraries['libamd_comgr.so'].amd_comgr_symbolize
|
398
|
+
amd_comgr_symbolize.restype = amd_comgr_status_t
|
399
|
+
amd_comgr_symbolize.argtypes = [amd_comgr_symbolizer_info_t, uint64_t, ctypes.c_bool, ctypes.POINTER(None)]
|
400
|
+
except AttributeError:
|
401
|
+
pass
|
402
|
+
try:
|
403
|
+
amd_comgr_get_data_metadata = _libraries['libamd_comgr.so'].amd_comgr_get_data_metadata
|
404
|
+
amd_comgr_get_data_metadata.restype = amd_comgr_status_t
|
405
|
+
amd_comgr_get_data_metadata.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_amd_comgr_metadata_node_s)]
|
406
|
+
except AttributeError:
|
407
|
+
pass
|
408
|
+
try:
|
409
|
+
amd_comgr_destroy_metadata = _libraries['libamd_comgr.so'].amd_comgr_destroy_metadata
|
410
|
+
amd_comgr_destroy_metadata.restype = amd_comgr_status_t
|
411
|
+
amd_comgr_destroy_metadata.argtypes = [amd_comgr_metadata_node_t]
|
412
|
+
except AttributeError:
|
413
|
+
pass
|
414
|
+
try:
|
415
|
+
amd_comgr_create_data_set = _libraries['libamd_comgr.so'].amd_comgr_create_data_set
|
416
|
+
amd_comgr_create_data_set.restype = amd_comgr_status_t
|
417
|
+
amd_comgr_create_data_set.argtypes = [ctypes.POINTER(struct_amd_comgr_data_set_s)]
|
418
|
+
except AttributeError:
|
419
|
+
pass
|
420
|
+
try:
|
421
|
+
amd_comgr_destroy_data_set = _libraries['libamd_comgr.so'].amd_comgr_destroy_data_set
|
422
|
+
amd_comgr_destroy_data_set.restype = amd_comgr_status_t
|
423
|
+
amd_comgr_destroy_data_set.argtypes = [amd_comgr_data_set_t]
|
424
|
+
except AttributeError:
|
425
|
+
pass
|
426
|
+
try:
|
427
|
+
amd_comgr_data_set_add = _libraries['libamd_comgr.so'].amd_comgr_data_set_add
|
428
|
+
amd_comgr_data_set_add.restype = amd_comgr_status_t
|
429
|
+
amd_comgr_data_set_add.argtypes = [amd_comgr_data_set_t, amd_comgr_data_t]
|
430
|
+
except AttributeError:
|
431
|
+
pass
|
432
|
+
try:
|
433
|
+
amd_comgr_data_set_remove = _libraries['libamd_comgr.so'].amd_comgr_data_set_remove
|
434
|
+
amd_comgr_data_set_remove.restype = amd_comgr_status_t
|
435
|
+
amd_comgr_data_set_remove.argtypes = [amd_comgr_data_set_t, amd_comgr_data_kind_t]
|
436
|
+
except AttributeError:
|
437
|
+
pass
|
438
|
+
try:
|
439
|
+
amd_comgr_action_data_count = _libraries['libamd_comgr.so'].amd_comgr_action_data_count
|
440
|
+
amd_comgr_action_data_count.restype = amd_comgr_status_t
|
441
|
+
amd_comgr_action_data_count.argtypes = [amd_comgr_data_set_t, amd_comgr_data_kind_t, ctypes.POINTER(ctypes.c_uint64)]
|
442
|
+
except AttributeError:
|
443
|
+
pass
|
444
|
+
try:
|
445
|
+
amd_comgr_action_data_get_data = _libraries['libamd_comgr.so'].amd_comgr_action_data_get_data
|
446
|
+
amd_comgr_action_data_get_data.restype = amd_comgr_status_t
|
447
|
+
amd_comgr_action_data_get_data.argtypes = [amd_comgr_data_set_t, amd_comgr_data_kind_t, size_t, ctypes.POINTER(struct_amd_comgr_data_s)]
|
448
|
+
except AttributeError:
|
449
|
+
pass
|
450
|
+
try:
|
451
|
+
amd_comgr_create_action_info = _libraries['libamd_comgr.so'].amd_comgr_create_action_info
|
452
|
+
amd_comgr_create_action_info.restype = amd_comgr_status_t
|
453
|
+
amd_comgr_create_action_info.argtypes = [ctypes.POINTER(struct_amd_comgr_action_info_s)]
|
454
|
+
except AttributeError:
|
455
|
+
pass
|
456
|
+
try:
|
457
|
+
amd_comgr_destroy_action_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_action_info
|
458
|
+
amd_comgr_destroy_action_info.restype = amd_comgr_status_t
|
459
|
+
amd_comgr_destroy_action_info.argtypes = [amd_comgr_action_info_t]
|
460
|
+
except AttributeError:
|
461
|
+
pass
|
462
|
+
try:
|
463
|
+
amd_comgr_action_info_set_isa_name = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_isa_name
|
464
|
+
amd_comgr_action_info_set_isa_name.restype = amd_comgr_status_t
|
465
|
+
amd_comgr_action_info_set_isa_name.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)]
|
466
|
+
except AttributeError:
|
467
|
+
pass
|
468
|
+
try:
|
469
|
+
amd_comgr_action_info_get_isa_name = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_isa_name
|
470
|
+
amd_comgr_action_info_get_isa_name.restype = amd_comgr_status_t
|
471
|
+
amd_comgr_action_info_get_isa_name.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
472
|
+
except AttributeError:
|
473
|
+
pass
|
474
|
+
try:
|
475
|
+
amd_comgr_action_info_set_language = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_language
|
476
|
+
amd_comgr_action_info_set_language.restype = amd_comgr_status_t
|
477
|
+
amd_comgr_action_info_set_language.argtypes = [amd_comgr_action_info_t, amd_comgr_language_t]
|
478
|
+
except AttributeError:
|
479
|
+
pass
|
480
|
+
try:
|
481
|
+
amd_comgr_action_info_get_language = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_language
|
482
|
+
amd_comgr_action_info_get_language.restype = amd_comgr_status_t
|
483
|
+
amd_comgr_action_info_get_language.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(amd_comgr_language_s)]
|
484
|
+
except AttributeError:
|
485
|
+
pass
|
486
|
+
try:
|
487
|
+
amd_comgr_action_info_set_options = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_options
|
488
|
+
amd_comgr_action_info_set_options.restype = amd_comgr_status_t
|
489
|
+
amd_comgr_action_info_set_options.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)]
|
490
|
+
except AttributeError:
|
491
|
+
pass
|
492
|
+
try:
|
493
|
+
amd_comgr_action_info_get_options = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_options
|
494
|
+
amd_comgr_action_info_get_options.restype = amd_comgr_status_t
|
495
|
+
amd_comgr_action_info_get_options.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
496
|
+
except AttributeError:
|
497
|
+
pass
|
498
|
+
try:
|
499
|
+
amd_comgr_action_info_set_option_list = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_option_list
|
500
|
+
amd_comgr_action_info_set_option_list.restype = amd_comgr_status_t
|
501
|
+
amd_comgr_action_info_set_option_list.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char) * 0, size_t]
|
502
|
+
except AttributeError:
|
503
|
+
pass
|
504
|
+
try:
|
505
|
+
amd_comgr_action_info_get_option_list_count = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_option_list_count
|
506
|
+
amd_comgr_action_info_get_option_list_count.restype = amd_comgr_status_t
|
507
|
+
amd_comgr_action_info_get_option_list_count.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64)]
|
508
|
+
except AttributeError:
|
509
|
+
pass
|
510
|
+
try:
|
511
|
+
amd_comgr_action_info_get_option_list_item = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_option_list_item
|
512
|
+
amd_comgr_action_info_get_option_list_item.restype = amd_comgr_status_t
|
513
|
+
amd_comgr_action_info_get_option_list_item.argtypes = [amd_comgr_action_info_t, size_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
514
|
+
except AttributeError:
|
515
|
+
pass
|
516
|
+
try:
|
517
|
+
amd_comgr_action_info_set_working_directory_path = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_working_directory_path
|
518
|
+
amd_comgr_action_info_set_working_directory_path.restype = amd_comgr_status_t
|
519
|
+
amd_comgr_action_info_set_working_directory_path.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)]
|
520
|
+
except AttributeError:
|
521
|
+
pass
|
522
|
+
try:
|
523
|
+
amd_comgr_action_info_get_working_directory_path = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_working_directory_path
|
524
|
+
amd_comgr_action_info_get_working_directory_path.restype = amd_comgr_status_t
|
525
|
+
amd_comgr_action_info_get_working_directory_path.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
526
|
+
except AttributeError:
|
527
|
+
pass
|
528
|
+
try:
|
529
|
+
amd_comgr_action_info_set_logging = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_logging
|
530
|
+
amd_comgr_action_info_set_logging.restype = amd_comgr_status_t
|
531
|
+
amd_comgr_action_info_set_logging.argtypes = [amd_comgr_action_info_t, ctypes.c_bool]
|
532
|
+
except AttributeError:
|
533
|
+
pass
|
534
|
+
try:
|
535
|
+
amd_comgr_action_info_get_logging = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_logging
|
536
|
+
amd_comgr_action_info_get_logging.restype = amd_comgr_status_t
|
537
|
+
amd_comgr_action_info_get_logging.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_bool)]
|
538
|
+
except AttributeError:
|
539
|
+
pass
|
540
|
+
|
541
|
+
# values for enumeration 'amd_comgr_action_kind_s'
|
542
|
+
amd_comgr_action_kind_s__enumvalues = {
|
543
|
+
0: 'AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR',
|
544
|
+
1: 'AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS',
|
545
|
+
2: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC',
|
546
|
+
3: 'AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES',
|
547
|
+
4: 'AMD_COMGR_ACTION_LINK_BC_TO_BC',
|
548
|
+
5: 'AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC',
|
549
|
+
6: 'AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE',
|
550
|
+
7: 'AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY',
|
551
|
+
8: 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE',
|
552
|
+
9: 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE',
|
553
|
+
10: 'AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE',
|
554
|
+
11: 'AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE',
|
555
|
+
12: 'AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE',
|
556
|
+
13: 'AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE',
|
557
|
+
14: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN',
|
558
|
+
15: 'AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC',
|
559
|
+
16: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE',
|
560
|
+
17: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE',
|
561
|
+
17: 'AMD_COMGR_ACTION_LAST',
|
562
|
+
}
|
563
|
+
AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR = 0
|
564
|
+
AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS = 1
|
565
|
+
AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC = 2
|
566
|
+
AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES = 3
|
567
|
+
AMD_COMGR_ACTION_LINK_BC_TO_BC = 4
|
568
|
+
AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC = 5
|
569
|
+
AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE = 6
|
570
|
+
AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY = 7
|
571
|
+
AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE = 8
|
572
|
+
AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE = 9
|
573
|
+
AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE = 10
|
574
|
+
AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE = 11
|
575
|
+
AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE = 12
|
576
|
+
AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE = 13
|
577
|
+
AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN = 14
|
578
|
+
AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC = 15
|
579
|
+
AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE = 16
|
580
|
+
AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE = 17
|
581
|
+
AMD_COMGR_ACTION_LAST = 17
|
582
|
+
amd_comgr_action_kind_s = ctypes.c_uint32 # enum
|
583
|
+
amd_comgr_action_kind_t = amd_comgr_action_kind_s
|
584
|
+
amd_comgr_action_kind_t__enumvalues = amd_comgr_action_kind_s__enumvalues
|
585
|
+
try:
|
586
|
+
amd_comgr_do_action = _libraries['libamd_comgr.so'].amd_comgr_do_action
|
587
|
+
amd_comgr_do_action.restype = amd_comgr_status_t
|
588
|
+
amd_comgr_do_action.argtypes = [amd_comgr_action_kind_t, amd_comgr_action_info_t, amd_comgr_data_set_t, amd_comgr_data_set_t]
|
589
|
+
except AttributeError:
|
590
|
+
pass
|
591
|
+
|
592
|
+
# values for enumeration 'amd_comgr_metadata_kind_s'
|
593
|
+
amd_comgr_metadata_kind_s__enumvalues = {
|
594
|
+
0: 'AMD_COMGR_METADATA_KIND_NULL',
|
595
|
+
1: 'AMD_COMGR_METADATA_KIND_STRING',
|
596
|
+
2: 'AMD_COMGR_METADATA_KIND_MAP',
|
597
|
+
3: 'AMD_COMGR_METADATA_KIND_LIST',
|
598
|
+
3: 'AMD_COMGR_METADATA_KIND_LAST',
|
599
|
+
}
|
600
|
+
AMD_COMGR_METADATA_KIND_NULL = 0
|
601
|
+
AMD_COMGR_METADATA_KIND_STRING = 1
|
602
|
+
AMD_COMGR_METADATA_KIND_MAP = 2
|
603
|
+
AMD_COMGR_METADATA_KIND_LIST = 3
|
604
|
+
AMD_COMGR_METADATA_KIND_LAST = 3
|
605
|
+
amd_comgr_metadata_kind_s = ctypes.c_uint32 # enum
|
606
|
+
amd_comgr_metadata_kind_t = amd_comgr_metadata_kind_s
|
607
|
+
amd_comgr_metadata_kind_t__enumvalues = amd_comgr_metadata_kind_s__enumvalues
|
608
|
+
try:
|
609
|
+
amd_comgr_get_metadata_kind = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_kind
|
610
|
+
amd_comgr_get_metadata_kind.restype = amd_comgr_status_t
|
611
|
+
amd_comgr_get_metadata_kind.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(amd_comgr_metadata_kind_s)]
|
612
|
+
except AttributeError:
|
613
|
+
pass
|
614
|
+
try:
|
615
|
+
amd_comgr_get_metadata_string = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_string
|
616
|
+
amd_comgr_get_metadata_string.restype = amd_comgr_status_t
|
617
|
+
amd_comgr_get_metadata_string.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
618
|
+
except AttributeError:
|
619
|
+
pass
|
620
|
+
try:
|
621
|
+
amd_comgr_get_metadata_map_size = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_map_size
|
622
|
+
amd_comgr_get_metadata_map_size.restype = amd_comgr_status_t
|
623
|
+
amd_comgr_get_metadata_map_size.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64)]
|
624
|
+
except AttributeError:
|
625
|
+
pass
|
626
|
+
try:
|
627
|
+
amd_comgr_iterate_map_metadata = _libraries['libamd_comgr.so'].amd_comgr_iterate_map_metadata
|
628
|
+
amd_comgr_iterate_map_metadata.restype = amd_comgr_status_t
|
629
|
+
amd_comgr_iterate_map_metadata.argtypes = [amd_comgr_metadata_node_t, ctypes.CFUNCTYPE(amd_comgr_status_s, struct_amd_comgr_metadata_node_s, struct_amd_comgr_metadata_node_s, ctypes.POINTER(None)), ctypes.POINTER(None)]
|
630
|
+
except AttributeError:
|
631
|
+
pass
|
632
|
+
try:
|
633
|
+
amd_comgr_metadata_lookup = _libraries['libamd_comgr.so'].amd_comgr_metadata_lookup
|
634
|
+
amd_comgr_metadata_lookup.restype = amd_comgr_status_t
|
635
|
+
amd_comgr_metadata_lookup.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_metadata_node_s)]
|
636
|
+
except AttributeError:
|
637
|
+
pass
|
638
|
+
try:
|
639
|
+
amd_comgr_get_metadata_list_size = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_list_size
|
640
|
+
amd_comgr_get_metadata_list_size.restype = amd_comgr_status_t
|
641
|
+
amd_comgr_get_metadata_list_size.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64)]
|
642
|
+
except AttributeError:
|
643
|
+
pass
|
644
|
+
try:
|
645
|
+
amd_comgr_index_list_metadata = _libraries['libamd_comgr.so'].amd_comgr_index_list_metadata
|
646
|
+
amd_comgr_index_list_metadata.restype = amd_comgr_status_t
|
647
|
+
amd_comgr_index_list_metadata.argtypes = [amd_comgr_metadata_node_t, size_t, ctypes.POINTER(struct_amd_comgr_metadata_node_s)]
|
648
|
+
except AttributeError:
|
649
|
+
pass
|
650
|
+
try:
|
651
|
+
amd_comgr_iterate_symbols = _libraries['libamd_comgr.so'].amd_comgr_iterate_symbols
|
652
|
+
amd_comgr_iterate_symbols.restype = amd_comgr_status_t
|
653
|
+
amd_comgr_iterate_symbols.argtypes = [amd_comgr_data_t, ctypes.CFUNCTYPE(amd_comgr_status_s, struct_amd_comgr_symbol_s, ctypes.POINTER(None)), ctypes.POINTER(None)]
|
654
|
+
except AttributeError:
|
655
|
+
pass
|
656
|
+
try:
|
657
|
+
amd_comgr_symbol_lookup = _libraries['libamd_comgr.so'].amd_comgr_symbol_lookup
|
658
|
+
amd_comgr_symbol_lookup.restype = amd_comgr_status_t
|
659
|
+
amd_comgr_symbol_lookup.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_symbol_s)]
|
660
|
+
except AttributeError:
|
661
|
+
pass
|
662
|
+
|
663
|
+
# values for enumeration 'amd_comgr_symbol_type_s'
|
664
|
+
amd_comgr_symbol_type_s__enumvalues = {
|
665
|
+
-1: 'AMD_COMGR_SYMBOL_TYPE_UNKNOWN',
|
666
|
+
0: 'AMD_COMGR_SYMBOL_TYPE_NOTYPE',
|
667
|
+
1: 'AMD_COMGR_SYMBOL_TYPE_OBJECT',
|
668
|
+
2: 'AMD_COMGR_SYMBOL_TYPE_FUNC',
|
669
|
+
3: 'AMD_COMGR_SYMBOL_TYPE_SECTION',
|
670
|
+
4: 'AMD_COMGR_SYMBOL_TYPE_FILE',
|
671
|
+
5: 'AMD_COMGR_SYMBOL_TYPE_COMMON',
|
672
|
+
10: 'AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL',
|
673
|
+
}
|
674
|
+
AMD_COMGR_SYMBOL_TYPE_UNKNOWN = -1
|
675
|
+
AMD_COMGR_SYMBOL_TYPE_NOTYPE = 0
|
676
|
+
AMD_COMGR_SYMBOL_TYPE_OBJECT = 1
|
677
|
+
AMD_COMGR_SYMBOL_TYPE_FUNC = 2
|
678
|
+
AMD_COMGR_SYMBOL_TYPE_SECTION = 3
|
679
|
+
AMD_COMGR_SYMBOL_TYPE_FILE = 4
|
680
|
+
AMD_COMGR_SYMBOL_TYPE_COMMON = 5
|
681
|
+
AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL = 10
|
682
|
+
amd_comgr_symbol_type_s = ctypes.c_int32 # enum
|
683
|
+
amd_comgr_symbol_type_t = amd_comgr_symbol_type_s
|
684
|
+
amd_comgr_symbol_type_t__enumvalues = amd_comgr_symbol_type_s__enumvalues
|
685
|
+
|
686
|
+
# values for enumeration 'amd_comgr_symbol_info_s'
|
687
|
+
amd_comgr_symbol_info_s__enumvalues = {
|
688
|
+
0: 'AMD_COMGR_SYMBOL_INFO_NAME_LENGTH',
|
689
|
+
1: 'AMD_COMGR_SYMBOL_INFO_NAME',
|
690
|
+
2: 'AMD_COMGR_SYMBOL_INFO_TYPE',
|
691
|
+
3: 'AMD_COMGR_SYMBOL_INFO_SIZE',
|
692
|
+
4: 'AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED',
|
693
|
+
5: 'AMD_COMGR_SYMBOL_INFO_VALUE',
|
694
|
+
5: 'AMD_COMGR_SYMBOL_INFO_LAST',
|
695
|
+
}
|
696
|
+
AMD_COMGR_SYMBOL_INFO_NAME_LENGTH = 0
|
697
|
+
AMD_COMGR_SYMBOL_INFO_NAME = 1
|
698
|
+
AMD_COMGR_SYMBOL_INFO_TYPE = 2
|
699
|
+
AMD_COMGR_SYMBOL_INFO_SIZE = 3
|
700
|
+
AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED = 4
|
701
|
+
AMD_COMGR_SYMBOL_INFO_VALUE = 5
|
702
|
+
AMD_COMGR_SYMBOL_INFO_LAST = 5
|
703
|
+
amd_comgr_symbol_info_s = ctypes.c_uint32 # enum
|
704
|
+
amd_comgr_symbol_info_t = amd_comgr_symbol_info_s
|
705
|
+
amd_comgr_symbol_info_t__enumvalues = amd_comgr_symbol_info_s__enumvalues
|
706
|
+
try:
|
707
|
+
amd_comgr_symbol_get_info = _libraries['libamd_comgr.so'].amd_comgr_symbol_get_info
|
708
|
+
amd_comgr_symbol_get_info.restype = amd_comgr_status_t
|
709
|
+
amd_comgr_symbol_get_info.argtypes = [amd_comgr_symbol_t, amd_comgr_symbol_info_t, ctypes.POINTER(None)]
|
710
|
+
except AttributeError:
|
711
|
+
pass
|
712
|
+
try:
|
713
|
+
amd_comgr_create_disassembly_info = _libraries['libamd_comgr.so'].amd_comgr_create_disassembly_info
|
714
|
+
amd_comgr_create_disassembly_info.restype = amd_comgr_status_t
|
715
|
+
amd_comgr_create_disassembly_info.argtypes = [ctypes.POINTER(ctypes.c_char), ctypes.CFUNCTYPE(ctypes.c_uint64, ctypes.c_uint64, ctypes.POINTER(ctypes.c_char), ctypes.c_uint64, ctypes.POINTER(None)), ctypes.CFUNCTYPE(None, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(None)), ctypes.CFUNCTYPE(None, ctypes.c_uint64, ctypes.POINTER(None)), ctypes.POINTER(struct_amd_comgr_disassembly_info_s)]
|
716
|
+
except AttributeError:
|
717
|
+
pass
|
718
|
+
try:
|
719
|
+
amd_comgr_destroy_disassembly_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_disassembly_info
|
720
|
+
amd_comgr_destroy_disassembly_info.restype = amd_comgr_status_t
|
721
|
+
amd_comgr_destroy_disassembly_info.argtypes = [amd_comgr_disassembly_info_t]
|
722
|
+
except AttributeError:
|
723
|
+
pass
|
724
|
+
try:
|
725
|
+
amd_comgr_disassemble_instruction = _libraries['libamd_comgr.so'].amd_comgr_disassemble_instruction
|
726
|
+
amd_comgr_disassemble_instruction.restype = amd_comgr_status_t
|
727
|
+
amd_comgr_disassemble_instruction.argtypes = [amd_comgr_disassembly_info_t, uint64_t, ctypes.POINTER(None), ctypes.POINTER(ctypes.c_uint64)]
|
728
|
+
except AttributeError:
|
729
|
+
pass
|
730
|
+
try:
|
731
|
+
amd_comgr_demangle_symbol_name = _libraries['libamd_comgr.so'].amd_comgr_demangle_symbol_name
|
732
|
+
amd_comgr_demangle_symbol_name.restype = amd_comgr_status_t
|
733
|
+
amd_comgr_demangle_symbol_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_amd_comgr_data_s)]
|
734
|
+
except AttributeError:
|
735
|
+
pass
|
736
|
+
try:
|
737
|
+
amd_comgr_populate_mangled_names = _libraries['libamd_comgr.so'].amd_comgr_populate_mangled_names
|
738
|
+
amd_comgr_populate_mangled_names.restype = amd_comgr_status_t
|
739
|
+
amd_comgr_populate_mangled_names.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64)]
|
740
|
+
except AttributeError:
|
741
|
+
pass
|
742
|
+
try:
|
743
|
+
amd_comgr_get_mangled_name = _libraries['libamd_comgr.so'].amd_comgr_get_mangled_name
|
744
|
+
amd_comgr_get_mangled_name.restype = amd_comgr_status_t
|
745
|
+
amd_comgr_get_mangled_name.argtypes = [amd_comgr_data_t, size_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)]
|
746
|
+
except AttributeError:
|
747
|
+
pass
|
748
|
+
try:
|
749
|
+
amd_comgr_populate_name_expression_map = _libraries['libamd_comgr.so'].amd_comgr_populate_name_expression_map
|
750
|
+
amd_comgr_populate_name_expression_map.restype = amd_comgr_status_t
|
751
|
+
amd_comgr_populate_name_expression_map.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64)]
|
752
|
+
except AttributeError:
|
753
|
+
pass
|
754
|
+
try:
|
755
|
+
amd_comgr_map_name_expression_to_symbol_name = _libraries['libamd_comgr.so'].amd_comgr_map_name_expression_to_symbol_name
|
756
|
+
amd_comgr_map_name_expression_to_symbol_name.restype = amd_comgr_status_t
|
757
|
+
amd_comgr_map_name_expression_to_symbol_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_char)]
|
758
|
+
except AttributeError:
|
759
|
+
pass
|
760
|
+
class struct_code_object_info_s(Structure):
|
761
|
+
pass
|
762
|
+
|
763
|
+
struct_code_object_info_s._pack_ = 1 # source:False
|
764
|
+
struct_code_object_info_s._fields_ = [
|
765
|
+
('isa', ctypes.POINTER(ctypes.c_char)),
|
766
|
+
('size', ctypes.c_uint64),
|
767
|
+
('offset', ctypes.c_uint64),
|
768
|
+
]
|
769
|
+
|
770
|
+
amd_comgr_code_object_info_t = struct_code_object_info_s
|
771
|
+
try:
|
772
|
+
amd_comgr_lookup_code_object = _libraries['libamd_comgr.so'].amd_comgr_lookup_code_object
|
773
|
+
amd_comgr_lookup_code_object.restype = amd_comgr_status_t
|
774
|
+
amd_comgr_lookup_code_object.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_code_object_info_s), size_t]
|
775
|
+
except AttributeError:
|
776
|
+
pass
|
777
|
+
try:
|
778
|
+
amd_comgr_map_elf_virtual_address_to_code_object_offset = _libraries['libamd_comgr.so'].amd_comgr_map_elf_virtual_address_to_code_object_offset
|
779
|
+
amd_comgr_map_elf_virtual_address_to_code_object_offset.restype = amd_comgr_status_t
|
780
|
+
amd_comgr_map_elf_virtual_address_to_code_object_offset.argtypes = [amd_comgr_data_t, uint64_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_bool)]
|
781
|
+
except AttributeError:
|
782
|
+
pass
|
783
|
+
__all__ = \
|
784
|
+
['AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES',
|
785
|
+
'AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS',
|
786
|
+
'AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE',
|
787
|
+
'AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY',
|
788
|
+
'AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE',
|
789
|
+
'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC',
|
790
|
+
'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE',
|
791
|
+
'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN',
|
792
|
+
'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE',
|
793
|
+
'AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC',
|
794
|
+
'AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE',
|
795
|
+
'AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE',
|
796
|
+
'AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE',
|
797
|
+
'AMD_COMGR_ACTION_LAST', 'AMD_COMGR_ACTION_LINK_BC_TO_BC',
|
798
|
+
'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE',
|
799
|
+
'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE',
|
800
|
+
'AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC',
|
801
|
+
'AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR',
|
802
|
+
'AMD_COMGR_DATA_KIND_AR', 'AMD_COMGR_DATA_KIND_AR_BUNDLE',
|
803
|
+
'AMD_COMGR_DATA_KIND_BC', 'AMD_COMGR_DATA_KIND_BC_BUNDLE',
|
804
|
+
'AMD_COMGR_DATA_KIND_BYTES', 'AMD_COMGR_DATA_KIND_DIAGNOSTIC',
|
805
|
+
'AMD_COMGR_DATA_KIND_EXECUTABLE', 'AMD_COMGR_DATA_KIND_FATBIN',
|
806
|
+
'AMD_COMGR_DATA_KIND_INCLUDE', 'AMD_COMGR_DATA_KIND_LAST',
|
807
|
+
'AMD_COMGR_DATA_KIND_LOG',
|
808
|
+
'AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER',
|
809
|
+
'AMD_COMGR_DATA_KIND_RELOCATABLE', 'AMD_COMGR_DATA_KIND_SOURCE',
|
810
|
+
'AMD_COMGR_DATA_KIND_UNDEF', 'AMD_COMGR_LANGUAGE_HC',
|
811
|
+
'AMD_COMGR_LANGUAGE_HIP', 'AMD_COMGR_LANGUAGE_LAST',
|
812
|
+
'AMD_COMGR_LANGUAGE_LLVM_IR', 'AMD_COMGR_LANGUAGE_NONE',
|
813
|
+
'AMD_COMGR_LANGUAGE_OPENCL_1_2', 'AMD_COMGR_LANGUAGE_OPENCL_2_0',
|
814
|
+
'AMD_COMGR_METADATA_KIND_LAST', 'AMD_COMGR_METADATA_KIND_LIST',
|
815
|
+
'AMD_COMGR_METADATA_KIND_MAP', 'AMD_COMGR_METADATA_KIND_NULL',
|
816
|
+
'AMD_COMGR_METADATA_KIND_STRING', 'AMD_COMGR_STATUS_ERROR',
|
817
|
+
'AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT',
|
818
|
+
'AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES',
|
819
|
+
'AMD_COMGR_STATUS_SUCCESS', 'AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED',
|
820
|
+
'AMD_COMGR_SYMBOL_INFO_LAST', 'AMD_COMGR_SYMBOL_INFO_NAME',
|
821
|
+
'AMD_COMGR_SYMBOL_INFO_NAME_LENGTH', 'AMD_COMGR_SYMBOL_INFO_SIZE',
|
822
|
+
'AMD_COMGR_SYMBOL_INFO_TYPE', 'AMD_COMGR_SYMBOL_INFO_VALUE',
|
823
|
+
'AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL',
|
824
|
+
'AMD_COMGR_SYMBOL_TYPE_COMMON', 'AMD_COMGR_SYMBOL_TYPE_FILE',
|
825
|
+
'AMD_COMGR_SYMBOL_TYPE_FUNC', 'AMD_COMGR_SYMBOL_TYPE_NOTYPE',
|
826
|
+
'AMD_COMGR_SYMBOL_TYPE_OBJECT', 'AMD_COMGR_SYMBOL_TYPE_SECTION',
|
827
|
+
'AMD_COMGR_SYMBOL_TYPE_UNKNOWN', 'amd_comgr_action_data_count',
|
828
|
+
'amd_comgr_action_data_get_data',
|
829
|
+
'amd_comgr_action_info_get_isa_name',
|
830
|
+
'amd_comgr_action_info_get_language',
|
831
|
+
'amd_comgr_action_info_get_logging',
|
832
|
+
'amd_comgr_action_info_get_option_list_count',
|
833
|
+
'amd_comgr_action_info_get_option_list_item',
|
834
|
+
'amd_comgr_action_info_get_options',
|
835
|
+
'amd_comgr_action_info_get_working_directory_path',
|
836
|
+
'amd_comgr_action_info_set_isa_name',
|
837
|
+
'amd_comgr_action_info_set_language',
|
838
|
+
'amd_comgr_action_info_set_logging',
|
839
|
+
'amd_comgr_action_info_set_option_list',
|
840
|
+
'amd_comgr_action_info_set_options',
|
841
|
+
'amd_comgr_action_info_set_working_directory_path',
|
842
|
+
'amd_comgr_action_info_t', 'amd_comgr_action_kind_s',
|
843
|
+
'amd_comgr_action_kind_t', 'amd_comgr_action_kind_t__enumvalues',
|
844
|
+
'amd_comgr_code_object_info_t', 'amd_comgr_create_action_info',
|
845
|
+
'amd_comgr_create_data', 'amd_comgr_create_data_set',
|
846
|
+
'amd_comgr_create_disassembly_info',
|
847
|
+
'amd_comgr_create_symbolizer_info', 'amd_comgr_data_kind_s',
|
848
|
+
'amd_comgr_data_kind_t', 'amd_comgr_data_kind_t__enumvalues',
|
849
|
+
'amd_comgr_data_set_add', 'amd_comgr_data_set_remove',
|
850
|
+
'amd_comgr_data_set_t', 'amd_comgr_data_t',
|
851
|
+
'amd_comgr_demangle_symbol_name', 'amd_comgr_destroy_action_info',
|
852
|
+
'amd_comgr_destroy_data_set',
|
853
|
+
'amd_comgr_destroy_disassembly_info',
|
854
|
+
'amd_comgr_destroy_metadata', 'amd_comgr_destroy_symbolizer_info',
|
855
|
+
'amd_comgr_disassemble_instruction',
|
856
|
+
'amd_comgr_disassembly_info_t', 'amd_comgr_do_action',
|
857
|
+
'amd_comgr_get_data', 'amd_comgr_get_data_isa_name',
|
858
|
+
'amd_comgr_get_data_kind', 'amd_comgr_get_data_metadata',
|
859
|
+
'amd_comgr_get_data_name', 'amd_comgr_get_isa_count',
|
860
|
+
'amd_comgr_get_isa_metadata', 'amd_comgr_get_isa_name',
|
861
|
+
'amd_comgr_get_mangled_name', 'amd_comgr_get_metadata_kind',
|
862
|
+
'amd_comgr_get_metadata_list_size',
|
863
|
+
'amd_comgr_get_metadata_map_size',
|
864
|
+
'amd_comgr_get_metadata_string', 'amd_comgr_get_version',
|
865
|
+
'amd_comgr_index_list_metadata', 'amd_comgr_iterate_map_metadata',
|
866
|
+
'amd_comgr_iterate_symbols', 'amd_comgr_language_s',
|
867
|
+
'amd_comgr_language_t', 'amd_comgr_language_t__enumvalues',
|
868
|
+
'amd_comgr_lookup_code_object',
|
869
|
+
'amd_comgr_map_elf_virtual_address_to_code_object_offset',
|
870
|
+
'amd_comgr_map_name_expression_to_symbol_name',
|
871
|
+
'amd_comgr_metadata_kind_s', 'amd_comgr_metadata_kind_t',
|
872
|
+
'amd_comgr_metadata_kind_t__enumvalues',
|
873
|
+
'amd_comgr_metadata_lookup', 'amd_comgr_metadata_node_t',
|
874
|
+
'amd_comgr_populate_mangled_names',
|
875
|
+
'amd_comgr_populate_name_expression_map',
|
876
|
+
'amd_comgr_release_data', 'amd_comgr_set_data',
|
877
|
+
'amd_comgr_set_data_from_file_slice', 'amd_comgr_set_data_name',
|
878
|
+
'amd_comgr_status_s', 'amd_comgr_status_string',
|
879
|
+
'amd_comgr_status_t', 'amd_comgr_status_t__enumvalues',
|
880
|
+
'amd_comgr_symbol_get_info', 'amd_comgr_symbol_info_s',
|
881
|
+
'amd_comgr_symbol_info_t', 'amd_comgr_symbol_info_t__enumvalues',
|
882
|
+
'amd_comgr_symbol_lookup', 'amd_comgr_symbol_t',
|
883
|
+
'amd_comgr_symbol_type_s', 'amd_comgr_symbol_type_t',
|
884
|
+
'amd_comgr_symbol_type_t__enumvalues', 'amd_comgr_symbolize',
|
885
|
+
'amd_comgr_symbolizer_info_t', 'size_t',
|
886
|
+
'struct_amd_comgr_action_info_s', 'struct_amd_comgr_data_s',
|
887
|
+
'struct_amd_comgr_data_set_s',
|
888
|
+
'struct_amd_comgr_disassembly_info_s',
|
889
|
+
'struct_amd_comgr_metadata_node_s', 'struct_amd_comgr_symbol_s',
|
890
|
+
'struct_amd_comgr_symbolizer_info_s', 'struct_code_object_info_s',
|
891
|
+
'uint64_t']
|