Files
StarPilot/tinygrad_repo/tinygrad/runtime/autogen/comgr.py
T
firestar5683 22a8575199 Vendor dependencies and resources for standalone builds
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
2026-10-03 21:01:18 +00:00

205 lines
23 KiB
Python

# mypy: disable-error-code="empty-body"
from __future__ import annotations
import ctypes
from typing import Literal, TypeAlias
from tinygrad.runtime.support.c import _IO, _IOW, _IOR, _IOWR
from tinygrad.runtime.support import c
import os
dll = c.DLL('comgr', [os.getenv('ROCM_PATH', '/opt/rocm')+'/lib/libamd_comgr.so', 'amd_comgr'])
amd_comgr_status_s: dict[int, str] = {(AMD_COMGR_STATUS_SUCCESS:=0): 'AMD_COMGR_STATUS_SUCCESS', (AMD_COMGR_STATUS_ERROR:=1): 'AMD_COMGR_STATUS_ERROR', (AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT:=2): 'AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT', (AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES:=3): 'AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES'}
amd_comgr_status_t: TypeAlias = ctypes.c_uint32
amd_comgr_language_s: dict[int, str] = {(AMD_COMGR_LANGUAGE_NONE:=0): 'AMD_COMGR_LANGUAGE_NONE', (AMD_COMGR_LANGUAGE_OPENCL_1_2:=1): 'AMD_COMGR_LANGUAGE_OPENCL_1_2', (AMD_COMGR_LANGUAGE_OPENCL_2_0:=2): 'AMD_COMGR_LANGUAGE_OPENCL_2_0', (AMD_COMGR_LANGUAGE_HC:=3): 'AMD_COMGR_LANGUAGE_HC', (AMD_COMGR_LANGUAGE_HIP:=4): 'AMD_COMGR_LANGUAGE_HIP', (AMD_COMGR_LANGUAGE_LLVM_IR:=5): 'AMD_COMGR_LANGUAGE_LLVM_IR', (AMD_COMGR_LANGUAGE_LAST:=5): 'AMD_COMGR_LANGUAGE_LAST'}
amd_comgr_language_t: TypeAlias = ctypes.c_uint32
@dll.bind(amd_comgr_status_t, amd_comgr_status_t, c.POINTER[c.POINTER[ctypes.c_char]])
def amd_comgr_status_string(status:amd_comgr_status_t, status_string:c.POINTER[c.POINTER[ctypes.c_char]]) -> amd_comgr_status_t: ...
size_t: TypeAlias = ctypes.c_uint64
@dll.bind(None, c.POINTER[size_t], c.POINTER[size_t])
def amd_comgr_get_version(major:c.POINTER[size_t], minor:c.POINTER[size_t]) -> None: ...
amd_comgr_data_kind_s: dict[int, str] = {(AMD_COMGR_DATA_KIND_UNDEF:=0): 'AMD_COMGR_DATA_KIND_UNDEF', (AMD_COMGR_DATA_KIND_SOURCE:=1): 'AMD_COMGR_DATA_KIND_SOURCE', (AMD_COMGR_DATA_KIND_INCLUDE:=2): 'AMD_COMGR_DATA_KIND_INCLUDE', (AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER:=3): 'AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER', (AMD_COMGR_DATA_KIND_DIAGNOSTIC:=4): 'AMD_COMGR_DATA_KIND_DIAGNOSTIC', (AMD_COMGR_DATA_KIND_LOG:=5): 'AMD_COMGR_DATA_KIND_LOG', (AMD_COMGR_DATA_KIND_BC:=6): 'AMD_COMGR_DATA_KIND_BC', (AMD_COMGR_DATA_KIND_RELOCATABLE:=7): 'AMD_COMGR_DATA_KIND_RELOCATABLE', (AMD_COMGR_DATA_KIND_EXECUTABLE:=8): 'AMD_COMGR_DATA_KIND_EXECUTABLE', (AMD_COMGR_DATA_KIND_BYTES:=9): 'AMD_COMGR_DATA_KIND_BYTES', (AMD_COMGR_DATA_KIND_FATBIN:=16): 'AMD_COMGR_DATA_KIND_FATBIN', (AMD_COMGR_DATA_KIND_AR:=17): 'AMD_COMGR_DATA_KIND_AR', (AMD_COMGR_DATA_KIND_BC_BUNDLE:=18): 'AMD_COMGR_DATA_KIND_BC_BUNDLE', (AMD_COMGR_DATA_KIND_AR_BUNDLE:=19): 'AMD_COMGR_DATA_KIND_AR_BUNDLE', (AMD_COMGR_DATA_KIND_OBJ_BUNDLE:=20): 'AMD_COMGR_DATA_KIND_OBJ_BUNDLE', (AMD_COMGR_DATA_KIND_LAST:=20): 'AMD_COMGR_DATA_KIND_LAST'}
amd_comgr_data_kind_t: TypeAlias = ctypes.c_uint32
@c.record
class amd_comgr_data_s(c.Struct):
SIZE = 8
handle: int
uint64_t: TypeAlias = ctypes.c_uint64
amd_comgr_data_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_data_t: TypeAlias = amd_comgr_data_s
@c.record
class amd_comgr_data_set_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_data_set_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_data_set_t: TypeAlias = amd_comgr_data_set_s
@c.record
class amd_comgr_action_info_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_action_info_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_action_info_t: TypeAlias = amd_comgr_action_info_s
@c.record
class amd_comgr_metadata_node_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_metadata_node_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_metadata_node_t: TypeAlias = amd_comgr_metadata_node_s
@c.record
class amd_comgr_symbol_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_symbol_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_symbol_t: TypeAlias = amd_comgr_symbol_s
@c.record
class amd_comgr_disassembly_info_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_disassembly_info_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_disassembly_info_t: TypeAlias = amd_comgr_disassembly_info_s
@c.record
class amd_comgr_symbolizer_info_s(c.Struct):
SIZE = 8
handle: int
amd_comgr_symbolizer_info_s.register_fields([('handle', uint64_t, 0)])
amd_comgr_symbolizer_info_t: TypeAlias = amd_comgr_symbolizer_info_s
@dll.bind(amd_comgr_status_t, c.POINTER[size_t])
def amd_comgr_get_isa_count(count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, size_t, c.POINTER[c.POINTER[ctypes.c_char]])
def amd_comgr_get_isa_name(index:size_t, isa_name:c.POINTER[c.POINTER[ctypes.c_char]]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, c.POINTER[ctypes.c_char], c.POINTER[amd_comgr_metadata_node_t])
def amd_comgr_get_isa_metadata(isa_name:c.POINTER[ctypes.c_char], metadata:c.POINTER[amd_comgr_metadata_node_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_kind_t, c.POINTER[amd_comgr_data_t])
def amd_comgr_create_data(kind:amd_comgr_data_kind_t, data:c.POINTER[amd_comgr_data_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t)
def amd_comgr_release_data(data:amd_comgr_data_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[amd_comgr_data_kind_t])
def amd_comgr_get_data_kind(data:amd_comgr_data_t, kind:c.POINTER[amd_comgr_data_kind_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, size_t, c.POINTER[ctypes.c_char])
def amd_comgr_set_data(data:amd_comgr_data_t, size:size_t, bytes:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, ctypes.c_int32, uint64_t, uint64_t)
def amd_comgr_set_data_from_file_slice(data:amd_comgr_data_t, file_descriptor:int, offset:uint64_t, size:uint64_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[ctypes.c_char])
def amd_comgr_set_data_name(data:amd_comgr_data_t, name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_get_data(data:amd_comgr_data_t, size:c.POINTER[size_t], bytes:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_get_data_name(data:amd_comgr_data_t, size:c.POINTER[size_t], name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_get_data_isa_name(data:amd_comgr_data_t, size:c.POINTER[size_t], isa_name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.CFUNCTYPE[None, [c.POINTER[ctypes.c_char], ctypes.c_void_p]], c.POINTER[amd_comgr_symbolizer_info_t])
def amd_comgr_create_symbolizer_info(code_object:amd_comgr_data_t, print_symbol_callback:c.CFUNCTYPE[None, [c.POINTER[ctypes.c_char], ctypes.c_void_p]], symbolizer_info:c.POINTER[amd_comgr_symbolizer_info_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_symbolizer_info_t)
def amd_comgr_destroy_symbolizer_info(symbolizer_info:amd_comgr_symbolizer_info_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_symbolizer_info_t, uint64_t, ctypes.c_bool, ctypes.c_void_p)
def amd_comgr_symbolize(symbolizer_info:amd_comgr_symbolizer_info_t, address:uint64_t, is_code:bool, user_data:ctypes.c_void_p) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[amd_comgr_metadata_node_t])
def amd_comgr_get_data_metadata(data:amd_comgr_data_t, metadata:c.POINTER[amd_comgr_metadata_node_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t)
def amd_comgr_destroy_metadata(metadata:amd_comgr_metadata_node_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, c.POINTER[amd_comgr_data_set_t])
def amd_comgr_create_data_set(data_set:c.POINTER[amd_comgr_data_set_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_set_t)
def amd_comgr_destroy_data_set(data_set:amd_comgr_data_set_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_set_t, amd_comgr_data_t)
def amd_comgr_data_set_add(data_set:amd_comgr_data_set_t, data:amd_comgr_data_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_set_t, amd_comgr_data_kind_t)
def amd_comgr_data_set_remove(data_set:amd_comgr_data_set_t, data_kind:amd_comgr_data_kind_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_set_t, amd_comgr_data_kind_t, c.POINTER[size_t])
def amd_comgr_action_data_count(data_set:amd_comgr_data_set_t, data_kind:amd_comgr_data_kind_t, count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_set_t, amd_comgr_data_kind_t, size_t, c.POINTER[amd_comgr_data_t])
def amd_comgr_action_data_get_data(data_set:amd_comgr_data_set_t, data_kind:amd_comgr_data_kind_t, index:size_t, data:c.POINTER[amd_comgr_data_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, c.POINTER[amd_comgr_action_info_t])
def amd_comgr_create_action_info(action_info:c.POINTER[amd_comgr_action_info_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t)
def amd_comgr_destroy_action_info(action_info:amd_comgr_action_info_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[ctypes.c_char])
def amd_comgr_action_info_set_isa_name(action_info:amd_comgr_action_info_t, isa_name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_action_info_get_isa_name(action_info:amd_comgr_action_info_t, size:c.POINTER[size_t], isa_name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, amd_comgr_language_t)
def amd_comgr_action_info_set_language(action_info:amd_comgr_action_info_t, language:amd_comgr_language_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[amd_comgr_language_t])
def amd_comgr_action_info_get_language(action_info:amd_comgr_action_info_t, language:c.POINTER[amd_comgr_language_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[ctypes.c_char])
def amd_comgr_action_info_set_options(action_info:amd_comgr_action_info_t, options:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_action_info_get_options(action_info:amd_comgr_action_info_t, size:c.POINTER[size_t], options:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.Array[c.POINTER[ctypes.c_char], Literal[0]], size_t)
def amd_comgr_action_info_set_option_list(action_info:amd_comgr_action_info_t, options:c.Array[c.POINTER[ctypes.c_char], Literal[0]], count:size_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[size_t])
def amd_comgr_action_info_get_option_list_count(action_info:amd_comgr_action_info_t, count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, size_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_action_info_get_option_list_item(action_info:amd_comgr_action_info_t, index:size_t, size:c.POINTER[size_t], option:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.Array[c.POINTER[ctypes.c_char], Literal[0]], size_t)
def amd_comgr_action_info_set_bundle_entry_ids(action_info:amd_comgr_action_info_t, bundle_entry_ids:c.Array[c.POINTER[ctypes.c_char], Literal[0]], count:size_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[size_t])
def amd_comgr_action_info_get_bundle_entry_id_count(action_info:amd_comgr_action_info_t, count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, size_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_action_info_get_bundle_entry_id(action_info:amd_comgr_action_info_t, index:size_t, size:c.POINTER[size_t], bundle_entry_id:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[ctypes.c_char])
def amd_comgr_action_info_set_working_directory_path(action_info:amd_comgr_action_info_t, path:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_action_info_get_working_directory_path(action_info:amd_comgr_action_info_t, size:c.POINTER[size_t], path:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, ctypes.c_bool)
def amd_comgr_action_info_set_logging(action_info:amd_comgr_action_info_t, logging:bool) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_action_info_t, c.POINTER[ctypes.c_bool])
def amd_comgr_action_info_get_logging(action_info:amd_comgr_action_info_t, logging:c.POINTER[ctypes.c_bool]) -> amd_comgr_status_t: ...
amd_comgr_action_kind_s: dict[int, str] = {(AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR:=0): 'AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR', (AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS:=1): 'AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS', (AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC:=2): 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC', (AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES:=3): 'AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES', (AMD_COMGR_ACTION_LINK_BC_TO_BC:=4): 'AMD_COMGR_ACTION_LINK_BC_TO_BC', (AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC:=5): 'AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC', (AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE:=6): 'AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE', (AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY:=7): 'AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY', (AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE:=8): 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE', (AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE:=9): 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE', (AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE:=10): 'AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE', (AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE:=11): 'AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE', (AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE:=12): 'AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE', (AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE:=13): 'AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE', (AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN:=14): 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN', (AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC:=15): 'AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC', (AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE:=16): 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_RELOCATABLE', (AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE:=17): 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_EXECUTABLE', (AMD_COMGR_ACTION_UNBUNDLE:=18): 'AMD_COMGR_ACTION_UNBUNDLE', (AMD_COMGR_ACTION_LAST:=18): 'AMD_COMGR_ACTION_LAST'}
amd_comgr_action_kind_t: TypeAlias = ctypes.c_uint32
@dll.bind(amd_comgr_status_t, amd_comgr_action_kind_t, amd_comgr_action_info_t, amd_comgr_data_set_t, amd_comgr_data_set_t)
def amd_comgr_do_action(kind:amd_comgr_action_kind_t, info:amd_comgr_action_info_t, input:amd_comgr_data_set_t, result:amd_comgr_data_set_t) -> amd_comgr_status_t: ...
amd_comgr_metadata_kind_s: dict[int, str] = {(AMD_COMGR_METADATA_KIND_NULL:=0): 'AMD_COMGR_METADATA_KIND_NULL', (AMD_COMGR_METADATA_KIND_STRING:=1): 'AMD_COMGR_METADATA_KIND_STRING', (AMD_COMGR_METADATA_KIND_MAP:=2): 'AMD_COMGR_METADATA_KIND_MAP', (AMD_COMGR_METADATA_KIND_LIST:=3): 'AMD_COMGR_METADATA_KIND_LIST', (AMD_COMGR_METADATA_KIND_LAST:=3): 'AMD_COMGR_METADATA_KIND_LAST'}
amd_comgr_metadata_kind_t: TypeAlias = ctypes.c_uint32
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.POINTER[amd_comgr_metadata_kind_t])
def amd_comgr_get_metadata_kind(metadata:amd_comgr_metadata_node_t, kind:c.POINTER[amd_comgr_metadata_kind_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_get_metadata_string(metadata:amd_comgr_metadata_node_t, size:c.POINTER[size_t], string:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.POINTER[size_t])
def amd_comgr_get_metadata_map_size(metadata:amd_comgr_metadata_node_t, size:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.CFUNCTYPE[amd_comgr_status_t, [amd_comgr_metadata_node_t, amd_comgr_metadata_node_t, ctypes.c_void_p]], ctypes.c_void_p)
def amd_comgr_iterate_map_metadata(metadata:amd_comgr_metadata_node_t, callback:c.CFUNCTYPE[amd_comgr_status_t, [amd_comgr_metadata_node_t, amd_comgr_metadata_node_t, ctypes.c_void_p]], user_data:ctypes.c_void_p) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.POINTER[ctypes.c_char], c.POINTER[amd_comgr_metadata_node_t])
def amd_comgr_metadata_lookup(metadata:amd_comgr_metadata_node_t, key:c.POINTER[ctypes.c_char], value:c.POINTER[amd_comgr_metadata_node_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, c.POINTER[size_t])
def amd_comgr_get_metadata_list_size(metadata:amd_comgr_metadata_node_t, size:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_metadata_node_t, size_t, c.POINTER[amd_comgr_metadata_node_t])
def amd_comgr_index_list_metadata(metadata:amd_comgr_metadata_node_t, index:size_t, value:c.POINTER[amd_comgr_metadata_node_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.CFUNCTYPE[amd_comgr_status_t, [amd_comgr_symbol_t, ctypes.c_void_p]], ctypes.c_void_p)
def amd_comgr_iterate_symbols(data:amd_comgr_data_t, callback:c.CFUNCTYPE[amd_comgr_status_t, [amd_comgr_symbol_t, ctypes.c_void_p]], user_data:ctypes.c_void_p) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[ctypes.c_char], c.POINTER[amd_comgr_symbol_t])
def amd_comgr_symbol_lookup(data:amd_comgr_data_t, name:c.POINTER[ctypes.c_char], symbol:c.POINTER[amd_comgr_symbol_t]) -> amd_comgr_status_t: ...
amd_comgr_symbol_type_s: dict[int, str] = {(AMD_COMGR_SYMBOL_TYPE_UNKNOWN:=-1): 'AMD_COMGR_SYMBOL_TYPE_UNKNOWN', (AMD_COMGR_SYMBOL_TYPE_NOTYPE:=0): 'AMD_COMGR_SYMBOL_TYPE_NOTYPE', (AMD_COMGR_SYMBOL_TYPE_OBJECT:=1): 'AMD_COMGR_SYMBOL_TYPE_OBJECT', (AMD_COMGR_SYMBOL_TYPE_FUNC:=2): 'AMD_COMGR_SYMBOL_TYPE_FUNC', (AMD_COMGR_SYMBOL_TYPE_SECTION:=3): 'AMD_COMGR_SYMBOL_TYPE_SECTION', (AMD_COMGR_SYMBOL_TYPE_FILE:=4): 'AMD_COMGR_SYMBOL_TYPE_FILE', (AMD_COMGR_SYMBOL_TYPE_COMMON:=5): 'AMD_COMGR_SYMBOL_TYPE_COMMON', (AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL:=10): 'AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL'}
amd_comgr_symbol_type_t: TypeAlias = ctypes.c_int32
amd_comgr_symbol_info_s: dict[int, str] = {(AMD_COMGR_SYMBOL_INFO_NAME_LENGTH:=0): 'AMD_COMGR_SYMBOL_INFO_NAME_LENGTH', (AMD_COMGR_SYMBOL_INFO_NAME:=1): 'AMD_COMGR_SYMBOL_INFO_NAME', (AMD_COMGR_SYMBOL_INFO_TYPE:=2): 'AMD_COMGR_SYMBOL_INFO_TYPE', (AMD_COMGR_SYMBOL_INFO_SIZE:=3): 'AMD_COMGR_SYMBOL_INFO_SIZE', (AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED:=4): 'AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED', (AMD_COMGR_SYMBOL_INFO_VALUE:=5): 'AMD_COMGR_SYMBOL_INFO_VALUE', (AMD_COMGR_SYMBOL_INFO_LAST:=5): 'AMD_COMGR_SYMBOL_INFO_LAST'}
amd_comgr_symbol_info_t: TypeAlias = ctypes.c_uint32
@dll.bind(amd_comgr_status_t, amd_comgr_symbol_t, amd_comgr_symbol_info_t, ctypes.c_void_p)
def amd_comgr_symbol_get_info(symbol:amd_comgr_symbol_t, attribute:amd_comgr_symbol_info_t, value:ctypes.c_void_p) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, c.POINTER[ctypes.c_char], c.CFUNCTYPE[uint64_t, [uint64_t, c.POINTER[ctypes.c_char], uint64_t, ctypes.c_void_p]], c.CFUNCTYPE[None, [c.POINTER[ctypes.c_char], ctypes.c_void_p]], c.CFUNCTYPE[None, [uint64_t, ctypes.c_void_p]], c.POINTER[amd_comgr_disassembly_info_t])
def amd_comgr_create_disassembly_info(isa_name:c.POINTER[ctypes.c_char], read_memory_callback:c.CFUNCTYPE[uint64_t, [uint64_t, c.POINTER[ctypes.c_char], uint64_t, ctypes.c_void_p]], print_instruction_callback:c.CFUNCTYPE[None, [c.POINTER[ctypes.c_char], ctypes.c_void_p]], print_address_annotation_callback:c.CFUNCTYPE[None, [uint64_t, ctypes.c_void_p]], disassembly_info:c.POINTER[amd_comgr_disassembly_info_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_disassembly_info_t)
def amd_comgr_destroy_disassembly_info(disassembly_info:amd_comgr_disassembly_info_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_disassembly_info_t, uint64_t, ctypes.c_void_p, c.POINTER[uint64_t])
def amd_comgr_disassemble_instruction(disassembly_info:amd_comgr_disassembly_info_t, address:uint64_t, user_data:ctypes.c_void_p, size:c.POINTER[uint64_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[amd_comgr_data_t])
def amd_comgr_demangle_symbol_name(mangled_symbol_name:amd_comgr_data_t, demangled_symbol_name:c.POINTER[amd_comgr_data_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t])
def amd_comgr_populate_mangled_names(data:amd_comgr_data_t, count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, size_t, c.POINTER[size_t], c.POINTER[ctypes.c_char])
def amd_comgr_get_mangled_name(data:amd_comgr_data_t, index:size_t, size:c.POINTER[size_t], mangled_name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t])
def amd_comgr_populate_name_expression_map(data:amd_comgr_data_t, count:c.POINTER[size_t]) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[size_t], c.POINTER[ctypes.c_char], c.POINTER[ctypes.c_char])
def amd_comgr_map_name_expression_to_symbol_name(data:amd_comgr_data_t, size:c.POINTER[size_t], name_expression:c.POINTER[ctypes.c_char], symbol_name:c.POINTER[ctypes.c_char]) -> amd_comgr_status_t: ...
@c.record
class code_object_info_s(c.Struct):
SIZE = 24
isa: c.POINTER[ctypes.c_char]
size: int
offset: int
code_object_info_s.register_fields([('isa', c.POINTER[ctypes.c_char], 0), ('size', size_t, 8), ('offset', uint64_t, 16)])
amd_comgr_code_object_info_t: TypeAlias = code_object_info_s
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, c.POINTER[amd_comgr_code_object_info_t], size_t)
def amd_comgr_lookup_code_object(data:amd_comgr_data_t, info_list:c.POINTER[amd_comgr_code_object_info_t], info_list_size:size_t) -> amd_comgr_status_t: ...
@dll.bind(amd_comgr_status_t, amd_comgr_data_t, uint64_t, c.POINTER[uint64_t], c.POINTER[uint64_t], c.POINTER[ctypes.c_bool])
def amd_comgr_map_elf_virtual_address_to_code_object_offset(data:amd_comgr_data_t, elf_virtual_address:uint64_t, code_object_offset:c.POINTER[uint64_t], slice_size:c.POINTER[uint64_t], nobits:c.POINTER[ctypes.c_bool]) -> amd_comgr_status_t: ...
AMD_COMGR_DEPRECATED = lambda msg: __attribute__((deprecated(msg))) # type: ignore
AMD_COMGR_INTERFACE_VERSION_MAJOR = 2
AMD_COMGR_INTERFACE_VERSION_MINOR = 8