diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 898c7f5..97cc277 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,10 +39,8 @@ jobs: - name: Install HIP if: ${{ matrix.task == 'hip' }} run: | - sudo mkdir --parents --mode=0755 /etc/apt/keyrings - wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | gpg --dearmor | sudo tee /etc/apt/keyrings/rocm.gpg > /dev/null - echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/5.7.1 jammy main" | sudo tee --append /etc/apt/sources.list.d/rocm.list - echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 + wget https://repo.radeon.com/amdgpu-install/6.0/ubuntu/jammy/amdgpu-install_6.0.60000-1_all.deb + sudo apt install ./amdgpu-install_6.0.60000-1_all.deb sudo apt update -y sudo apt install -y --no-install-recommends rocm-hip-sdk - name: Install CUDA diff --git a/generate_hip.sh b/generate_hip.sh index ea84963..74d7bfe 100755 --- a/generate_hip.sh +++ b/generate_hip.sh @@ -1,8 +1,17 @@ #!/bin/bash -e -clang2py /opt/rocm/include/hip/hiprtc.h /opt/rocm/include/hip/hip_runtime_api.h /opt/rocm/include/hip/driver_types.h --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include" -o gpuctypes/hip.py -l /opt/rocm/lib/libhiprtc.so -l /opt/rocm/lib/libamdhip64.so +clang2py /opt/rocm/include/hip/hip_ext.h /opt/rocm/include/hip/hiprtc.h \ + /opt/rocm/include/hip/hip_runtime_api.h /opt/rocm/include/hip/driver_types.h \ + --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include -x c++" -o gpuctypes/hip.py -l /opt/rocm/lib/libamdhip64.so +echo "hipDeviceProp_t = hipDeviceProp_tR0600" >> gpuctypes/hip.py +echo "hipGetDeviceProperties = hipGetDevicePropertiesR0600" >> gpuctypes/hip.py grep FIXME_STUB gpuctypes/hip.py || true # we can trust HIP is always at /opt/rocm/lib #sed -i "s\import ctypes\import ctypes, ctypes.util\g" gpuctypes/hip.py #sed -i "s\ctypes.CDLL('/opt/rocm/lib/libhiprtc.so')\ctypes.CDLL(ctypes.util.find_library('hiprtc'))\g" gpuctypes/hip.py #sed -i "s\ctypes.CDLL('/opt/rocm/lib/libamdhip64.so')\ctypes.CDLL(ctypes.util.find_library('amdhip64'))\g" gpuctypes/hip.py python3 -c "import gpuctypes.hip" + +clang2py /opt/rocm/include/amd_comgr/amd_comgr.h \ + --clang-args="-D__HIP_PLATFORM_AMD__ -I/opt/rocm/include -x c++" -o gpuctypes/comgr.py -l /opt/rocm/lib/libamd_comgr.so +grep FIXME_STUB gpuctypes/comgr.py || true +python3 -c "import gpuctypes.comgr" diff --git a/gpuctypes/comgr.py b/gpuctypes/comgr.py new file mode 100644 index 0000000..6c4254f --- /dev/null +++ b/gpuctypes/comgr.py @@ -0,0 +1,864 @@ +# -*- coding: utf-8 -*- +# +# TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include', '-x', 'c++'] +# WORD_SIZE is: 8 +# POINTER_SIZE is: 8 +# LONGDOUBLE_SIZE is: 16 +# +import ctypes + + +def string_cast(char_pointer, encoding='utf-8', errors='strict'): + value = ctypes.cast(char_pointer, ctypes.c_char_p).value + if value is not None and encoding is not None: + value = value.decode(encoding, errors=errors) + return value + + +def char_pointer_cast(string, encoding='utf-8'): + if encoding is not None: + try: + string = string.encode(encoding) + except AttributeError: + # In Python3, bytes has no encode attribute + pass + string = ctypes.c_char_p(string) + return ctypes.cast(string, ctypes.POINTER(ctypes.c_char)) + + + +_libraries = {} +_libraries['libamd_comgr.so'] = ctypes.CDLL('/opt/rocm/lib/libamd_comgr.so') +c_int128 = ctypes.c_ubyte*16 +c_uint128 = c_int128 +void = None +if ctypes.sizeof(ctypes.c_longdouble) == 16: + c_long_double_t = ctypes.c_longdouble +else: + c_long_double_t = ctypes.c_ubyte*16 + +class AsDictMixin: + @classmethod + def as_dict(cls, self): + result = {} + if not isinstance(self, AsDictMixin): + # not a structure, assume it's already a python object + return self + if not hasattr(cls, "_fields_"): + return result + # sys.version_info >= (3, 5) + # for (field, *_) in cls._fields_: # noqa + for field_tuple in cls._fields_: # noqa + field = field_tuple[0] + if field.startswith('PADDING_'): + continue + value = getattr(self, field) + type_ = type(value) + if hasattr(value, "_length_") and hasattr(value, "_type_"): + # array + if not hasattr(type_, "as_dict"): + value = [v for v in value] + else: + type_ = type_._type_ + value = [type_.as_dict(v) for v in value] + elif hasattr(value, "contents") and hasattr(value, "_type_"): + # pointer + try: + if not hasattr(type_, "as_dict"): + value = value.contents + else: + type_ = type_._type_ + value = type_.as_dict(value.contents) + except ValueError: + # nullptr + value = None + elif isinstance(value, AsDictMixin): + # other structure + value = type_.as_dict(value) + result[field] = value + return result + + +class Structure(ctypes.Structure, AsDictMixin): + + def __init__(self, *args, **kwds): + # We don't want to use positional arguments fill PADDING_* fields + + args = dict(zip(self.__class__._field_names_(), args)) + args.update(kwds) + super(Structure, self).__init__(**args) + + @classmethod + def _field_names_(cls): + if hasattr(cls, '_fields_'): + return (f[0] for f in cls._fields_ if not f[0].startswith('PADDING')) + else: + return () + + @classmethod + def get_type(cls, field): + for f in cls._fields_: + if f[0] == field: + return f[1] + return None + + @classmethod + def bind(cls, bound_fields): + fields = {} + for name, type_ in cls._fields_: + if hasattr(type_, "restype"): + if name in bound_fields: + if bound_fields[name] is None: + fields[name] = type_() + else: + # use a closure to capture the callback from the loop scope + fields[name] = ( + type_((lambda callback: lambda *args: callback(*args))( + bound_fields[name])) + ) + del bound_fields[name] + else: + # default callback implementation (does nothing) + try: + default_ = type_(0).restype().value + except TypeError: + default_ = None + fields[name] = type_(( + lambda default_: lambda *args: default_)(default_)) + else: + # not a callback function, use default initialization + if name in bound_fields: + fields[name] = bound_fields[name] + del bound_fields[name] + else: + fields[name] = type_() + if len(bound_fields) != 0: + raise ValueError( + "Cannot bind the following unknown callback(s) {}.{}".format( + cls.__name__, bound_fields.keys() + )) + return cls(**fields) + + +class Union(ctypes.Union, AsDictMixin): + pass + + + + + + +# values for enumeration 'amd_comgr_status_s' +amd_comgr_status_s__enumvalues = { + 0: 'AMD_COMGR_STATUS_SUCCESS', + 1: 'AMD_COMGR_STATUS_ERROR', + 2: 'AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT', + 3: 'AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES', +} +AMD_COMGR_STATUS_SUCCESS = 0 +AMD_COMGR_STATUS_ERROR = 1 +AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT = 2 +AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES = 3 +amd_comgr_status_s = ctypes.c_uint32 # enum +amd_comgr_status_t = amd_comgr_status_s +amd_comgr_status_t__enumvalues = amd_comgr_status_s__enumvalues + +# values for enumeration 'amd_comgr_language_s' +amd_comgr_language_s__enumvalues = { + 0: 'AMD_COMGR_LANGUAGE_NONE', + 1: 'AMD_COMGR_LANGUAGE_OPENCL_1_2', + 2: 'AMD_COMGR_LANGUAGE_OPENCL_2_0', + 3: 'AMD_COMGR_LANGUAGE_HC', + 4: 'AMD_COMGR_LANGUAGE_HIP', + 4: 'AMD_COMGR_LANGUAGE_LAST', +} +AMD_COMGR_LANGUAGE_NONE = 0 +AMD_COMGR_LANGUAGE_OPENCL_1_2 = 1 +AMD_COMGR_LANGUAGE_OPENCL_2_0 = 2 +AMD_COMGR_LANGUAGE_HC = 3 +AMD_COMGR_LANGUAGE_HIP = 4 +AMD_COMGR_LANGUAGE_LAST = 4 +amd_comgr_language_s = ctypes.c_uint32 # enum +amd_comgr_language_t = amd_comgr_language_s +amd_comgr_language_t__enumvalues = amd_comgr_language_s__enumvalues +try: + amd_comgr_status_string = _libraries['libamd_comgr.so'].amd_comgr_status_string + amd_comgr_status_string.restype = amd_comgr_status_t + amd_comgr_status_string.argtypes = [amd_comgr_status_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] +except AttributeError: + pass +try: + amd_comgr_get_version = _libraries['libamd_comgr.so'].amd_comgr_get_version + amd_comgr_get_version.restype = None + amd_comgr_get_version.argtypes = [ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass + +# values for enumeration 'amd_comgr_data_kind_s' +amd_comgr_data_kind_s__enumvalues = { + 0: 'AMD_COMGR_DATA_KIND_UNDEF', + 1: 'AMD_COMGR_DATA_KIND_SOURCE', + 2: 'AMD_COMGR_DATA_KIND_INCLUDE', + 3: 'AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER', + 4: 'AMD_COMGR_DATA_KIND_DIAGNOSTIC', + 5: 'AMD_COMGR_DATA_KIND_LOG', + 6: 'AMD_COMGR_DATA_KIND_BC', + 7: 'AMD_COMGR_DATA_KIND_RELOCATABLE', + 8: 'AMD_COMGR_DATA_KIND_EXECUTABLE', + 9: 'AMD_COMGR_DATA_KIND_BYTES', + 16: 'AMD_COMGR_DATA_KIND_FATBIN', + 17: 'AMD_COMGR_DATA_KIND_AR', + 18: 'AMD_COMGR_DATA_KIND_BC_BUNDLE', + 19: 'AMD_COMGR_DATA_KIND_AR_BUNDLE', + 19: 'AMD_COMGR_DATA_KIND_LAST', +} +AMD_COMGR_DATA_KIND_UNDEF = 0 +AMD_COMGR_DATA_KIND_SOURCE = 1 +AMD_COMGR_DATA_KIND_INCLUDE = 2 +AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER = 3 +AMD_COMGR_DATA_KIND_DIAGNOSTIC = 4 +AMD_COMGR_DATA_KIND_LOG = 5 +AMD_COMGR_DATA_KIND_BC = 6 +AMD_COMGR_DATA_KIND_RELOCATABLE = 7 +AMD_COMGR_DATA_KIND_EXECUTABLE = 8 +AMD_COMGR_DATA_KIND_BYTES = 9 +AMD_COMGR_DATA_KIND_FATBIN = 16 +AMD_COMGR_DATA_KIND_AR = 17 +AMD_COMGR_DATA_KIND_BC_BUNDLE = 18 +AMD_COMGR_DATA_KIND_AR_BUNDLE = 19 +AMD_COMGR_DATA_KIND_LAST = 19 +amd_comgr_data_kind_s = ctypes.c_uint32 # enum +amd_comgr_data_kind_t = amd_comgr_data_kind_s +amd_comgr_data_kind_t__enumvalues = amd_comgr_data_kind_s__enumvalues +class struct_amd_comgr_data_s(Structure): + pass + +struct_amd_comgr_data_s._pack_ = 1 # source:False +struct_amd_comgr_data_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_data_t = struct_amd_comgr_data_s +class struct_amd_comgr_data_set_s(Structure): + pass + +struct_amd_comgr_data_set_s._pack_ = 1 # source:False +struct_amd_comgr_data_set_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_data_set_t = struct_amd_comgr_data_set_s +class struct_amd_comgr_action_info_s(Structure): + pass + +struct_amd_comgr_action_info_s._pack_ = 1 # source:False +struct_amd_comgr_action_info_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_action_info_t = struct_amd_comgr_action_info_s +class struct_amd_comgr_metadata_node_s(Structure): + pass + +struct_amd_comgr_metadata_node_s._pack_ = 1 # source:False +struct_amd_comgr_metadata_node_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_metadata_node_t = struct_amd_comgr_metadata_node_s +class struct_amd_comgr_symbol_s(Structure): + pass + +struct_amd_comgr_symbol_s._pack_ = 1 # source:False +struct_amd_comgr_symbol_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_symbol_t = struct_amd_comgr_symbol_s +class struct_amd_comgr_disassembly_info_s(Structure): + pass + +struct_amd_comgr_disassembly_info_s._pack_ = 1 # source:False +struct_amd_comgr_disassembly_info_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_disassembly_info_t = struct_amd_comgr_disassembly_info_s +class struct_amd_comgr_symbolizer_info_s(Structure): + pass + +struct_amd_comgr_symbolizer_info_s._pack_ = 1 # source:False +struct_amd_comgr_symbolizer_info_s._fields_ = [ + ('handle', ctypes.c_uint64), +] + +amd_comgr_symbolizer_info_t = struct_amd_comgr_symbolizer_info_s +try: + amd_comgr_get_isa_count = _libraries['libamd_comgr.so'].amd_comgr_get_isa_count + amd_comgr_get_isa_count.restype = amd_comgr_status_t + amd_comgr_get_isa_count.argtypes = [ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +size_t = ctypes.c_uint64 +try: + amd_comgr_get_isa_name = _libraries['libamd_comgr.so'].amd_comgr_get_isa_name + amd_comgr_get_isa_name.restype = amd_comgr_status_t + amd_comgr_get_isa_name.argtypes = [size_t, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] +except AttributeError: + pass +try: + amd_comgr_get_isa_metadata = _libraries['libamd_comgr.so'].amd_comgr_get_isa_metadata + amd_comgr_get_isa_metadata.restype = amd_comgr_status_t + amd_comgr_get_isa_metadata.argtypes = [ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_metadata_node_s)] +except AttributeError: + pass +try: + amd_comgr_create_data = _libraries['libamd_comgr.so'].amd_comgr_create_data + amd_comgr_create_data.restype = amd_comgr_status_t + amd_comgr_create_data.argtypes = [amd_comgr_data_kind_t, ctypes.POINTER(struct_amd_comgr_data_s)] +except AttributeError: + pass +try: + amd_comgr_release_data = _libraries['libamd_comgr.so'].amd_comgr_release_data + amd_comgr_release_data.restype = amd_comgr_status_t + amd_comgr_release_data.argtypes = [amd_comgr_data_t] +except AttributeError: + pass +try: + amd_comgr_get_data_kind = _libraries['libamd_comgr.so'].amd_comgr_get_data_kind + amd_comgr_get_data_kind.restype = amd_comgr_status_t + amd_comgr_get_data_kind.argtypes = [amd_comgr_data_t, ctypes.POINTER(amd_comgr_data_kind_s)] +except AttributeError: + pass +try: + amd_comgr_set_data = _libraries['libamd_comgr.so'].amd_comgr_set_data + amd_comgr_set_data.restype = amd_comgr_status_t + amd_comgr_set_data.argtypes = [amd_comgr_data_t, size_t, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +uint64_t = ctypes.c_uint64 +try: + amd_comgr_set_data_from_file_slice = _libraries['libamd_comgr.so'].amd_comgr_set_data_from_file_slice + amd_comgr_set_data_from_file_slice.restype = amd_comgr_status_t + amd_comgr_set_data_from_file_slice.argtypes = [amd_comgr_data_t, ctypes.c_int32, uint64_t, uint64_t] +except AttributeError: + pass +try: + amd_comgr_set_data_name = _libraries['libamd_comgr.so'].amd_comgr_set_data_name + amd_comgr_set_data_name.restype = amd_comgr_status_t + amd_comgr_set_data_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_get_data = _libraries['libamd_comgr.so'].amd_comgr_get_data + amd_comgr_get_data.restype = amd_comgr_status_t + amd_comgr_get_data.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_get_data_name = _libraries['libamd_comgr.so'].amd_comgr_get_data_name + amd_comgr_get_data_name.restype = amd_comgr_status_t + amd_comgr_get_data_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_get_data_isa_name = _libraries['libamd_comgr.so'].amd_comgr_get_data_isa_name + amd_comgr_get_data_isa_name.restype = amd_comgr_status_t + amd_comgr_get_data_isa_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_create_symbolizer_info = _libraries['libamd_comgr.so'].amd_comgr_create_symbolizer_info + amd_comgr_create_symbolizer_info.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_destroy_symbolizer_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_symbolizer_info + amd_comgr_destroy_symbolizer_info.restype = amd_comgr_status_t + amd_comgr_destroy_symbolizer_info.argtypes = [amd_comgr_symbolizer_info_t] +except AttributeError: + pass +try: + amd_comgr_symbolize = _libraries['libamd_comgr.so'].amd_comgr_symbolize + amd_comgr_symbolize.restype = amd_comgr_status_t + amd_comgr_symbolize.argtypes = [amd_comgr_symbolizer_info_t, uint64_t, ctypes.c_bool, ctypes.POINTER(None)] +except AttributeError: + pass +try: + amd_comgr_get_data_metadata = _libraries['libamd_comgr.so'].amd_comgr_get_data_metadata + amd_comgr_get_data_metadata.restype = amd_comgr_status_t + amd_comgr_get_data_metadata.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_amd_comgr_metadata_node_s)] +except AttributeError: + pass +try: + amd_comgr_destroy_metadata = _libraries['libamd_comgr.so'].amd_comgr_destroy_metadata + amd_comgr_destroy_metadata.restype = amd_comgr_status_t + amd_comgr_destroy_metadata.argtypes = [amd_comgr_metadata_node_t] +except AttributeError: + pass +try: + amd_comgr_create_data_set = _libraries['libamd_comgr.so'].amd_comgr_create_data_set + amd_comgr_create_data_set.restype = amd_comgr_status_t + amd_comgr_create_data_set.argtypes = [ctypes.POINTER(struct_amd_comgr_data_set_s)] +except AttributeError: + pass +try: + amd_comgr_destroy_data_set = _libraries['libamd_comgr.so'].amd_comgr_destroy_data_set + amd_comgr_destroy_data_set.restype = amd_comgr_status_t + amd_comgr_destroy_data_set.argtypes = [amd_comgr_data_set_t] +except AttributeError: + pass +try: + amd_comgr_data_set_add = _libraries['libamd_comgr.so'].amd_comgr_data_set_add + amd_comgr_data_set_add.restype = amd_comgr_status_t + amd_comgr_data_set_add.argtypes = [amd_comgr_data_set_t, amd_comgr_data_t] +except AttributeError: + pass +try: + amd_comgr_data_set_remove = _libraries['libamd_comgr.so'].amd_comgr_data_set_remove + amd_comgr_data_set_remove.restype = amd_comgr_status_t + amd_comgr_data_set_remove.argtypes = [amd_comgr_data_set_t, amd_comgr_data_kind_t] +except AttributeError: + pass +try: + amd_comgr_action_data_count = _libraries['libamd_comgr.so'].amd_comgr_action_data_count + amd_comgr_action_data_count.restype = amd_comgr_status_t + amd_comgr_action_data_count.argtypes = [amd_comgr_data_set_t, amd_comgr_data_kind_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_action_data_get_data = _libraries['libamd_comgr.so'].amd_comgr_action_data_get_data + amd_comgr_action_data_get_data.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_create_action_info = _libraries['libamd_comgr.so'].amd_comgr_create_action_info + amd_comgr_create_action_info.restype = amd_comgr_status_t + amd_comgr_create_action_info.argtypes = [ctypes.POINTER(struct_amd_comgr_action_info_s)] +except AttributeError: + pass +try: + amd_comgr_destroy_action_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_action_info + amd_comgr_destroy_action_info.restype = amd_comgr_status_t + amd_comgr_destroy_action_info.argtypes = [amd_comgr_action_info_t] +except AttributeError: + pass +try: + amd_comgr_action_info_set_isa_name = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_isa_name + amd_comgr_action_info_set_isa_name.restype = amd_comgr_status_t + amd_comgr_action_info_set_isa_name.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_get_isa_name = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_isa_name + amd_comgr_action_info_get_isa_name.restype = amd_comgr_status_t + amd_comgr_action_info_get_isa_name.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_set_language = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_language + amd_comgr_action_info_set_language.restype = amd_comgr_status_t + amd_comgr_action_info_set_language.argtypes = [amd_comgr_action_info_t, amd_comgr_language_t] +except AttributeError: + pass +try: + amd_comgr_action_info_get_language = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_language + amd_comgr_action_info_get_language.restype = amd_comgr_status_t + amd_comgr_action_info_get_language.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(amd_comgr_language_s)] +except AttributeError: + pass +try: + amd_comgr_action_info_set_options = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_options + amd_comgr_action_info_set_options.restype = amd_comgr_status_t + amd_comgr_action_info_set_options.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_get_options = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_options + amd_comgr_action_info_get_options.restype = amd_comgr_status_t + amd_comgr_action_info_get_options.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_set_option_list = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_option_list + amd_comgr_action_info_set_option_list.restype = amd_comgr_status_t + amd_comgr_action_info_set_option_list.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char) * 0, size_t] +except AttributeError: + pass +try: + amd_comgr_action_info_get_option_list_count = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_option_list_count + amd_comgr_action_info_get_option_list_count.restype = amd_comgr_status_t + amd_comgr_action_info_get_option_list_count.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_action_info_get_option_list_item = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_option_list_item + amd_comgr_action_info_get_option_list_item.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_action_info_set_working_directory_path = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_working_directory_path + amd_comgr_action_info_set_working_directory_path.restype = amd_comgr_status_t + amd_comgr_action_info_set_working_directory_path.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_get_working_directory_path = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_working_directory_path + amd_comgr_action_info_get_working_directory_path.restype = amd_comgr_status_t + amd_comgr_action_info_get_working_directory_path.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_action_info_set_logging = _libraries['libamd_comgr.so'].amd_comgr_action_info_set_logging + amd_comgr_action_info_set_logging.restype = amd_comgr_status_t + amd_comgr_action_info_set_logging.argtypes = [amd_comgr_action_info_t, ctypes.c_bool] +except AttributeError: + pass +try: + amd_comgr_action_info_get_logging = _libraries['libamd_comgr.so'].amd_comgr_action_info_get_logging + amd_comgr_action_info_get_logging.restype = amd_comgr_status_t + amd_comgr_action_info_get_logging.argtypes = [amd_comgr_action_info_t, ctypes.POINTER(ctypes.c_bool)] +except AttributeError: + pass + +# values for enumeration 'amd_comgr_action_kind_s' +amd_comgr_action_kind_s__enumvalues = { + 0: 'AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR', + 1: 'AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS', + 2: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC', + 3: 'AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES', + 4: 'AMD_COMGR_ACTION_LINK_BC_TO_BC', + 5: 'AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC', + 6: 'AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE', + 7: 'AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY', + 8: 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE', + 9: 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE', + 10: 'AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE', + 11: 'AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE', + 12: 'AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE', + 13: 'AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE', + 14: 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN', + 15: 'AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC', + 15: 'AMD_COMGR_ACTION_LAST', +} +AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR = 0 +AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS = 1 +AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC = 2 +AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES = 3 +AMD_COMGR_ACTION_LINK_BC_TO_BC = 4 +AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC = 5 +AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE = 6 +AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY = 7 +AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE = 8 +AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE = 9 +AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE = 10 +AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE = 11 +AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE = 12 +AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE = 13 +AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN = 14 +AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC = 15 +AMD_COMGR_ACTION_LAST = 15 +amd_comgr_action_kind_s = ctypes.c_uint32 # enum +amd_comgr_action_kind_t = amd_comgr_action_kind_s +amd_comgr_action_kind_t__enumvalues = amd_comgr_action_kind_s__enumvalues +try: + amd_comgr_do_action = _libraries['libamd_comgr.so'].amd_comgr_do_action + amd_comgr_do_action.restype = amd_comgr_status_t + 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] +except AttributeError: + pass + +# values for enumeration 'amd_comgr_metadata_kind_s' +amd_comgr_metadata_kind_s__enumvalues = { + 0: 'AMD_COMGR_METADATA_KIND_NULL', + 1: 'AMD_COMGR_METADATA_KIND_STRING', + 2: 'AMD_COMGR_METADATA_KIND_MAP', + 3: 'AMD_COMGR_METADATA_KIND_LIST', + 3: 'AMD_COMGR_METADATA_KIND_LAST', +} +AMD_COMGR_METADATA_KIND_NULL = 0 +AMD_COMGR_METADATA_KIND_STRING = 1 +AMD_COMGR_METADATA_KIND_MAP = 2 +AMD_COMGR_METADATA_KIND_LIST = 3 +AMD_COMGR_METADATA_KIND_LAST = 3 +amd_comgr_metadata_kind_s = ctypes.c_uint32 # enum +amd_comgr_metadata_kind_t = amd_comgr_metadata_kind_s +amd_comgr_metadata_kind_t__enumvalues = amd_comgr_metadata_kind_s__enumvalues +try: + amd_comgr_get_metadata_kind = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_kind + amd_comgr_get_metadata_kind.restype = amd_comgr_status_t + amd_comgr_get_metadata_kind.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(amd_comgr_metadata_kind_s)] +except AttributeError: + pass +try: + amd_comgr_get_metadata_string = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_string + amd_comgr_get_metadata_string.restype = amd_comgr_status_t + amd_comgr_get_metadata_string.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_get_metadata_map_size = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_map_size + amd_comgr_get_metadata_map_size.restype = amd_comgr_status_t + amd_comgr_get_metadata_map_size.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_iterate_map_metadata = _libraries['libamd_comgr.so'].amd_comgr_iterate_map_metadata + amd_comgr_iterate_map_metadata.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_metadata_lookup = _libraries['libamd_comgr.so'].amd_comgr_metadata_lookup + amd_comgr_metadata_lookup.restype = amd_comgr_status_t + amd_comgr_metadata_lookup.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_metadata_node_s)] +except AttributeError: + pass +try: + amd_comgr_get_metadata_list_size = _libraries['libamd_comgr.so'].amd_comgr_get_metadata_list_size + amd_comgr_get_metadata_list_size.restype = amd_comgr_status_t + amd_comgr_get_metadata_list_size.argtypes = [amd_comgr_metadata_node_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_index_list_metadata = _libraries['libamd_comgr.so'].amd_comgr_index_list_metadata + amd_comgr_index_list_metadata.restype = amd_comgr_status_t + amd_comgr_index_list_metadata.argtypes = [amd_comgr_metadata_node_t, size_t, ctypes.POINTER(struct_amd_comgr_metadata_node_s)] +except AttributeError: + pass +try: + amd_comgr_iterate_symbols = _libraries['libamd_comgr.so'].amd_comgr_iterate_symbols + amd_comgr_iterate_symbols.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_symbol_lookup = _libraries['libamd_comgr.so'].amd_comgr_symbol_lookup + amd_comgr_symbol_lookup.restype = amd_comgr_status_t + amd_comgr_symbol_lookup.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(struct_amd_comgr_symbol_s)] +except AttributeError: + pass + +# values for enumeration 'amd_comgr_symbol_type_s' +amd_comgr_symbol_type_s__enumvalues = { + -1: 'AMD_COMGR_SYMBOL_TYPE_UNKNOWN', + 0: 'AMD_COMGR_SYMBOL_TYPE_NOTYPE', + 1: 'AMD_COMGR_SYMBOL_TYPE_OBJECT', + 2: 'AMD_COMGR_SYMBOL_TYPE_FUNC', + 3: 'AMD_COMGR_SYMBOL_TYPE_SECTION', + 4: 'AMD_COMGR_SYMBOL_TYPE_FILE', + 5: 'AMD_COMGR_SYMBOL_TYPE_COMMON', + 10: 'AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL', +} +AMD_COMGR_SYMBOL_TYPE_UNKNOWN = -1 +AMD_COMGR_SYMBOL_TYPE_NOTYPE = 0 +AMD_COMGR_SYMBOL_TYPE_OBJECT = 1 +AMD_COMGR_SYMBOL_TYPE_FUNC = 2 +AMD_COMGR_SYMBOL_TYPE_SECTION = 3 +AMD_COMGR_SYMBOL_TYPE_FILE = 4 +AMD_COMGR_SYMBOL_TYPE_COMMON = 5 +AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL = 10 +amd_comgr_symbol_type_s = ctypes.c_int32 # enum +amd_comgr_symbol_type_t = amd_comgr_symbol_type_s +amd_comgr_symbol_type_t__enumvalues = amd_comgr_symbol_type_s__enumvalues + +# values for enumeration 'amd_comgr_symbol_info_s' +amd_comgr_symbol_info_s__enumvalues = { + 0: 'AMD_COMGR_SYMBOL_INFO_NAME_LENGTH', + 1: 'AMD_COMGR_SYMBOL_INFO_NAME', + 2: 'AMD_COMGR_SYMBOL_INFO_TYPE', + 3: 'AMD_COMGR_SYMBOL_INFO_SIZE', + 4: 'AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED', + 5: 'AMD_COMGR_SYMBOL_INFO_VALUE', + 5: 'AMD_COMGR_SYMBOL_INFO_LAST', +} +AMD_COMGR_SYMBOL_INFO_NAME_LENGTH = 0 +AMD_COMGR_SYMBOL_INFO_NAME = 1 +AMD_COMGR_SYMBOL_INFO_TYPE = 2 +AMD_COMGR_SYMBOL_INFO_SIZE = 3 +AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED = 4 +AMD_COMGR_SYMBOL_INFO_VALUE = 5 +AMD_COMGR_SYMBOL_INFO_LAST = 5 +amd_comgr_symbol_info_s = ctypes.c_uint32 # enum +amd_comgr_symbol_info_t = amd_comgr_symbol_info_s +amd_comgr_symbol_info_t__enumvalues = amd_comgr_symbol_info_s__enumvalues +try: + amd_comgr_symbol_get_info = _libraries['libamd_comgr.so'].amd_comgr_symbol_get_info + amd_comgr_symbol_get_info.restype = amd_comgr_status_t + amd_comgr_symbol_get_info.argtypes = [amd_comgr_symbol_t, amd_comgr_symbol_info_t, ctypes.POINTER(None)] +except AttributeError: + pass +try: + amd_comgr_create_disassembly_info = _libraries['libamd_comgr.so'].amd_comgr_create_disassembly_info + amd_comgr_create_disassembly_info.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +try: + amd_comgr_destroy_disassembly_info = _libraries['libamd_comgr.so'].amd_comgr_destroy_disassembly_info + amd_comgr_destroy_disassembly_info.restype = amd_comgr_status_t + amd_comgr_destroy_disassembly_info.argtypes = [amd_comgr_disassembly_info_t] +except AttributeError: + pass +try: + amd_comgr_disassemble_instruction = _libraries['libamd_comgr.so'].amd_comgr_disassemble_instruction + amd_comgr_disassemble_instruction.restype = amd_comgr_status_t + amd_comgr_disassemble_instruction.argtypes = [amd_comgr_disassembly_info_t, uint64_t, ctypes.POINTER(None), ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_demangle_symbol_name = _libraries['libamd_comgr.so'].amd_comgr_demangle_symbol_name + amd_comgr_demangle_symbol_name.restype = amd_comgr_status_t + amd_comgr_demangle_symbol_name.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_amd_comgr_data_s)] +except AttributeError: + pass +try: + amd_comgr_populate_mangled_names = _libraries['libamd_comgr.so'].amd_comgr_populate_mangled_names + amd_comgr_populate_mangled_names.restype = amd_comgr_status_t + amd_comgr_populate_mangled_names.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_get_mangled_name = _libraries['libamd_comgr.so'].amd_comgr_get_mangled_name + amd_comgr_get_mangled_name.restype = amd_comgr_status_t + amd_comgr_get_mangled_name.argtypes = [amd_comgr_data_t, size_t, ctypes.POINTER(ctypes.c_uint64), ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + amd_comgr_populate_name_expression_map = _libraries['libamd_comgr.so'].amd_comgr_populate_name_expression_map + amd_comgr_populate_name_expression_map.restype = amd_comgr_status_t + amd_comgr_populate_name_expression_map.argtypes = [amd_comgr_data_t, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + amd_comgr_map_name_expression_to_symbol_name = _libraries['libamd_comgr.so'].amd_comgr_map_name_expression_to_symbol_name + amd_comgr_map_name_expression_to_symbol_name.restype = amd_comgr_status_t + 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)] +except AttributeError: + pass +class struct_code_object_info_s(Structure): + pass + +struct_code_object_info_s._pack_ = 1 # source:False +struct_code_object_info_s._fields_ = [ + ('isa', ctypes.POINTER(ctypes.c_char)), + ('size', ctypes.c_uint64), + ('offset', ctypes.c_uint64), +] + +amd_comgr_code_object_info_t = struct_code_object_info_s +try: + amd_comgr_lookup_code_object = _libraries['libamd_comgr.so'].amd_comgr_lookup_code_object + amd_comgr_lookup_code_object.restype = amd_comgr_status_t + amd_comgr_lookup_code_object.argtypes = [amd_comgr_data_t, ctypes.POINTER(struct_code_object_info_s), size_t] +except AttributeError: + pass +__all__ = \ + ['AMD_COMGR_ACTION_ADD_DEVICE_LIBRARIES', + 'AMD_COMGR_ACTION_ADD_PRECOMPILED_HEADERS', + 'AMD_COMGR_ACTION_ASSEMBLE_SOURCE_TO_RELOCATABLE', + 'AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY', + 'AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE', + 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_BC', + 'AMD_COMGR_ACTION_COMPILE_SOURCE_TO_FATBIN', + 'AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC', + 'AMD_COMGR_ACTION_DISASSEMBLE_BYTES_TO_SOURCE', + 'AMD_COMGR_ACTION_DISASSEMBLE_EXECUTABLE_TO_SOURCE', + 'AMD_COMGR_ACTION_DISASSEMBLE_RELOCATABLE_TO_SOURCE', + 'AMD_COMGR_ACTION_LAST', 'AMD_COMGR_ACTION_LINK_BC_TO_BC', + 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_EXECUTABLE', + 'AMD_COMGR_ACTION_LINK_RELOCATABLE_TO_RELOCATABLE', + 'AMD_COMGR_ACTION_OPTIMIZE_BC_TO_BC', + 'AMD_COMGR_ACTION_SOURCE_TO_PREPROCESSOR', + 'AMD_COMGR_DATA_KIND_AR', 'AMD_COMGR_DATA_KIND_AR_BUNDLE', + 'AMD_COMGR_DATA_KIND_BC', 'AMD_COMGR_DATA_KIND_BC_BUNDLE', + 'AMD_COMGR_DATA_KIND_BYTES', 'AMD_COMGR_DATA_KIND_DIAGNOSTIC', + 'AMD_COMGR_DATA_KIND_EXECUTABLE', 'AMD_COMGR_DATA_KIND_FATBIN', + 'AMD_COMGR_DATA_KIND_INCLUDE', 'AMD_COMGR_DATA_KIND_LAST', + 'AMD_COMGR_DATA_KIND_LOG', + 'AMD_COMGR_DATA_KIND_PRECOMPILED_HEADER', + 'AMD_COMGR_DATA_KIND_RELOCATABLE', 'AMD_COMGR_DATA_KIND_SOURCE', + 'AMD_COMGR_DATA_KIND_UNDEF', 'AMD_COMGR_LANGUAGE_HC', + 'AMD_COMGR_LANGUAGE_HIP', 'AMD_COMGR_LANGUAGE_LAST', + 'AMD_COMGR_LANGUAGE_NONE', 'AMD_COMGR_LANGUAGE_OPENCL_1_2', + 'AMD_COMGR_LANGUAGE_OPENCL_2_0', 'AMD_COMGR_METADATA_KIND_LAST', + 'AMD_COMGR_METADATA_KIND_LIST', 'AMD_COMGR_METADATA_KIND_MAP', + 'AMD_COMGR_METADATA_KIND_NULL', 'AMD_COMGR_METADATA_KIND_STRING', + 'AMD_COMGR_STATUS_ERROR', + 'AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT', + 'AMD_COMGR_STATUS_ERROR_OUT_OF_RESOURCES', + 'AMD_COMGR_STATUS_SUCCESS', 'AMD_COMGR_SYMBOL_INFO_IS_UNDEFINED', + 'AMD_COMGR_SYMBOL_INFO_LAST', 'AMD_COMGR_SYMBOL_INFO_NAME', + 'AMD_COMGR_SYMBOL_INFO_NAME_LENGTH', 'AMD_COMGR_SYMBOL_INFO_SIZE', + 'AMD_COMGR_SYMBOL_INFO_TYPE', 'AMD_COMGR_SYMBOL_INFO_VALUE', + 'AMD_COMGR_SYMBOL_TYPE_AMDGPU_HSA_KERNEL', + 'AMD_COMGR_SYMBOL_TYPE_COMMON', 'AMD_COMGR_SYMBOL_TYPE_FILE', + 'AMD_COMGR_SYMBOL_TYPE_FUNC', 'AMD_COMGR_SYMBOL_TYPE_NOTYPE', + 'AMD_COMGR_SYMBOL_TYPE_OBJECT', 'AMD_COMGR_SYMBOL_TYPE_SECTION', + 'AMD_COMGR_SYMBOL_TYPE_UNKNOWN', 'amd_comgr_action_data_count', + 'amd_comgr_action_data_get_data', + 'amd_comgr_action_info_get_isa_name', + 'amd_comgr_action_info_get_language', + 'amd_comgr_action_info_get_logging', + 'amd_comgr_action_info_get_option_list_count', + 'amd_comgr_action_info_get_option_list_item', + 'amd_comgr_action_info_get_options', + 'amd_comgr_action_info_get_working_directory_path', + 'amd_comgr_action_info_set_isa_name', + 'amd_comgr_action_info_set_language', + 'amd_comgr_action_info_set_logging', + 'amd_comgr_action_info_set_option_list', + 'amd_comgr_action_info_set_options', + 'amd_comgr_action_info_set_working_directory_path', + 'amd_comgr_action_info_t', 'amd_comgr_action_kind_s', + 'amd_comgr_action_kind_t', 'amd_comgr_action_kind_t__enumvalues', + 'amd_comgr_code_object_info_t', 'amd_comgr_create_action_info', + 'amd_comgr_create_data', 'amd_comgr_create_data_set', + 'amd_comgr_create_disassembly_info', + 'amd_comgr_create_symbolizer_info', 'amd_comgr_data_kind_s', + 'amd_comgr_data_kind_t', 'amd_comgr_data_kind_t__enumvalues', + 'amd_comgr_data_set_add', 'amd_comgr_data_set_remove', + 'amd_comgr_data_set_t', 'amd_comgr_data_t', + 'amd_comgr_demangle_symbol_name', 'amd_comgr_destroy_action_info', + 'amd_comgr_destroy_data_set', + 'amd_comgr_destroy_disassembly_info', + 'amd_comgr_destroy_metadata', 'amd_comgr_destroy_symbolizer_info', + 'amd_comgr_disassemble_instruction', + 'amd_comgr_disassembly_info_t', 'amd_comgr_do_action', + 'amd_comgr_get_data', 'amd_comgr_get_data_isa_name', + 'amd_comgr_get_data_kind', 'amd_comgr_get_data_metadata', + 'amd_comgr_get_data_name', 'amd_comgr_get_isa_count', + 'amd_comgr_get_isa_metadata', 'amd_comgr_get_isa_name', + 'amd_comgr_get_mangled_name', 'amd_comgr_get_metadata_kind', + 'amd_comgr_get_metadata_list_size', + 'amd_comgr_get_metadata_map_size', + 'amd_comgr_get_metadata_string', 'amd_comgr_get_version', + 'amd_comgr_index_list_metadata', 'amd_comgr_iterate_map_metadata', + 'amd_comgr_iterate_symbols', 'amd_comgr_language_s', + 'amd_comgr_language_t', 'amd_comgr_language_t__enumvalues', + 'amd_comgr_lookup_code_object', + 'amd_comgr_map_name_expression_to_symbol_name', + 'amd_comgr_metadata_kind_s', 'amd_comgr_metadata_kind_t', + 'amd_comgr_metadata_kind_t__enumvalues', + 'amd_comgr_metadata_lookup', 'amd_comgr_metadata_node_t', + 'amd_comgr_populate_mangled_names', + 'amd_comgr_populate_name_expression_map', + 'amd_comgr_release_data', 'amd_comgr_set_data', + 'amd_comgr_set_data_from_file_slice', 'amd_comgr_set_data_name', + 'amd_comgr_status_s', 'amd_comgr_status_string', + 'amd_comgr_status_t', 'amd_comgr_status_t__enumvalues', + 'amd_comgr_symbol_get_info', 'amd_comgr_symbol_info_s', + 'amd_comgr_symbol_info_t', 'amd_comgr_symbol_info_t__enumvalues', + 'amd_comgr_symbol_lookup', 'amd_comgr_symbol_t', + 'amd_comgr_symbol_type_s', 'amd_comgr_symbol_type_t', + 'amd_comgr_symbol_type_t__enumvalues', 'amd_comgr_symbolize', + 'amd_comgr_symbolizer_info_t', 'size_t', + 'struct_amd_comgr_action_info_s', 'struct_amd_comgr_data_s', + 'struct_amd_comgr_data_set_s', + 'struct_amd_comgr_disassembly_info_s', + 'struct_amd_comgr_metadata_node_s', 'struct_amd_comgr_symbol_s', + 'struct_amd_comgr_symbolizer_info_s', 'struct_code_object_info_s', + 'uint64_t'] diff --git a/gpuctypes/hip.py b/gpuctypes/hip.py index 3975fa8..e4a8fa5 100644 --- a/gpuctypes/hip.py +++ b/gpuctypes/hip.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include'] +# TARGET arch is: ['-D__HIP_PLATFORM_AMD__', '-I/opt/rocm/include', '-x', 'c++'] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 @@ -116,27 +116,6 @@ class Union(ctypes.Union, AsDictMixin): -_libraries = {} -_libraries['libhiprtc.so'] = ctypes.CDLL('/opt/rocm/lib/libhiprtc.so') -def string_cast(char_pointer, encoding='utf-8', errors='strict'): - value = ctypes.cast(char_pointer, ctypes.c_char_p).value - if value is not None and encoding is not None: - value = value.decode(encoding, errors=errors) - return value - - -def char_pointer_cast(string, encoding='utf-8'): - if encoding is not None: - try: - string = string.encode(encoding) - except AttributeError: - # In Python3, bytes has no encode attribute - pass - string = ctypes.c_char_p(string) - return ctypes.cast(string, ctypes.POINTER(ctypes.c_char)) - - - c_int128 = ctypes.c_ubyte*16 c_uint128 = c_int128 void = None @@ -154,246 +133,30 @@ def __getattr__(self, _): # This is a non-working stub instead. # You can either re-run clan2py with -l /path/to/library.so # Or manually fix this by comment the ctypes.CDLL loading +_libraries = {} _libraries['FIXME_STUB'] = FunctionFactoryStub() # ctypes.CDLL('FIXME_STUB') -_libraries['libamdhip64.so'] = ctypes.CDLL('/opt/rocm/lib/libamdhip64.so') +def string_cast(char_pointer, encoding='utf-8', errors='strict'): + value = ctypes.cast(char_pointer, ctypes.c_char_p).value + if value is not None and encoding is not None: + value = value.decode(encoding, errors=errors) + return value +def char_pointer_cast(string, encoding='utf-8'): + if encoding is not None: + try: + string = string.encode(encoding) + except AttributeError: + # In Python3, bytes has no encode attribute + pass + string = ctypes.c_char_p(string) + return ctypes.cast(string, ctypes.POINTER(ctypes.c_char)) -# values for enumeration 'hiprtcResult' -hiprtcResult__enumvalues = { - 0: 'HIPRTC_SUCCESS', - 1: 'HIPRTC_ERROR_OUT_OF_MEMORY', - 2: 'HIPRTC_ERROR_PROGRAM_CREATION_FAILURE', - 3: 'HIPRTC_ERROR_INVALID_INPUT', - 4: 'HIPRTC_ERROR_INVALID_PROGRAM', - 5: 'HIPRTC_ERROR_INVALID_OPTION', - 6: 'HIPRTC_ERROR_COMPILATION', - 7: 'HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE', - 8: 'HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION', - 9: 'HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION', - 10: 'HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID', - 11: 'HIPRTC_ERROR_INTERNAL_ERROR', - 100: 'HIPRTC_ERROR_LINKING', -} -HIPRTC_SUCCESS = 0 -HIPRTC_ERROR_OUT_OF_MEMORY = 1 -HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 -HIPRTC_ERROR_INVALID_INPUT = 3 -HIPRTC_ERROR_INVALID_PROGRAM = 4 -HIPRTC_ERROR_INVALID_OPTION = 5 -HIPRTC_ERROR_COMPILATION = 6 -HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 -HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 -HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 -HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 -HIPRTC_ERROR_INTERNAL_ERROR = 11 -HIPRTC_ERROR_LINKING = 100 -hiprtcResult = ctypes.c_uint32 # enum -# values for enumeration 'hiprtcJIT_option' -hiprtcJIT_option__enumvalues = { - 0: 'HIPRTC_JIT_MAX_REGISTERS', - 1: 'HIPRTC_JIT_THREADS_PER_BLOCK', - 2: 'HIPRTC_JIT_WALL_TIME', - 3: 'HIPRTC_JIT_INFO_LOG_BUFFER', - 4: 'HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES', - 5: 'HIPRTC_JIT_ERROR_LOG_BUFFER', - 6: 'HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES', - 7: 'HIPRTC_JIT_OPTIMIZATION_LEVEL', - 8: 'HIPRTC_JIT_TARGET_FROM_HIPCONTEXT', - 9: 'HIPRTC_JIT_TARGET', - 10: 'HIPRTC_JIT_FALLBACK_STRATEGY', - 11: 'HIPRTC_JIT_GENERATE_DEBUG_INFO', - 12: 'HIPRTC_JIT_LOG_VERBOSE', - 13: 'HIPRTC_JIT_GENERATE_LINE_INFO', - 14: 'HIPRTC_JIT_CACHE_MODE', - 15: 'HIPRTC_JIT_NEW_SM3X_OPT', - 16: 'HIPRTC_JIT_FAST_COMPILE', - 17: 'HIPRTC_JIT_GLOBAL_SYMBOL_NAMES', - 18: 'HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS', - 19: 'HIPRTC_JIT_GLOBAL_SYMBOL_COUNT', - 20: 'HIPRTC_JIT_LTO', - 21: 'HIPRTC_JIT_FTZ', - 22: 'HIPRTC_JIT_PREC_DIV', - 23: 'HIPRTC_JIT_PREC_SQRT', - 24: 'HIPRTC_JIT_FMA', - 25: 'HIPRTC_JIT_NUM_OPTIONS', - 10000: 'HIPRTC_JIT_IR_TO_ISA_OPT_EXT', - 10001: 'HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT', -} -HIPRTC_JIT_MAX_REGISTERS = 0 -HIPRTC_JIT_THREADS_PER_BLOCK = 1 -HIPRTC_JIT_WALL_TIME = 2 -HIPRTC_JIT_INFO_LOG_BUFFER = 3 -HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4 -HIPRTC_JIT_ERROR_LOG_BUFFER = 5 -HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6 -HIPRTC_JIT_OPTIMIZATION_LEVEL = 7 -HIPRTC_JIT_TARGET_FROM_HIPCONTEXT = 8 -HIPRTC_JIT_TARGET = 9 -HIPRTC_JIT_FALLBACK_STRATEGY = 10 -HIPRTC_JIT_GENERATE_DEBUG_INFO = 11 -HIPRTC_JIT_LOG_VERBOSE = 12 -HIPRTC_JIT_GENERATE_LINE_INFO = 13 -HIPRTC_JIT_CACHE_MODE = 14 -HIPRTC_JIT_NEW_SM3X_OPT = 15 -HIPRTC_JIT_FAST_COMPILE = 16 -HIPRTC_JIT_GLOBAL_SYMBOL_NAMES = 17 -HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS = 18 -HIPRTC_JIT_GLOBAL_SYMBOL_COUNT = 19 -HIPRTC_JIT_LTO = 20 -HIPRTC_JIT_FTZ = 21 -HIPRTC_JIT_PREC_DIV = 22 -HIPRTC_JIT_PREC_SQRT = 23 -HIPRTC_JIT_FMA = 24 -HIPRTC_JIT_NUM_OPTIONS = 25 -HIPRTC_JIT_IR_TO_ISA_OPT_EXT = 10000 -HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT = 10001 -hiprtcJIT_option = ctypes.c_uint32 # enum -# values for enumeration 'hiprtcJITInputType' -hiprtcJITInputType__enumvalues = { - 0: 'HIPRTC_JIT_INPUT_CUBIN', - 1: 'HIPRTC_JIT_INPUT_PTX', - 2: 'HIPRTC_JIT_INPUT_FATBINARY', - 3: 'HIPRTC_JIT_INPUT_OBJECT', - 4: 'HIPRTC_JIT_INPUT_LIBRARY', - 5: 'HIPRTC_JIT_INPUT_NVVM', - 6: 'HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES', - 100: 'HIPRTC_JIT_INPUT_LLVM_BITCODE', - 101: 'HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE', - 102: 'HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE', - 9: 'HIPRTC_JIT_NUM_INPUT_TYPES', -} -HIPRTC_JIT_INPUT_CUBIN = 0 -HIPRTC_JIT_INPUT_PTX = 1 -HIPRTC_JIT_INPUT_FATBINARY = 2 -HIPRTC_JIT_INPUT_OBJECT = 3 -HIPRTC_JIT_INPUT_LIBRARY = 4 -HIPRTC_JIT_INPUT_NVVM = 5 -HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES = 6 -HIPRTC_JIT_INPUT_LLVM_BITCODE = 100 -HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE = 101 -HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE = 102 -HIPRTC_JIT_NUM_INPUT_TYPES = 9 -hiprtcJITInputType = ctypes.c_uint32 # enum -class struct_ihiprtcLinkState(Structure): - pass +_libraries['libamdhip64.so'] = ctypes.CDLL('/opt/rocm/lib/libamdhip64.so') -hiprtcLinkState = ctypes.POINTER(struct_ihiprtcLinkState) -try: - hiprtcGetErrorString = _libraries['libhiprtc.so'].hiprtcGetErrorString - hiprtcGetErrorString.restype = ctypes.POINTER(ctypes.c_char) - hiprtcGetErrorString.argtypes = [hiprtcResult] -except AttributeError: - pass -try: - hiprtcVersion = _libraries['libhiprtc.so'].hiprtcVersion - hiprtcVersion.restype = hiprtcResult - hiprtcVersion.argtypes = [ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_int32)] -except AttributeError: - pass -class struct__hiprtcProgram(Structure): - pass -hiprtcProgram = ctypes.POINTER(struct__hiprtcProgram) -try: - hiprtcAddNameExpression = _libraries['libhiprtc.so'].hiprtcAddNameExpression - hiprtcAddNameExpression.restype = hiprtcResult - hiprtcAddNameExpression.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] -except AttributeError: - pass -try: - hiprtcCompileProgram = _libraries['libhiprtc.so'].hiprtcCompileProgram - hiprtcCompileProgram.restype = hiprtcResult - hiprtcCompileProgram.argtypes = [hiprtcProgram, ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] -except AttributeError: - pass -try: - hiprtcCreateProgram = _libraries['libhiprtc.so'].hiprtcCreateProgram - hiprtcCreateProgram.restype = hiprtcResult - hiprtcCreateProgram.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hiprtcProgram)), ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char)), ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] -except AttributeError: - pass -try: - hiprtcDestroyProgram = _libraries['libhiprtc.so'].hiprtcDestroyProgram - hiprtcDestroyProgram.restype = hiprtcResult - hiprtcDestroyProgram.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hiprtcProgram))] -except AttributeError: - pass -try: - hiprtcGetLoweredName = _libraries['libhiprtc.so'].hiprtcGetLoweredName - hiprtcGetLoweredName.restype = hiprtcResult - hiprtcGetLoweredName.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] -except AttributeError: - pass -try: - hiprtcGetProgramLog = _libraries['libhiprtc.so'].hiprtcGetProgramLog - hiprtcGetProgramLog.restype = hiprtcResult - hiprtcGetProgramLog.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] -except AttributeError: - pass -try: - hiprtcGetProgramLogSize = _libraries['libhiprtc.so'].hiprtcGetProgramLogSize - hiprtcGetProgramLogSize.restype = hiprtcResult - hiprtcGetProgramLogSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] -except AttributeError: - pass -try: - hiprtcGetCode = _libraries['libhiprtc.so'].hiprtcGetCode - hiprtcGetCode.restype = hiprtcResult - hiprtcGetCode.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] -except AttributeError: - pass -try: - hiprtcGetCodeSize = _libraries['libhiprtc.so'].hiprtcGetCodeSize - hiprtcGetCodeSize.restype = hiprtcResult - hiprtcGetCodeSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] -except AttributeError: - pass -try: - hiprtcGetBitcode = _libraries['libhiprtc.so'].hiprtcGetBitcode - hiprtcGetBitcode.restype = hiprtcResult - hiprtcGetBitcode.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] -except AttributeError: - pass -try: - hiprtcGetBitcodeSize = _libraries['libhiprtc.so'].hiprtcGetBitcodeSize - hiprtcGetBitcodeSize.restype = hiprtcResult - hiprtcGetBitcodeSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] -except AttributeError: - pass -try: - hiprtcLinkCreate = _libraries['libhiprtc.so'].hiprtcLinkCreate - hiprtcLinkCreate.restype = hiprtcResult - hiprtcLinkCreate.argtypes = [ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.POINTER(struct_ihiprtcLinkState))] -except AttributeError: - pass -try: - hiprtcLinkAddFile = _libraries['libhiprtc.so'].hiprtcLinkAddFile - hiprtcLinkAddFile.restype = hiprtcResult - hiprtcLinkAddFile.argtypes = [hiprtcLinkState, hiprtcJITInputType, ctypes.POINTER(ctypes.c_char), ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None))] -except AttributeError: - pass -size_t = ctypes.c_uint64 -try: - hiprtcLinkAddData = _libraries['libhiprtc.so'].hiprtcLinkAddData - hiprtcLinkAddData.restype = hiprtcResult - hiprtcLinkAddData.argtypes = [hiprtcLinkState, hiprtcJITInputType, ctypes.POINTER(None), size_t, ctypes.POINTER(ctypes.c_char), ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None))] -except AttributeError: - pass -try: - hiprtcLinkComplete = _libraries['libhiprtc.so'].hiprtcLinkComplete - hiprtcLinkComplete.restype = hiprtcResult - hiprtcLinkComplete.argtypes = [hiprtcLinkState, ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.c_uint64)] -except AttributeError: - pass -try: - hiprtcLinkDestroy = _libraries['libhiprtc.so'].hiprtcLinkDestroy - hiprtcLinkDestroy.restype = hiprtcResult - hiprtcLinkDestroy.argtypes = [hiprtcLinkState] -except AttributeError: - pass # values for enumeration 'c__Ea_HIP_SUCCESS' c__Ea_HIP_SUCCESS__enumvalues = { @@ -442,99 +205,145 @@ class struct_hipUUID_t(Structure): ] hipUUID = struct_hipUUID_t -class struct_hipDeviceProp_t(Structure): +class struct_hipDeviceProp_tR0600(Structure): pass -struct_hipDeviceProp_t._pack_ = 1 # source:False -struct_hipDeviceProp_t._fields_ = [ +struct_hipDeviceProp_tR0600._pack_ = 1 # source:False +struct_hipDeviceProp_tR0600._fields_ = [ ('name', ctypes.c_char * 256), + ('uuid', hipUUID), + ('luid', ctypes.c_char * 8), + ('luidDeviceNodeMask', ctypes.c_uint32), + ('PADDING_0', ctypes.c_ubyte * 4), ('totalGlobalMem', ctypes.c_uint64), ('sharedMemPerBlock', ctypes.c_uint64), ('regsPerBlock', ctypes.c_int32), ('warpSize', ctypes.c_int32), + ('memPitch', ctypes.c_uint64), ('maxThreadsPerBlock', ctypes.c_int32), ('maxThreadsDim', ctypes.c_int32 * 3), ('maxGridSize', ctypes.c_int32 * 3), ('clockRate', ctypes.c_int32), - ('memoryClockRate', ctypes.c_int32), - ('memoryBusWidth', ctypes.c_int32), ('totalConstMem', ctypes.c_uint64), ('major', ctypes.c_int32), ('minor', ctypes.c_int32), + ('textureAlignment', ctypes.c_uint64), + ('texturePitchAlignment', ctypes.c_uint64), + ('deviceOverlap', ctypes.c_int32), ('multiProcessorCount', ctypes.c_int32), - ('l2CacheSize', ctypes.c_int32), - ('maxThreadsPerMultiProcessor', ctypes.c_int32), + ('kernelExecTimeoutEnabled', ctypes.c_int32), + ('integrated', ctypes.c_int32), + ('canMapHostMemory', ctypes.c_int32), ('computeMode', ctypes.c_int32), - ('clockInstructionRate', ctypes.c_int32), - ('arch', hipDeviceArch_t), + ('maxTexture1D', ctypes.c_int32), + ('maxTexture1DMipmap', ctypes.c_int32), + ('maxTexture1DLinear', ctypes.c_int32), + ('maxTexture2D', ctypes.c_int32 * 2), + ('maxTexture2DMipmap', ctypes.c_int32 * 2), + ('maxTexture2DLinear', ctypes.c_int32 * 3), + ('maxTexture2DGather', ctypes.c_int32 * 2), + ('maxTexture3D', ctypes.c_int32 * 3), + ('maxTexture3DAlt', ctypes.c_int32 * 3), + ('maxTextureCubemap', ctypes.c_int32), + ('maxTexture1DLayered', ctypes.c_int32 * 2), + ('maxTexture2DLayered', ctypes.c_int32 * 3), + ('maxTextureCubemapLayered', ctypes.c_int32 * 2), + ('maxSurface1D', ctypes.c_int32), + ('maxSurface2D', ctypes.c_int32 * 2), + ('maxSurface3D', ctypes.c_int32 * 3), + ('maxSurface1DLayered', ctypes.c_int32 * 2), + ('maxSurface2DLayered', ctypes.c_int32 * 3), + ('maxSurfaceCubemap', ctypes.c_int32), + ('maxSurfaceCubemapLayered', ctypes.c_int32 * 2), + ('surfaceAlignment', ctypes.c_uint64), ('concurrentKernels', ctypes.c_int32), - ('pciDomainID', ctypes.c_int32), + ('ECCEnabled', ctypes.c_int32), ('pciBusID', ctypes.c_int32), ('pciDeviceID', ctypes.c_int32), - ('maxSharedMemoryPerMultiProcessor', ctypes.c_uint64), + ('pciDomainID', ctypes.c_int32), + ('tccDriver', ctypes.c_int32), + ('asyncEngineCount', ctypes.c_int32), + ('unifiedAddressing', ctypes.c_int32), + ('memoryClockRate', ctypes.c_int32), + ('memoryBusWidth', ctypes.c_int32), + ('l2CacheSize', ctypes.c_int32), + ('persistingL2CacheMaxSize', ctypes.c_int32), + ('maxThreadsPerMultiProcessor', ctypes.c_int32), + ('streamPrioritiesSupported', ctypes.c_int32), + ('globalL1CacheSupported', ctypes.c_int32), + ('localL1CacheSupported', ctypes.c_int32), + ('sharedMemPerMultiprocessor', ctypes.c_uint64), + ('regsPerMultiprocessor', ctypes.c_int32), + ('managedMemory', ctypes.c_int32), ('isMultiGpuBoard', ctypes.c_int32), - ('canMapHostMemory', ctypes.c_int32), - ('gcnArch', ctypes.c_int32), - ('gcnArchName', ctypes.c_char * 256), - ('integrated', ctypes.c_int32), + ('multiGpuBoardGroupID', ctypes.c_int32), + ('hostNativeAtomicSupported', ctypes.c_int32), + ('singleToDoublePrecisionPerfRatio', ctypes.c_int32), + ('pageableMemoryAccess', ctypes.c_int32), + ('concurrentManagedAccess', ctypes.c_int32), + ('computePreemptionSupported', ctypes.c_int32), + ('canUseHostPointerForRegisteredMem', ctypes.c_int32), ('cooperativeLaunch', ctypes.c_int32), ('cooperativeMultiDeviceLaunch', ctypes.c_int32), - ('maxTexture1DLinear', ctypes.c_int32), - ('maxTexture1D', ctypes.c_int32), - ('maxTexture2D', ctypes.c_int32 * 2), - ('maxTexture3D', ctypes.c_int32 * 3), - ('PADDING_0', ctypes.c_ubyte * 4), + ('sharedMemPerBlockOptin', ctypes.c_uint64), + ('pageableMemoryAccessUsesHostPageTables', ctypes.c_int32), + ('directManagedMemAccessFromHost', ctypes.c_int32), + ('maxBlocksPerMultiProcessor', ctypes.c_int32), + ('accessPolicyMaxWindowSize', ctypes.c_int32), + ('reservedSharedMemPerBlock', ctypes.c_uint64), + ('hostRegisterSupported', ctypes.c_int32), + ('sparseHipArraySupported', ctypes.c_int32), + ('hostRegisterReadOnlySupported', ctypes.c_int32), + ('timelineSemaphoreInteropSupported', ctypes.c_int32), + ('memoryPoolsSupported', ctypes.c_int32), + ('gpuDirectRDMASupported', ctypes.c_int32), + ('gpuDirectRDMAFlushWritesOptions', ctypes.c_uint32), + ('gpuDirectRDMAWritesOrdering', ctypes.c_int32), + ('memoryPoolSupportedHandleTypes', ctypes.c_uint32), + ('deferredMappingHipArraySupported', ctypes.c_int32), + ('ipcEventSupported', ctypes.c_int32), + ('clusterLaunch', ctypes.c_int32), + ('unifiedFunctionPointers', ctypes.c_int32), + ('reserved', ctypes.c_int32 * 63), + ('hipReserved', ctypes.c_int32 * 32), + ('gcnArchName', ctypes.c_char * 256), + ('maxSharedMemoryPerMultiProcessor', ctypes.c_uint64), + ('clockInstructionRate', ctypes.c_int32), + ('arch', hipDeviceArch_t), ('hdpMemFlushCntl', ctypes.POINTER(ctypes.c_uint32)), ('hdpRegFlushCntl', ctypes.POINTER(ctypes.c_uint32)), - ('memPitch', ctypes.c_uint64), - ('textureAlignment', ctypes.c_uint64), - ('texturePitchAlignment', ctypes.c_uint64), - ('kernelExecTimeoutEnabled', ctypes.c_int32), - ('ECCEnabled', ctypes.c_int32), - ('tccDriver', ctypes.c_int32), ('cooperativeMultiDeviceUnmatchedFunc', ctypes.c_int32), ('cooperativeMultiDeviceUnmatchedGridDim', ctypes.c_int32), ('cooperativeMultiDeviceUnmatchedBlockDim', ctypes.c_int32), ('cooperativeMultiDeviceUnmatchedSharedMem', ctypes.c_int32), ('isLargeBar', ctypes.c_int32), ('asicRevision', ctypes.c_int32), - ('managedMemory', ctypes.c_int32), - ('directManagedMemAccessFromHost', ctypes.c_int32), - ('concurrentManagedAccess', ctypes.c_int32), - ('pageableMemoryAccess', ctypes.c_int32), - ('pageableMemoryAccessUsesHostPageTables', ctypes.c_int32), ] -hipDeviceProp_t = struct_hipDeviceProp_t +hipDeviceProp_tR0600 = struct_hipDeviceProp_tR0600 # values for enumeration 'hipMemoryType' hipMemoryType__enumvalues = { - 0: 'hipMemoryTypeHost', - 1: 'hipMemoryTypeDevice', - 2: 'hipMemoryTypeArray', - 3: 'hipMemoryTypeUnified', - 4: 'hipMemoryTypeManaged', + 0: 'hipMemoryTypeUnregistered', + 1: 'hipMemoryTypeHost', + 2: 'hipMemoryTypeDevice', + 3: 'hipMemoryTypeManaged', + 10: 'hipMemoryTypeArray', + 11: 'hipMemoryTypeUnified', } -hipMemoryTypeHost = 0 -hipMemoryTypeDevice = 1 -hipMemoryTypeArray = 2 -hipMemoryTypeUnified = 3 -hipMemoryTypeManaged = 4 +hipMemoryTypeUnregistered = 0 +hipMemoryTypeHost = 1 +hipMemoryTypeDevice = 2 +hipMemoryTypeManaged = 3 +hipMemoryTypeArray = 10 +hipMemoryTypeUnified = 11 hipMemoryType = ctypes.c_uint32 # enum class struct_hipPointerAttribute_t(Structure): pass -class union_hipPointerAttribute_t_0(Union): - _pack_ = 1 # source:False - _fields_ = [ - ('memoryType', hipMemoryType), - ('type', hipMemoryType), - ] - struct_hipPointerAttribute_t._pack_ = 1 # source:False -struct_hipPointerAttribute_t._anonymous_ = ('_0',) struct_hipPointerAttribute_t._fields_ = [ - ('_0', union_hipPointerAttribute_t_0), + ('type', hipMemoryType), ('device', ctypes.c_int32), ('devicePointer', ctypes.POINTER(None)), ('hostPointer', ctypes.POINTER(None)), @@ -772,7 +581,7 @@ class union_hipPointerAttribute_t_0(Union): 61: 'hipDeviceAttributeComputeCapabilityMinor', 62: 'hipDeviceAttributeMultiGpuBoardGroupID', 63: 'hipDeviceAttributeMultiprocessorCount', - 64: 'hipDeviceAttributeName', + 64: 'hipDeviceAttributeUnused1', 65: 'hipDeviceAttributePageableMemoryAccess', 66: 'hipDeviceAttributePageableMemoryAccessUsesHostPageTables', 67: 'hipDeviceAttributePciBusId', @@ -794,17 +603,18 @@ class union_hipPointerAttribute_t_0(Union): 83: 'hipDeviceAttributeTotalConstantMemory', 84: 'hipDeviceAttributeTotalGlobalMem', 85: 'hipDeviceAttributeUnifiedAddressing', - 86: 'hipDeviceAttributeUuid', + 86: 'hipDeviceAttributeUnused2', 87: 'hipDeviceAttributeWarpSize', 88: 'hipDeviceAttributeMemoryPoolsSupported', 89: 'hipDeviceAttributeVirtualMemoryManagementSupported', + 90: 'hipDeviceAttributeHostRegisterSupported', 9999: 'hipDeviceAttributeCudaCompatibleEnd', 10000: 'hipDeviceAttributeAmdSpecificBegin', 10000: 'hipDeviceAttributeClockInstructionRate', - 10001: 'hipDeviceAttributeArch', + 10001: 'hipDeviceAttributeUnused3', 10002: 'hipDeviceAttributeMaxSharedMemoryPerMultiprocessor', - 10003: 'hipDeviceAttributeGcnArch', - 10004: 'hipDeviceAttributeGcnArchName', + 10003: 'hipDeviceAttributeUnused4', + 10004: 'hipDeviceAttributeUnused5', 10005: 'hipDeviceAttributeHdpMemFlushCntl', 10006: 'hipDeviceAttributeHdpRegFlushCntl', 10007: 'hipDeviceAttributeCooperativeMultiDeviceUnmatchedFunc', @@ -886,7 +696,7 @@ class union_hipPointerAttribute_t_0(Union): hipDeviceAttributeComputeCapabilityMinor = 61 hipDeviceAttributeMultiGpuBoardGroupID = 62 hipDeviceAttributeMultiprocessorCount = 63 -hipDeviceAttributeName = 64 +hipDeviceAttributeUnused1 = 64 hipDeviceAttributePageableMemoryAccess = 65 hipDeviceAttributePageableMemoryAccessUsesHostPageTables = 66 hipDeviceAttributePciBusId = 67 @@ -908,17 +718,18 @@ class union_hipPointerAttribute_t_0(Union): hipDeviceAttributeTotalConstantMemory = 83 hipDeviceAttributeTotalGlobalMem = 84 hipDeviceAttributeUnifiedAddressing = 85 -hipDeviceAttributeUuid = 86 +hipDeviceAttributeUnused2 = 86 hipDeviceAttributeWarpSize = 87 hipDeviceAttributeMemoryPoolsSupported = 88 hipDeviceAttributeVirtualMemoryManagementSupported = 89 +hipDeviceAttributeHostRegisterSupported = 90 hipDeviceAttributeCudaCompatibleEnd = 9999 hipDeviceAttributeAmdSpecificBegin = 10000 hipDeviceAttributeClockInstructionRate = 10000 -hipDeviceAttributeArch = 10001 +hipDeviceAttributeUnused3 = 10001 hipDeviceAttributeMaxSharedMemoryPerMultiprocessor = 10002 -hipDeviceAttributeGcnArch = 10003 -hipDeviceAttributeGcnArchName = 10004 +hipDeviceAttributeUnused4 = 10003 +hipDeviceAttributeUnused5 = 10004 hipDeviceAttributeHdpMemFlushCntl = 10005 hipDeviceAttributeHdpRegFlushCntl = 10006 hipDeviceAttributeCooperativeMultiDeviceUnmatchedFunc = 10007 @@ -975,6 +786,11 @@ class struct_hipChannelFormatDesc(Structure): ] hipChannelFormatDesc = struct_hipChannelFormatDesc +class struct_hipArray(Structure): + pass + +hipArray_t = ctypes.POINTER(struct_hipArray) +hipArray_const_t = ctypes.POINTER(struct_hipArray) # values for enumeration 'hipArray_Format' hipArray_Format__enumvalues = { @@ -1023,26 +839,6 @@ class struct_HIP_ARRAY3D_DESCRIPTOR(Structure): ] HIP_ARRAY3D_DESCRIPTOR = struct_HIP_ARRAY3D_DESCRIPTOR -class struct_hipArray(Structure): - pass - -struct_hipArray._pack_ = 1 # source:False -struct_hipArray._fields_ = [ - ('data', ctypes.POINTER(None)), - ('desc', struct_hipChannelFormatDesc), - ('type', ctypes.c_uint32), - ('width', ctypes.c_uint32), - ('height', ctypes.c_uint32), - ('depth', ctypes.c_uint32), - ('Format', hipArray_Format), - ('NumChannels', ctypes.c_uint32), - ('isDrv', ctypes.c_bool), - ('PADDING_0', ctypes.c_ubyte * 3), - ('textureType', ctypes.c_uint32), - ('flags', ctypes.c_uint32), -] - -hipArray = struct_hipArray class struct_hip_Memcpy2D(Structure): pass @@ -1069,9 +865,6 @@ class struct_hip_Memcpy2D(Structure): ] hip_Memcpy2D = struct_hip_Memcpy2D -hipArray_t = ctypes.POINTER(struct_hipArray) -hiparray = ctypes.POINTER(struct_hipArray) -hipArray_const_t = ctypes.POINTER(struct_hipArray) class struct_hipMipmappedArray(Structure): pass @@ -1560,35 +1353,35 @@ class struct_HIP_MEMCPY3D(Structure): struct_HIP_MEMCPY3D._pack_ = 1 # source:False struct_HIP_MEMCPY3D._fields_ = [ - ('srcXInBytes', ctypes.c_uint32), - ('srcY', ctypes.c_uint32), - ('srcZ', ctypes.c_uint32), - ('srcLOD', ctypes.c_uint32), + ('srcXInBytes', ctypes.c_uint64), + ('srcY', ctypes.c_uint64), + ('srcZ', ctypes.c_uint64), + ('srcLOD', ctypes.c_uint64), ('srcMemoryType', hipMemoryType), ('PADDING_0', ctypes.c_ubyte * 4), ('srcHost', ctypes.POINTER(None)), ('srcDevice', ctypes.POINTER(None)), ('srcArray', ctypes.POINTER(struct_hipArray)), - ('srcPitch', ctypes.c_uint32), - ('srcHeight', ctypes.c_uint32), - ('dstXInBytes', ctypes.c_uint32), - ('dstY', ctypes.c_uint32), - ('dstZ', ctypes.c_uint32), - ('dstLOD', ctypes.c_uint32), + ('srcPitch', ctypes.c_uint64), + ('srcHeight', ctypes.c_uint64), + ('dstXInBytes', ctypes.c_uint64), + ('dstY', ctypes.c_uint64), + ('dstZ', ctypes.c_uint64), + ('dstLOD', ctypes.c_uint64), ('dstMemoryType', hipMemoryType), ('PADDING_1', ctypes.c_ubyte * 4), ('dstHost', ctypes.POINTER(None)), ('dstDevice', ctypes.POINTER(None)), ('dstArray', ctypes.POINTER(struct_hipArray)), - ('dstPitch', ctypes.c_uint32), - ('dstHeight', ctypes.c_uint32), - ('WidthInBytes', ctypes.c_uint32), - ('Height', ctypes.c_uint32), - ('Depth', ctypes.c_uint32), - ('PADDING_2', ctypes.c_ubyte * 4), + ('dstPitch', ctypes.c_uint64), + ('dstHeight', ctypes.c_uint64), + ('WidthInBytes', ctypes.c_uint64), + ('Height', ctypes.c_uint64), + ('Depth', ctypes.c_uint64), ] HIP_MEMCPY3D = struct_HIP_MEMCPY3D +size_t = ctypes.c_uint64 try: make_hipPitchedPtr = _libraries['FIXME_STUB'].make_hipPitchedPtr make_hipPitchedPtr.restype = struct_hipPitchedPtr @@ -1673,6 +1466,12 @@ class struct_HIP_MEMCPY3D(Structure): HIP_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16 HIP_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17 hipPointer_attribute = ctypes.c_uint32 # enum +try: + hip_init = _libraries['FIXME_STUB'].hip_init + hip_init.restype = hipError_t + hip_init.argtypes = [] +except AttributeError: + pass class struct_ihipCtx_t(Structure): pass @@ -2043,6 +1842,7 @@ class struct_hipFunctionLaunchParams_t(Structure): 5: 'hipExternalMemoryHandleTypeD3D12Resource', 6: 'hipExternalMemoryHandleTypeD3D11Resource', 7: 'hipExternalMemoryHandleTypeD3D11ResourceKmt', + 8: 'hipExternalMemoryHandleTypeNvSciBuf', } hipExternalMemoryHandleTypeOpaqueFd = 1 hipExternalMemoryHandleTypeOpaqueWin32 = 2 @@ -2051,6 +1851,7 @@ class struct_hipFunctionLaunchParams_t(Structure): hipExternalMemoryHandleTypeD3D12Resource = 5 hipExternalMemoryHandleTypeD3D11Resource = 6 hipExternalMemoryHandleTypeD3D11ResourceKmt = 7 +hipExternalMemoryHandleTypeNvSciBuf = 8 hipExternalMemoryHandleType_enum = ctypes.c_uint32 # enum hipExternalMemoryHandleType = hipExternalMemoryHandleType_enum hipExternalMemoryHandleType__enumvalues = hipExternalMemoryHandleType_enum__enumvalues @@ -2073,6 +1874,8 @@ class struct_hipExternalMemoryHandleDesc_st_0_win32(Structure): union_hipExternalMemoryHandleDesc_st_handle._fields_ = [ ('fd', ctypes.c_int32), ('win32', struct_hipExternalMemoryHandleDesc_st_0_win32), + ('nvSciBufObject', ctypes.POINTER(None)), + ('PADDING_0', ctypes.c_ubyte * 8), ] struct_hipExternalMemoryHandleDesc_st._pack_ = 1 # source:False @@ -2082,6 +1885,7 @@ class struct_hipExternalMemoryHandleDesc_st_0_win32(Structure): ('handle', union_hipExternalMemoryHandleDesc_st_handle), ('size', ctypes.c_uint64), ('flags', ctypes.c_uint32), + ('reserved', ctypes.c_uint32 * 16), ('PADDING_1', ctypes.c_ubyte * 4), ] @@ -2094,10 +1898,25 @@ class struct_hipExternalMemoryBufferDesc_st(Structure): ('offset', ctypes.c_uint64), ('size', ctypes.c_uint64), ('flags', ctypes.c_uint32), + ('reserved', ctypes.c_uint32 * 16), ('PADDING_0', ctypes.c_ubyte * 4), ] hipExternalMemoryBufferDesc = struct_hipExternalMemoryBufferDesc_st +class struct_hipExternalMemoryMipmappedArrayDesc_st(Structure): + pass + +struct_hipExternalMemoryMipmappedArrayDesc_st._pack_ = 1 # source:False +struct_hipExternalMemoryMipmappedArrayDesc_st._fields_ = [ + ('offset', ctypes.c_uint64), + ('formatDesc', hipChannelFormatDesc), + ('PADDING_0', ctypes.c_ubyte * 4), + ('extent', hipExtent), + ('flags', ctypes.c_uint32), + ('numLevels', ctypes.c_uint32), +] + +hipExternalMemoryMipmappedArrayDesc = struct_hipExternalMemoryMipmappedArrayDesc_st hipExternalMemory_t = ctypes.POINTER(None) # values for enumeration 'hipExternalSemaphoreHandleType_enum' @@ -2106,11 +1925,23 @@ class struct_hipExternalMemoryBufferDesc_st(Structure): 2: 'hipExternalSemaphoreHandleTypeOpaqueWin32', 3: 'hipExternalSemaphoreHandleTypeOpaqueWin32Kmt', 4: 'hipExternalSemaphoreHandleTypeD3D12Fence', + 5: 'hipExternalSemaphoreHandleTypeD3D11Fence', + 6: 'hipExternalSemaphoreHandleTypeNvSciSync', + 7: 'hipExternalSemaphoreHandleTypeKeyedMutex', + 8: 'hipExternalSemaphoreHandleTypeKeyedMutexKmt', + 9: 'hipExternalSemaphoreHandleTypeTimelineSemaphoreFd', + 10: 'hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32', } hipExternalSemaphoreHandleTypeOpaqueFd = 1 hipExternalSemaphoreHandleTypeOpaqueWin32 = 2 hipExternalSemaphoreHandleTypeOpaqueWin32Kmt = 3 hipExternalSemaphoreHandleTypeD3D12Fence = 4 +hipExternalSemaphoreHandleTypeD3D11Fence = 5 +hipExternalSemaphoreHandleTypeNvSciSync = 6 +hipExternalSemaphoreHandleTypeKeyedMutex = 7 +hipExternalSemaphoreHandleTypeKeyedMutexKmt = 8 +hipExternalSemaphoreHandleTypeTimelineSemaphoreFd = 9 +hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32 = 10 hipExternalSemaphoreHandleType_enum = ctypes.c_uint32 # enum hipExternalSemaphoreHandleType = hipExternalSemaphoreHandleType_enum hipExternalSemaphoreHandleType__enumvalues = hipExternalSemaphoreHandleType_enum__enumvalues @@ -2133,6 +1964,8 @@ class struct_hipExternalSemaphoreHandleDesc_st_0_win32(Structure): union_hipExternalSemaphoreHandleDesc_st_handle._fields_ = [ ('fd', ctypes.c_int32), ('win32', struct_hipExternalSemaphoreHandleDesc_st_0_win32), + ('NvSciSyncObj', ctypes.POINTER(None)), + ('PADDING_0', ctypes.c_ubyte * 8), ] struct_hipExternalSemaphoreHandleDesc_st._pack_ = 1 # source:False @@ -2141,6 +1974,7 @@ class struct_hipExternalSemaphoreHandleDesc_st_0_win32(Structure): ('PADDING_0', ctypes.c_ubyte * 4), ('handle', union_hipExternalSemaphoreHandleDesc_st_handle), ('flags', ctypes.c_uint32), + ('reserved', ctypes.c_uint32 * 16), ('PADDING_1', ctypes.c_ubyte * 4), ] @@ -2160,6 +1994,15 @@ class struct_hipExternalSemaphoreSignalParams_st_0_fence(Structure): ('value', ctypes.c_uint64), ] +class union_hipExternalSemaphoreSignalParams_st_0_nvSciSync(Union): + pass + +union_hipExternalSemaphoreSignalParams_st_0_nvSciSync._pack_ = 1 # source:False +union_hipExternalSemaphoreSignalParams_st_0_nvSciSync._fields_ = [ + ('fence', ctypes.POINTER(None)), + ('reserved', ctypes.c_uint64), +] + class struct_hipExternalSemaphoreSignalParams_st_0_keyedMutex(Structure): pass @@ -2171,6 +2014,7 @@ class struct_hipExternalSemaphoreSignalParams_st_0_keyedMutex(Structure): struct_hipExternalSemaphoreSignalParams_st_params._pack_ = 1 # source:False struct_hipExternalSemaphoreSignalParams_st_params._fields_ = [ ('fence', struct_hipExternalSemaphoreSignalParams_st_0_fence), + ('nvSciSync', union_hipExternalSemaphoreSignalParams_st_0_nvSciSync), ('keyedMutex', struct_hipExternalSemaphoreSignalParams_st_0_keyedMutex), ('reserved', ctypes.c_uint32 * 12), ] @@ -2198,6 +2042,15 @@ class struct_hipExternalSemaphoreWaitParams_st_0_fence(Structure): ('value', ctypes.c_uint64), ] +class union_hipExternalSemaphoreWaitParams_st_0_nvSciSync(Union): + pass + +union_hipExternalSemaphoreWaitParams_st_0_nvSciSync._pack_ = 1 # source:False +union_hipExternalSemaphoreWaitParams_st_0_nvSciSync._fields_ = [ + ('fence', ctypes.POINTER(None)), + ('reserved', ctypes.c_uint64), +] + class struct_hipExternalSemaphoreWaitParams_st_0_keyedMutex(Structure): pass @@ -2211,6 +2064,7 @@ class struct_hipExternalSemaphoreWaitParams_st_0_keyedMutex(Structure): struct_hipExternalSemaphoreWaitParams_st_params._pack_ = 1 # source:False struct_hipExternalSemaphoreWaitParams_st_params._fields_ = [ ('fence', struct_hipExternalSemaphoreWaitParams_st_0_fence), + ('nvSciSync', union_hipExternalSemaphoreWaitParams_st_0_nvSciSync), ('keyedMutex', struct_hipExternalSemaphoreWaitParams_st_0_keyedMutex), ('reserved', ctypes.c_uint32 * 10), ] @@ -2231,17 +2085,6 @@ class struct_hipExternalSemaphoreWaitParams_st_0_keyedMutex(Structure): except AttributeError: pass -# values for enumeration 'hipGLDeviceList' -hipGLDeviceList__enumvalues = { - 1: 'hipGLDeviceListAll', - 2: 'hipGLDeviceListCurrentFrame', - 3: 'hipGLDeviceListNextFrame', -} -hipGLDeviceListAll = 1 -hipGLDeviceListCurrentFrame = 2 -hipGLDeviceListNextFrame = 3 -hipGLDeviceList = ctypes.c_uint32 # enum - # values for enumeration 'hipGraphicsRegisterFlags' hipGraphicsRegisterFlags__enumvalues = { 0: 'hipGraphicsRegisterFlagsNone', @@ -2813,9 +2656,9 @@ class union_hipArrayMapInfo_memHandle(Union): except AttributeError: pass try: - hipGetDeviceProperties = _libraries['libamdhip64.so'].hipGetDeviceProperties - hipGetDeviceProperties.restype = hipError_t - hipGetDeviceProperties.argtypes = [ctypes.POINTER(struct_hipDeviceProp_t), ctypes.c_int32] + hipGetDevicePropertiesR0600 = _libraries['libamdhip64.so'].hipGetDevicePropertiesR0600 + hipGetDevicePropertiesR0600.restype = hipError_t + hipGetDevicePropertiesR0600.argtypes = [ctypes.POINTER(struct_hipDeviceProp_tR0600), ctypes.c_int32] except AttributeError: pass try: @@ -2867,9 +2710,9 @@ class union_hipArrayMapInfo_memHandle(Union): except AttributeError: pass try: - hipChooseDevice = _libraries['libamdhip64.so'].hipChooseDevice - hipChooseDevice.restype = hipError_t - hipChooseDevice.argtypes = [ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(struct_hipDeviceProp_t)] + hipChooseDeviceR0600 = _libraries['libamdhip64.so'].hipChooseDeviceR0600 + hipChooseDeviceR0600.restype = hipError_t + hipChooseDeviceR0600.argtypes = [ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(struct_hipDeviceProp_tR0600)] except AttributeError: pass try: @@ -2932,6 +2775,12 @@ class union_hipArrayMapInfo_memHandle(Union): hipGetLastError.argtypes = [] except AttributeError: pass +try: + hipExtGetLastError = _libraries['libamdhip64.so'].hipExtGetLastError + hipExtGetLastError.restype = hipError_t + hipExtGetLastError.argtypes = [] +except AttributeError: + pass try: hipPeekAtLastError = _libraries['libamdhip64.so'].hipPeekAtLastError hipPeekAtLastError.restype = hipError_t @@ -3181,6 +3030,12 @@ class union_hipArrayMapInfo_memHandle(Union): hipDestroyExternalMemory.argtypes = [hipExternalMemory_t] except AttributeError: pass +try: + hipExternalMemoryGetMappedMipmappedArray = _libraries['FIXME_STUB'].hipExternalMemoryGetMappedMipmappedArray + hipExternalMemoryGetMappedMipmappedArray.restype = hipError_t + hipExternalMemoryGetMappedMipmappedArray.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_hipMipmappedArray)), hipExternalMemory_t, ctypes.POINTER(struct_hipExternalMemoryMipmappedArrayDesc_st)] +except AttributeError: + pass try: hipMalloc = _libraries['libamdhip64.so'].hipMalloc hipMalloc.restype = hipError_t @@ -3586,7 +3441,7 @@ class union_hipArrayMapInfo_memHandle(Union): try: hipArrayDestroy = _libraries['libamdhip64.so'].hipArrayDestroy hipArrayDestroy.restype = hipError_t - hipArrayDestroy.argtypes = [ctypes.POINTER(struct_hipArray)] + hipArrayDestroy.argtypes = [hipArray_t] except AttributeError: pass try: @@ -3604,7 +3459,7 @@ class union_hipArrayMapInfo_memHandle(Union): try: hipFreeArray = _libraries['libamdhip64.so'].hipFreeArray hipFreeArray.restype = hipError_t - hipFreeArray.argtypes = [ctypes.POINTER(struct_hipArray)] + hipFreeArray.argtypes = [hipArray_t] except AttributeError: pass try: @@ -3616,19 +3471,19 @@ class union_hipArrayMapInfo_memHandle(Union): try: hipArrayGetInfo = _libraries['libamdhip64.so'].hipArrayGetInfo hipArrayGetInfo.restype = hipError_t - hipArrayGetInfo.argtypes = [ctypes.POINTER(struct_hipChannelFormatDesc), ctypes.POINTER(struct_hipExtent), ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(struct_hipArray)] + hipArrayGetInfo.argtypes = [ctypes.POINTER(struct_hipChannelFormatDesc), ctypes.POINTER(struct_hipExtent), ctypes.POINTER(ctypes.c_uint32), hipArray_t] except AttributeError: pass try: hipArrayGetDescriptor = _libraries['libamdhip64.so'].hipArrayGetDescriptor hipArrayGetDescriptor.restype = hipError_t - hipArrayGetDescriptor.argtypes = [ctypes.POINTER(struct_HIP_ARRAY_DESCRIPTOR), ctypes.POINTER(struct_hipArray)] + hipArrayGetDescriptor.argtypes = [ctypes.POINTER(struct_HIP_ARRAY_DESCRIPTOR), hipArray_t] except AttributeError: pass try: hipArray3DGetDescriptor = _libraries['libamdhip64.so'].hipArray3DGetDescriptor hipArray3DGetDescriptor.restype = hipError_t - hipArray3DGetDescriptor.argtypes = [ctypes.POINTER(struct_HIP_ARRAY3D_DESCRIPTOR), ctypes.POINTER(struct_hipArray)] + hipArray3DGetDescriptor.argtypes = [ctypes.POINTER(struct_HIP_ARRAY3D_DESCRIPTOR), hipArray_t] except AttributeError: pass try: @@ -3658,19 +3513,19 @@ class union_hipArrayMapInfo_memHandle(Union): try: hipMemcpy2DToArray = _libraries['libamdhip64.so'].hipMemcpy2DToArray hipMemcpy2DToArray.restype = hipError_t - hipMemcpy2DToArray.argtypes = [ctypes.POINTER(struct_hipArray), size_t, size_t, ctypes.POINTER(None), size_t, size_t, size_t, hipMemcpyKind] + hipMemcpy2DToArray.argtypes = [hipArray_t, size_t, size_t, ctypes.POINTER(None), size_t, size_t, size_t, hipMemcpyKind] except AttributeError: pass try: hipMemcpy2DToArrayAsync = _libraries['libamdhip64.so'].hipMemcpy2DToArrayAsync hipMemcpy2DToArrayAsync.restype = hipError_t - hipMemcpy2DToArrayAsync.argtypes = [ctypes.POINTER(struct_hipArray), size_t, size_t, ctypes.POINTER(None), size_t, size_t, size_t, hipMemcpyKind, hipStream_t] + hipMemcpy2DToArrayAsync.argtypes = [hipArray_t, size_t, size_t, ctypes.POINTER(None), size_t, size_t, size_t, hipMemcpyKind, hipStream_t] except AttributeError: pass try: hipMemcpyToArray = _libraries['libamdhip64.so'].hipMemcpyToArray hipMemcpyToArray.restype = hipError_t - hipMemcpyToArray.argtypes = [ctypes.POINTER(struct_hipArray), size_t, size_t, ctypes.POINTER(None), size_t, hipMemcpyKind] + hipMemcpyToArray.argtypes = [hipArray_t, size_t, size_t, ctypes.POINTER(None), size_t, hipMemcpyKind] except AttributeError: pass try: @@ -3694,13 +3549,13 @@ class union_hipArrayMapInfo_memHandle(Union): try: hipMemcpyAtoH = _libraries['libamdhip64.so'].hipMemcpyAtoH hipMemcpyAtoH.restype = hipError_t - hipMemcpyAtoH.argtypes = [ctypes.POINTER(None), ctypes.POINTER(struct_hipArray), size_t, size_t] + hipMemcpyAtoH.argtypes = [ctypes.POINTER(None), hipArray_t, size_t, size_t] except AttributeError: pass try: hipMemcpyHtoA = _libraries['libamdhip64.so'].hipMemcpyHtoA hipMemcpyHtoA.restype = hipError_t - hipMemcpyHtoA.argtypes = [ctypes.POINTER(struct_hipArray), size_t, ctypes.POINTER(None), size_t] + hipMemcpyHtoA.argtypes = [hipArray_t, size_t, ctypes.POINTER(None), size_t] except AttributeError: pass try: @@ -4642,6 +4497,12 @@ class struct_hipTextureDesc(Structure): hipGraphExecKernelNodeSetParams.argtypes = [hipGraphExec_t, hipGraphNode_t, ctypes.POINTER(struct_hipKernelNodeParams)] except AttributeError: pass +try: + hipDrvGraphAddMemcpyNode = _libraries['FIXME_STUB'].hipDrvGraphAddMemcpyNode + hipDrvGraphAddMemcpyNode.restype = hipError_t + hipDrvGraphAddMemcpyNode.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), hipGraph_t, ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), size_t, ctypes.POINTER(struct_HIP_MEMCPY3D), hipCtx_t] +except AttributeError: + pass try: hipGraphAddMemcpyNode = _libraries['libamdhip64.so'].hipGraphAddMemcpyNode hipGraphAddMemcpyNode.restype = hipError_t @@ -4948,54 +4809,6 @@ class struct_hipTextureDesc(Structure): hipGraphNodeGetEnabled.argtypes = [hipGraphExec_t, hipGraphNode_t, ctypes.POINTER(ctypes.c_uint32)] except AttributeError: pass -try: - hipGraphAddExternalSemaphoresWaitNode = _libraries['FIXME_STUB'].hipGraphAddExternalSemaphoresWaitNode - hipGraphAddExternalSemaphoresWaitNode.restype = hipError_t - hipGraphAddExternalSemaphoresWaitNode.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), hipGraph_t, ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), size_t, ctypes.POINTER(struct_hipExternalSemaphoreWaitNodeParams)] -except AttributeError: - pass -try: - hipGraphAddExternalSemaphoresSignalNode = _libraries['FIXME_STUB'].hipGraphAddExternalSemaphoresSignalNode - hipGraphAddExternalSemaphoresSignalNode.restype = hipError_t - hipGraphAddExternalSemaphoresSignalNode.argtypes = [ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), hipGraph_t, ctypes.POINTER(ctypes.POINTER(struct_hipGraphNode)), size_t, ctypes.POINTER(struct_hipExternalSemaphoreSignalNodeParams)] -except AttributeError: - pass -try: - hipGraphExternalSemaphoresSignalNodeSetParams = _libraries['FIXME_STUB'].hipGraphExternalSemaphoresSignalNodeSetParams - hipGraphExternalSemaphoresSignalNodeSetParams.restype = hipError_t - hipGraphExternalSemaphoresSignalNodeSetParams.argtypes = [hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreSignalNodeParams)] -except AttributeError: - pass -try: - hipGraphExternalSemaphoresWaitNodeSetParams = _libraries['FIXME_STUB'].hipGraphExternalSemaphoresWaitNodeSetParams - hipGraphExternalSemaphoresWaitNodeSetParams.restype = hipError_t - hipGraphExternalSemaphoresWaitNodeSetParams.argtypes = [hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreWaitNodeParams)] -except AttributeError: - pass -try: - hipGraphExternalSemaphoresSignalNodeGetParams = _libraries['FIXME_STUB'].hipGraphExternalSemaphoresSignalNodeGetParams - hipGraphExternalSemaphoresSignalNodeGetParams.restype = hipError_t - hipGraphExternalSemaphoresSignalNodeGetParams.argtypes = [hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreSignalNodeParams)] -except AttributeError: - pass -try: - hipGraphExternalSemaphoresWaitNodeGetParams = _libraries['FIXME_STUB'].hipGraphExternalSemaphoresWaitNodeGetParams - hipGraphExternalSemaphoresWaitNodeGetParams.restype = hipError_t - hipGraphExternalSemaphoresWaitNodeGetParams.argtypes = [hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreWaitNodeParams)] -except AttributeError: - pass -try: - hipGraphExecExternalSemaphoresSignalNodeSetParams = _libraries['FIXME_STUB'].hipGraphExecExternalSemaphoresSignalNodeSetParams - hipGraphExecExternalSemaphoresSignalNodeSetParams.restype = hipError_t - hipGraphExecExternalSemaphoresSignalNodeSetParams.argtypes = [hipGraphExec_t, hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreSignalNodeParams)] -except AttributeError: - pass -try: - hipGraphExecExternalSemaphoresWaitNodeSetParams = _libraries['FIXME_STUB'].hipGraphExecExternalSemaphoresWaitNodeSetParams - hipGraphExecExternalSemaphoresWaitNodeSetParams.restype = hipError_t - hipGraphExecExternalSemaphoresWaitNodeSetParams.argtypes = [hipGraphExec_t, hipGraphNode_t, ctypes.POINTER(struct_hipExternalSemaphoreWaitNodeParams)] -except AttributeError: - pass try: hipMemAddressFree = _libraries['libamdhip64.so'].hipMemAddressFree hipMemAddressFree.restype = hipError_t @@ -5080,26 +4893,6 @@ class struct_hipTextureDesc(Structure): hipMemUnmap.argtypes = [ctypes.POINTER(None), size_t] except AttributeError: pass -GLuint = ctypes.c_uint32 -GLenum = ctypes.c_uint32 -try: - hipGLGetDevices = _libraries['libamdhip64.so'].hipGLGetDevices - hipGLGetDevices.restype = hipError_t - hipGLGetDevices.argtypes = [ctypes.POINTER(ctypes.c_uint32), ctypes.POINTER(ctypes.c_int32), ctypes.c_uint32, hipGLDeviceList] -except AttributeError: - pass -try: - hipGraphicsGLRegisterBuffer = _libraries['libamdhip64.so'].hipGraphicsGLRegisterBuffer - hipGraphicsGLRegisterBuffer.restype = hipError_t - hipGraphicsGLRegisterBuffer.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hipGraphicsResource)), GLuint, ctypes.c_uint32] -except AttributeError: - pass -try: - hipGraphicsGLRegisterImage = _libraries['libamdhip64.so'].hipGraphicsGLRegisterImage - hipGraphicsGLRegisterImage.restype = hipError_t - hipGraphicsGLRegisterImage.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hipGraphicsResource)), GLuint, GLenum, ctypes.c_uint32] -except AttributeError: - pass try: hipGraphicsMapResources = _libraries['libamdhip64.so'].hipGraphicsMapResources hipGraphicsMapResources.restype = hipError_t @@ -5146,8 +4939,255 @@ class struct___hip_surface(Structure): hipDestroySurfaceObject.argtypes = [hipSurfaceObject_t] except AttributeError: pass +try: + hipExtModuleLaunchKernel = _libraries['FIXME_STUB'].hipExtModuleLaunchKernel + hipExtModuleLaunchKernel.restype = hipError_t + hipExtModuleLaunchKernel.argtypes = [hipFunction_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, size_t, hipStream_t, ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.POINTER(None)), hipEvent_t, hipEvent_t, uint32_t] +except AttributeError: + pass +try: + hipHccModuleLaunchKernel = _libraries['FIXME_STUB'].hipHccModuleLaunchKernel + hipHccModuleLaunchKernel.restype = hipError_t + hipHccModuleLaunchKernel.argtypes = [hipFunction_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, size_t, hipStream_t, ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.POINTER(None)), hipEvent_t, hipEvent_t] +except AttributeError: + pass + +# values for enumeration 'hiprtcResult' +hiprtcResult__enumvalues = { + 0: 'HIPRTC_SUCCESS', + 1: 'HIPRTC_ERROR_OUT_OF_MEMORY', + 2: 'HIPRTC_ERROR_PROGRAM_CREATION_FAILURE', + 3: 'HIPRTC_ERROR_INVALID_INPUT', + 4: 'HIPRTC_ERROR_INVALID_PROGRAM', + 5: 'HIPRTC_ERROR_INVALID_OPTION', + 6: 'HIPRTC_ERROR_COMPILATION', + 7: 'HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE', + 8: 'HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION', + 9: 'HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION', + 10: 'HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID', + 11: 'HIPRTC_ERROR_INTERNAL_ERROR', + 100: 'HIPRTC_ERROR_LINKING', +} +HIPRTC_SUCCESS = 0 +HIPRTC_ERROR_OUT_OF_MEMORY = 1 +HIPRTC_ERROR_PROGRAM_CREATION_FAILURE = 2 +HIPRTC_ERROR_INVALID_INPUT = 3 +HIPRTC_ERROR_INVALID_PROGRAM = 4 +HIPRTC_ERROR_INVALID_OPTION = 5 +HIPRTC_ERROR_COMPILATION = 6 +HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7 +HIPRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8 +HIPRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9 +HIPRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10 +HIPRTC_ERROR_INTERNAL_ERROR = 11 +HIPRTC_ERROR_LINKING = 100 +hiprtcResult = ctypes.c_uint32 # enum + +# values for enumeration 'hiprtcJIT_option' +hiprtcJIT_option__enumvalues = { + 0: 'HIPRTC_JIT_MAX_REGISTERS', + 1: 'HIPRTC_JIT_THREADS_PER_BLOCK', + 2: 'HIPRTC_JIT_WALL_TIME', + 3: 'HIPRTC_JIT_INFO_LOG_BUFFER', + 4: 'HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES', + 5: 'HIPRTC_JIT_ERROR_LOG_BUFFER', + 6: 'HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES', + 7: 'HIPRTC_JIT_OPTIMIZATION_LEVEL', + 8: 'HIPRTC_JIT_TARGET_FROM_HIPCONTEXT', + 9: 'HIPRTC_JIT_TARGET', + 10: 'HIPRTC_JIT_FALLBACK_STRATEGY', + 11: 'HIPRTC_JIT_GENERATE_DEBUG_INFO', + 12: 'HIPRTC_JIT_LOG_VERBOSE', + 13: 'HIPRTC_JIT_GENERATE_LINE_INFO', + 14: 'HIPRTC_JIT_CACHE_MODE', + 15: 'HIPRTC_JIT_NEW_SM3X_OPT', + 16: 'HIPRTC_JIT_FAST_COMPILE', + 17: 'HIPRTC_JIT_GLOBAL_SYMBOL_NAMES', + 18: 'HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS', + 19: 'HIPRTC_JIT_GLOBAL_SYMBOL_COUNT', + 20: 'HIPRTC_JIT_LTO', + 21: 'HIPRTC_JIT_FTZ', + 22: 'HIPRTC_JIT_PREC_DIV', + 23: 'HIPRTC_JIT_PREC_SQRT', + 24: 'HIPRTC_JIT_FMA', + 25: 'HIPRTC_JIT_NUM_OPTIONS', + 10000: 'HIPRTC_JIT_IR_TO_ISA_OPT_EXT', + 10001: 'HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT', +} +HIPRTC_JIT_MAX_REGISTERS = 0 +HIPRTC_JIT_THREADS_PER_BLOCK = 1 +HIPRTC_JIT_WALL_TIME = 2 +HIPRTC_JIT_INFO_LOG_BUFFER = 3 +HIPRTC_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4 +HIPRTC_JIT_ERROR_LOG_BUFFER = 5 +HIPRTC_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6 +HIPRTC_JIT_OPTIMIZATION_LEVEL = 7 +HIPRTC_JIT_TARGET_FROM_HIPCONTEXT = 8 +HIPRTC_JIT_TARGET = 9 +HIPRTC_JIT_FALLBACK_STRATEGY = 10 +HIPRTC_JIT_GENERATE_DEBUG_INFO = 11 +HIPRTC_JIT_LOG_VERBOSE = 12 +HIPRTC_JIT_GENERATE_LINE_INFO = 13 +HIPRTC_JIT_CACHE_MODE = 14 +HIPRTC_JIT_NEW_SM3X_OPT = 15 +HIPRTC_JIT_FAST_COMPILE = 16 +HIPRTC_JIT_GLOBAL_SYMBOL_NAMES = 17 +HIPRTC_JIT_GLOBAL_SYMBOL_ADDRESS = 18 +HIPRTC_JIT_GLOBAL_SYMBOL_COUNT = 19 +HIPRTC_JIT_LTO = 20 +HIPRTC_JIT_FTZ = 21 +HIPRTC_JIT_PREC_DIV = 22 +HIPRTC_JIT_PREC_SQRT = 23 +HIPRTC_JIT_FMA = 24 +HIPRTC_JIT_NUM_OPTIONS = 25 +HIPRTC_JIT_IR_TO_ISA_OPT_EXT = 10000 +HIPRTC_JIT_IR_TO_ISA_OPT_COUNT_EXT = 10001 +hiprtcJIT_option = ctypes.c_uint32 # enum + +# values for enumeration 'hiprtcJITInputType' +hiprtcJITInputType__enumvalues = { + 0: 'HIPRTC_JIT_INPUT_CUBIN', + 1: 'HIPRTC_JIT_INPUT_PTX', + 2: 'HIPRTC_JIT_INPUT_FATBINARY', + 3: 'HIPRTC_JIT_INPUT_OBJECT', + 4: 'HIPRTC_JIT_INPUT_LIBRARY', + 5: 'HIPRTC_JIT_INPUT_NVVM', + 6: 'HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES', + 100: 'HIPRTC_JIT_INPUT_LLVM_BITCODE', + 101: 'HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE', + 102: 'HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE', + 9: 'HIPRTC_JIT_NUM_INPUT_TYPES', +} +HIPRTC_JIT_INPUT_CUBIN = 0 +HIPRTC_JIT_INPUT_PTX = 1 +HIPRTC_JIT_INPUT_FATBINARY = 2 +HIPRTC_JIT_INPUT_OBJECT = 3 +HIPRTC_JIT_INPUT_LIBRARY = 4 +HIPRTC_JIT_INPUT_NVVM = 5 +HIPRTC_JIT_NUM_LEGACY_INPUT_TYPES = 6 +HIPRTC_JIT_INPUT_LLVM_BITCODE = 100 +HIPRTC_JIT_INPUT_LLVM_BUNDLED_BITCODE = 101 +HIPRTC_JIT_INPUT_LLVM_ARCHIVES_OF_BUNDLED_BITCODE = 102 +HIPRTC_JIT_NUM_INPUT_TYPES = 9 +hiprtcJITInputType = ctypes.c_uint32 # enum +class struct_ihiprtcLinkState(Structure): + pass + +hiprtcLinkState = ctypes.POINTER(struct_ihiprtcLinkState) +try: + hiprtcGetErrorString = _libraries['libamdhip64.so'].hiprtcGetErrorString + hiprtcGetErrorString.restype = ctypes.POINTER(ctypes.c_char) + hiprtcGetErrorString.argtypes = [hiprtcResult] +except AttributeError: + pass +try: + hiprtcVersion = _libraries['libamdhip64.so'].hiprtcVersion + hiprtcVersion.restype = hiprtcResult + hiprtcVersion.argtypes = [ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_int32)] +except AttributeError: + pass +class struct__hiprtcProgram(Structure): + pass + +hiprtcProgram = ctypes.POINTER(struct__hiprtcProgram) +try: + hiprtcAddNameExpression = _libraries['libamdhip64.so'].hiprtcAddNameExpression + hiprtcAddNameExpression.restype = hiprtcResult + hiprtcAddNameExpression.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + hiprtcCompileProgram = _libraries['libamdhip64.so'].hiprtcCompileProgram + hiprtcCompileProgram.restype = hiprtcResult + hiprtcCompileProgram.argtypes = [hiprtcProgram, ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] +except AttributeError: + pass +try: + hiprtcCreateProgram = _libraries['libamdhip64.so'].hiprtcCreateProgram + hiprtcCreateProgram.restype = hiprtcResult + hiprtcCreateProgram.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hiprtcProgram)), ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_char), ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char)), ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] +except AttributeError: + pass +try: + hiprtcDestroyProgram = _libraries['libamdhip64.so'].hiprtcDestroyProgram + hiprtcDestroyProgram.restype = hiprtcResult + hiprtcDestroyProgram.argtypes = [ctypes.POINTER(ctypes.POINTER(struct__hiprtcProgram))] +except AttributeError: + pass +try: + hiprtcGetLoweredName = _libraries['libamdhip64.so'].hiprtcGetLoweredName + hiprtcGetLoweredName.restype = hiprtcResult + hiprtcGetLoweredName.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.POINTER(ctypes.c_char))] +except AttributeError: + pass +try: + hiprtcGetProgramLog = _libraries['libamdhip64.so'].hiprtcGetProgramLog + hiprtcGetProgramLog.restype = hiprtcResult + hiprtcGetProgramLog.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + hiprtcGetProgramLogSize = _libraries['libamdhip64.so'].hiprtcGetProgramLogSize + hiprtcGetProgramLogSize.restype = hiprtcResult + hiprtcGetProgramLogSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + hiprtcGetCode = _libraries['libamdhip64.so'].hiprtcGetCode + hiprtcGetCode.restype = hiprtcResult + hiprtcGetCode.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + hiprtcGetCodeSize = _libraries['libamdhip64.so'].hiprtcGetCodeSize + hiprtcGetCodeSize.restype = hiprtcResult + hiprtcGetCodeSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + hiprtcGetBitcode = _libraries['libamdhip64.so'].hiprtcGetBitcode + hiprtcGetBitcode.restype = hiprtcResult + hiprtcGetBitcode.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_char)] +except AttributeError: + pass +try: + hiprtcGetBitcodeSize = _libraries['libamdhip64.so'].hiprtcGetBitcodeSize + hiprtcGetBitcodeSize.restype = hiprtcResult + hiprtcGetBitcodeSize.argtypes = [hiprtcProgram, ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + hiprtcLinkCreate = _libraries['libamdhip64.so'].hiprtcLinkCreate + hiprtcLinkCreate.restype = hiprtcResult + hiprtcLinkCreate.argtypes = [ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.POINTER(struct_ihiprtcLinkState))] +except AttributeError: + pass +try: + hiprtcLinkAddFile = _libraries['libamdhip64.so'].hiprtcLinkAddFile + hiprtcLinkAddFile.restype = hiprtcResult + hiprtcLinkAddFile.argtypes = [hiprtcLinkState, hiprtcJITInputType, ctypes.POINTER(ctypes.c_char), ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None))] +except AttributeError: + pass +try: + hiprtcLinkAddData = _libraries['libamdhip64.so'].hiprtcLinkAddData + hiprtcLinkAddData.restype = hiprtcResult + hiprtcLinkAddData.argtypes = [hiprtcLinkState, hiprtcJITInputType, ctypes.POINTER(None), size_t, ctypes.POINTER(ctypes.c_char), ctypes.c_uint32, ctypes.POINTER(hiprtcJIT_option), ctypes.POINTER(ctypes.POINTER(None))] +except AttributeError: + pass +try: + hiprtcLinkComplete = _libraries['libamdhip64.so'].hiprtcLinkComplete + hiprtcLinkComplete.restype = hiprtcResult + hiprtcLinkComplete.argtypes = [hiprtcLinkState, ctypes.POINTER(ctypes.POINTER(None)), ctypes.POINTER(ctypes.c_uint64)] +except AttributeError: + pass +try: + hiprtcLinkDestroy = _libraries['libamdhip64.so'].hiprtcLinkDestroy + hiprtcLinkDestroy.restype = hiprtcResult + hiprtcLinkDestroy.argtypes = [hiprtcLinkState] +except AttributeError: + pass __all__ = \ - ['GLenum', 'GLuint', 'HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE', + ['HIPRTC_ERROR_BUILTIN_OPERATION_FAILURE', 'HIPRTC_ERROR_COMPILATION', 'HIPRTC_ERROR_INTERNAL_ERROR', 'HIPRTC_ERROR_INVALID_INPUT', 'HIPRTC_ERROR_INVALID_OPTION', 'HIPRTC_ERROR_INVALID_PROGRAM', 'HIPRTC_ERROR_LINKING', @@ -5255,10 +5295,9 @@ class struct___hip_surface(Structure): 'hipAccessPropertyPersisting', 'hipAccessPropertyStreaming', 'hipAddressModeBorder', 'hipAddressModeClamp', 'hipAddressModeMirror', 'hipAddressModeWrap', 'hipApiName', - 'hipArray', 'hipArray3DCreate', 'hipArray3DGetDescriptor', - 'hipArrayCreate', 'hipArrayDestroy', 'hipArrayGetDescriptor', - 'hipArrayGetInfo', 'hipArrayMapInfo', - 'hipArraySparseSubresourceType', + 'hipArray3DCreate', 'hipArray3DGetDescriptor', 'hipArrayCreate', + 'hipArrayDestroy', 'hipArrayGetDescriptor', 'hipArrayGetInfo', + 'hipArrayMapInfo', 'hipArraySparseSubresourceType', 'hipArraySparseSubresourceTypeMiptail', 'hipArraySparseSubresourceTypeSparseLevel', 'hipArray_Format', 'hipArray_const_t', 'hipArray_t', 'hipBindTexture', @@ -5266,7 +5305,7 @@ class struct___hip_surface(Structure): 'hipBindTextureToMipmappedArray', 'hipChannelFormatDesc', 'hipChannelFormatKind', 'hipChannelFormatKindFloat', 'hipChannelFormatKindNone', 'hipChannelFormatKindSigned', - 'hipChannelFormatKindUnsigned', 'hipChooseDevice', + 'hipChannelFormatKindUnsigned', 'hipChooseDeviceR0600', 'hipComputeMode', 'hipComputeModeDefault', 'hipComputeModeExclusive', 'hipComputeModeExclusiveProcess', 'hipComputeModeProhibited', 'hipConfigureCall', @@ -5285,7 +5324,7 @@ class struct___hip_surface(Structure): 'hipDevP2PAttrPerformanceRank', 'hipDeviceArch_t', 'hipDeviceAttributeAccessPolicyMaxWindowSize', 'hipDeviceAttributeAmdSpecificBegin', - 'hipDeviceAttributeAmdSpecificEnd', 'hipDeviceAttributeArch', + 'hipDeviceAttributeAmdSpecificEnd', 'hipDeviceAttributeAsicRevision', 'hipDeviceAttributeAsyncEngineCount', 'hipDeviceAttributeCanMapHostMemory', @@ -5310,12 +5349,12 @@ class struct___hip_surface(Structure): 'hipDeviceAttributeDeviceOverlap', 'hipDeviceAttributeDirectManagedMemAccessFromHost', 'hipDeviceAttributeEccEnabled', - 'hipDeviceAttributeFineGrainSupport', 'hipDeviceAttributeGcnArch', - 'hipDeviceAttributeGcnArchName', + 'hipDeviceAttributeFineGrainSupport', 'hipDeviceAttributeGlobalL1CacheSupported', 'hipDeviceAttributeHdpMemFlushCntl', 'hipDeviceAttributeHdpRegFlushCntl', 'hipDeviceAttributeHostNativeAtomicSupported', + 'hipDeviceAttributeHostRegisterSupported', 'hipDeviceAttributeImageSupport', 'hipDeviceAttributeIntegrated', 'hipDeviceAttributeIsLargeBar', 'hipDeviceAttributeIsMultiGpuBoard', @@ -5364,7 +5403,7 @@ class struct___hip_surface(Structure): 'hipDeviceAttributeMemoryClockRate', 'hipDeviceAttributeMemoryPoolsSupported', 'hipDeviceAttributeMultiGpuBoardGroupID', - 'hipDeviceAttributeMultiprocessorCount', 'hipDeviceAttributeName', + 'hipDeviceAttributeMultiprocessorCount', 'hipDeviceAttributePageableMemoryAccess', 'hipDeviceAttributePageableMemoryAccessUsesHostPageTables', 'hipDeviceAttributePciBusId', 'hipDeviceAttributePciDeviceId', @@ -5382,7 +5421,10 @@ class struct___hip_surface(Structure): 'hipDeviceAttributeTexturePitchAlignment', 'hipDeviceAttributeTotalConstantMemory', 'hipDeviceAttributeTotalGlobalMem', - 'hipDeviceAttributeUnifiedAddressing', 'hipDeviceAttributeUuid', + 'hipDeviceAttributeUnifiedAddressing', + 'hipDeviceAttributeUnused1', 'hipDeviceAttributeUnused2', + 'hipDeviceAttributeUnused3', 'hipDeviceAttributeUnused4', + 'hipDeviceAttributeUnused5', 'hipDeviceAttributeVendorSpecificBegin', 'hipDeviceAttributeVirtualMemoryManagementSupported', 'hipDeviceAttributeWallClockRate', 'hipDeviceAttributeWarpSize', @@ -5398,21 +5440,22 @@ class struct___hip_surface(Structure): 'hipDeviceGetUuid', 'hipDeviceGraphMemTrim', 'hipDeviceP2PAttr', 'hipDevicePrimaryCtxGetState', 'hipDevicePrimaryCtxRelease', 'hipDevicePrimaryCtxReset', 'hipDevicePrimaryCtxRetain', - 'hipDevicePrimaryCtxSetFlags', 'hipDeviceProp_t', + 'hipDevicePrimaryCtxSetFlags', 'hipDeviceProp_tR0600', 'hipDeviceReset', 'hipDeviceSetCacheConfig', 'hipDeviceSetGraphMemAttribute', 'hipDeviceSetLimit', 'hipDeviceSetMemPool', 'hipDeviceSetSharedMemConfig', 'hipDeviceSynchronize', 'hipDeviceTotalMem', 'hipDevice_t', 'hipDeviceptr_t', 'hipDriverGetVersion', 'hipDrvGetErrorName', - 'hipDrvGetErrorString', 'hipDrvMemcpy2DUnaligned', - 'hipDrvMemcpy3D', 'hipDrvMemcpy3DAsync', - 'hipDrvPointerGetAttributes', 'hipErrorAlreadyAcquired', - 'hipErrorAlreadyMapped', 'hipErrorArrayIsMapped', - 'hipErrorAssert', 'hipErrorCapturedEvent', - 'hipErrorContextAlreadyCurrent', 'hipErrorContextAlreadyInUse', - 'hipErrorContextIsDestroyed', 'hipErrorCooperativeLaunchTooLarge', - 'hipErrorDeinitialized', 'hipErrorECCNotCorrectable', - 'hipErrorFileNotFound', 'hipErrorGraphExecUpdateFailure', + 'hipDrvGetErrorString', 'hipDrvGraphAddMemcpyNode', + 'hipDrvMemcpy2DUnaligned', 'hipDrvMemcpy3D', + 'hipDrvMemcpy3DAsync', 'hipDrvPointerGetAttributes', + 'hipErrorAlreadyAcquired', 'hipErrorAlreadyMapped', + 'hipErrorArrayIsMapped', 'hipErrorAssert', + 'hipErrorCapturedEvent', 'hipErrorContextAlreadyCurrent', + 'hipErrorContextAlreadyInUse', 'hipErrorContextIsDestroyed', + 'hipErrorCooperativeLaunchTooLarge', 'hipErrorDeinitialized', + 'hipErrorECCNotCorrectable', 'hipErrorFileNotFound', + 'hipErrorGraphExecUpdateFailure', 'hipErrorHostMemoryAlreadyRegistered', 'hipErrorHostMemoryNotRegistered', 'hipErrorIllegalAddress', 'hipErrorIllegalState', 'hipErrorInitializationError', @@ -5450,28 +5493,37 @@ class struct___hip_surface(Structure): 'hipErrorUnsupportedLimit', 'hipError_t', 'hipEventCreate', 'hipEventCreateWithFlags', 'hipEventDestroy', 'hipEventElapsedTime', 'hipEventQuery', 'hipEventRecord', - 'hipEventSynchronize', 'hipEvent_t', + 'hipEventSynchronize', 'hipEvent_t', 'hipExtGetLastError', 'hipExtGetLinkTypeAndHopCount', 'hipExtLaunchKernel', 'hipExtLaunchMultiKernelMultiDevice', 'hipExtMallocWithFlags', - 'hipExtStreamCreateWithCUMask', 'hipExtStreamGetCUMask', - 'hipExtent', 'hipExternalMemoryBufferDesc', - 'hipExternalMemoryGetMappedBuffer', 'hipExternalMemoryHandleDesc', - 'hipExternalMemoryHandleType', + 'hipExtModuleLaunchKernel', 'hipExtStreamCreateWithCUMask', + 'hipExtStreamGetCUMask', 'hipExtent', + 'hipExternalMemoryBufferDesc', 'hipExternalMemoryGetMappedBuffer', + 'hipExternalMemoryGetMappedMipmappedArray', + 'hipExternalMemoryHandleDesc', 'hipExternalMemoryHandleType', 'hipExternalMemoryHandleTypeD3D11Resource', 'hipExternalMemoryHandleTypeD3D11ResourceKmt', 'hipExternalMemoryHandleTypeD3D12Heap', 'hipExternalMemoryHandleTypeD3D12Resource', + 'hipExternalMemoryHandleTypeNvSciBuf', 'hipExternalMemoryHandleTypeOpaqueFd', 'hipExternalMemoryHandleTypeOpaqueWin32', 'hipExternalMemoryHandleTypeOpaqueWin32Kmt', 'hipExternalMemoryHandleType__enumvalues', - 'hipExternalMemoryHandleType_enum', 'hipExternalMemory_t', + 'hipExternalMemoryHandleType_enum', + 'hipExternalMemoryMipmappedArrayDesc', 'hipExternalMemory_t', 'hipExternalSemaphoreHandleDesc', 'hipExternalSemaphoreHandleType', + 'hipExternalSemaphoreHandleTypeD3D11Fence', 'hipExternalSemaphoreHandleTypeD3D12Fence', + 'hipExternalSemaphoreHandleTypeKeyedMutex', + 'hipExternalSemaphoreHandleTypeKeyedMutexKmt', + 'hipExternalSemaphoreHandleTypeNvSciSync', 'hipExternalSemaphoreHandleTypeOpaqueFd', 'hipExternalSemaphoreHandleTypeOpaqueWin32', 'hipExternalSemaphoreHandleTypeOpaqueWin32Kmt', + 'hipExternalSemaphoreHandleTypeTimelineSemaphoreFd', + 'hipExternalSemaphoreHandleTypeTimelineSemaphoreWin32', 'hipExternalSemaphoreHandleType__enumvalues', 'hipExternalSemaphoreHandleType_enum', 'hipExternalSemaphoreSignalNodeParams', @@ -5490,11 +5542,9 @@ class struct___hip_surface(Structure): 'hipFuncGetAttribute', 'hipFuncGetAttributes', 'hipFuncSetAttribute', 'hipFuncSetCacheConfig', 'hipFuncSetSharedMemConfig', 'hipFunctionLaunchParams', - 'hipFunction_attribute', 'hipFunction_t', 'hipGLDeviceList', - 'hipGLDeviceListAll', 'hipGLDeviceListCurrentFrame', - 'hipGLDeviceListNextFrame', 'hipGLGetDevices', - 'hipGetChannelDesc', 'hipGetDevice', 'hipGetDeviceCount', - 'hipGetDeviceFlags', 'hipGetDeviceProperties', 'hipGetErrorName', + 'hipFunction_attribute', 'hipFunction_t', 'hipGetChannelDesc', + 'hipGetDevice', 'hipGetDeviceCount', 'hipGetDeviceFlags', + 'hipGetDevicePropertiesR0600', 'hipGetErrorName', 'hipGetErrorString', 'hipGetLastError', 'hipGetMipmappedArrayLevel', 'hipGetStreamDeviceId', 'hipGetSymbolAddress', 'hipGetSymbolSize', @@ -5503,9 +5553,7 @@ class struct___hip_surface(Structure): 'hipGetTextureObjectTextureDesc', 'hipGetTextureReference', 'hipGraphAddChildGraphNode', 'hipGraphAddDependencies', 'hipGraphAddEmptyNode', 'hipGraphAddEventRecordNode', - 'hipGraphAddEventWaitNode', - 'hipGraphAddExternalSemaphoresSignalNode', - 'hipGraphAddExternalSemaphoresWaitNode', 'hipGraphAddHostNode', + 'hipGraphAddEventWaitNode', 'hipGraphAddHostNode', 'hipGraphAddKernelNode', 'hipGraphAddMemAllocNode', 'hipGraphAddMemFreeNode', 'hipGraphAddMemcpyNode', 'hipGraphAddMemcpyNode1D', 'hipGraphAddMemcpyNodeFromSymbol', @@ -5529,8 +5577,6 @@ class struct___hip_surface(Structure): 'hipGraphExecChildGraphNodeSetParams', 'hipGraphExecDestroy', 'hipGraphExecEventRecordNodeSetEvent', 'hipGraphExecEventWaitNodeSetEvent', - 'hipGraphExecExternalSemaphoresSignalNodeSetParams', - 'hipGraphExecExternalSemaphoresWaitNodeSetParams', 'hipGraphExecHostNodeSetParams', 'hipGraphExecKernelNodeSetParams', 'hipGraphExecMemcpyNodeSetParams', @@ -5546,13 +5592,10 @@ class struct___hip_surface(Structure): 'hipGraphExecUpdateErrorTopologyChanged', 'hipGraphExecUpdateErrorUnsupportedFunctionChange', 'hipGraphExecUpdateResult', 'hipGraphExecUpdateSuccess', - 'hipGraphExec_t', 'hipGraphExternalSemaphoresSignalNodeGetParams', - 'hipGraphExternalSemaphoresSignalNodeSetParams', - 'hipGraphExternalSemaphoresWaitNodeGetParams', - 'hipGraphExternalSemaphoresWaitNodeSetParams', 'hipGraphGetEdges', - 'hipGraphGetNodes', 'hipGraphGetRootNodes', - 'hipGraphHostNodeGetParams', 'hipGraphHostNodeSetParams', - 'hipGraphInstantiate', 'hipGraphInstantiateFlagAutoFreeOnLaunch', + 'hipGraphExec_t', 'hipGraphGetEdges', 'hipGraphGetNodes', + 'hipGraphGetRootNodes', 'hipGraphHostNodeGetParams', + 'hipGraphHostNodeSetParams', 'hipGraphInstantiate', + 'hipGraphInstantiateFlagAutoFreeOnLaunch', 'hipGraphInstantiateFlagDeviceLaunch', 'hipGraphInstantiateFlagUpload', 'hipGraphInstantiateFlagUseNodePriority', @@ -5583,10 +5626,8 @@ class struct___hip_surface(Structure): 'hipGraphNodeTypeWaitEvent', 'hipGraphNode_t', 'hipGraphReleaseUserObject', 'hipGraphRemoveDependencies', 'hipGraphRetainUserObject', 'hipGraphUpload', - 'hipGraphUserObjectMove', 'hipGraph_t', - 'hipGraphicsGLRegisterBuffer', 'hipGraphicsGLRegisterImage', - 'hipGraphicsMapResources', 'hipGraphicsRegisterFlags', - 'hipGraphicsRegisterFlagsNone', + 'hipGraphUserObjectMove', 'hipGraph_t', 'hipGraphicsMapResources', + 'hipGraphicsRegisterFlags', 'hipGraphicsRegisterFlagsNone', 'hipGraphicsRegisterFlagsReadOnly', 'hipGraphicsRegisterFlagsSurfaceLoadStore', 'hipGraphicsRegisterFlagsTextureGather', @@ -5594,12 +5635,13 @@ class struct___hip_surface(Structure): 'hipGraphicsResourceGetMappedPointer', 'hipGraphicsResource_t', 'hipGraphicsSubResourceGetMappedArray', 'hipGraphicsUnmapResources', 'hipGraphicsUnregisterResource', - 'hipHostAlloc', 'hipHostFn_t', 'hipHostFree', - 'hipHostGetDevicePointer', 'hipHostGetFlags', 'hipHostMalloc', - 'hipHostNodeParams', 'hipHostRegister', 'hipHostUnregister', - 'hipImportExternalMemory', 'hipImportExternalSemaphore', - 'hipInit', 'hipIpcCloseMemHandle', 'hipIpcEventHandle_t', - 'hipIpcGetEventHandle', 'hipIpcGetMemHandle', 'hipIpcMemHandle_t', + 'hipHccModuleLaunchKernel', 'hipHostAlloc', 'hipHostFn_t', + 'hipHostFree', 'hipHostGetDevicePointer', 'hipHostGetFlags', + 'hipHostMalloc', 'hipHostNodeParams', 'hipHostRegister', + 'hipHostUnregister', 'hipImportExternalMemory', + 'hipImportExternalSemaphore', 'hipInit', 'hipIpcCloseMemHandle', + 'hipIpcEventHandle_t', 'hipIpcGetEventHandle', + 'hipIpcGetMemHandle', 'hipIpcMemHandle_t', 'hipIpcOpenEventHandle', 'hipIpcOpenMemHandle', 'hipJitOption', 'hipJitOptionCacheMode', 'hipJitOptionErrorLogBuffer', 'hipJitOptionErrorLogBufferSizeBytes', @@ -5690,16 +5732,17 @@ class struct___hip_surface(Structure): 'hipMemcpyToSymbolAsync', 'hipMemcpyWithStream', 'hipMemoryAdvise', 'hipMemoryType', 'hipMemoryTypeArray', 'hipMemoryTypeDevice', 'hipMemoryTypeHost', - 'hipMemoryTypeManaged', 'hipMemoryTypeUnified', 'hipMemset', - 'hipMemset2D', 'hipMemset2DAsync', 'hipMemset3D', - 'hipMemset3DAsync', 'hipMemsetAsync', 'hipMemsetD16', - 'hipMemsetD16Async', 'hipMemsetD32', 'hipMemsetD32Async', - 'hipMemsetD8', 'hipMemsetD8Async', 'hipMemsetParams', - 'hipMipmappedArray', 'hipMipmappedArrayCreate', - 'hipMipmappedArrayDestroy', 'hipMipmappedArrayGetLevel', - 'hipMipmappedArray_const_t', 'hipMipmappedArray_t', - 'hipModuleGetFunction', 'hipModuleGetGlobal', - 'hipModuleGetTexRef', 'hipModuleLaunchCooperativeKernel', + 'hipMemoryTypeManaged', 'hipMemoryTypeUnified', + 'hipMemoryTypeUnregistered', 'hipMemset', 'hipMemset2D', + 'hipMemset2DAsync', 'hipMemset3D', 'hipMemset3DAsync', + 'hipMemsetAsync', 'hipMemsetD16', 'hipMemsetD16Async', + 'hipMemsetD32', 'hipMemsetD32Async', 'hipMemsetD8', + 'hipMemsetD8Async', 'hipMemsetParams', 'hipMipmappedArray', + 'hipMipmappedArrayCreate', 'hipMipmappedArrayDestroy', + 'hipMipmappedArrayGetLevel', 'hipMipmappedArray_const_t', + 'hipMipmappedArray_t', 'hipModuleGetFunction', + 'hipModuleGetGlobal', 'hipModuleGetTexRef', + 'hipModuleLaunchCooperativeKernel', 'hipModuleLaunchCooperativeKernelMultiDevice', 'hipModuleLaunchKernel', 'hipModuleLoad', 'hipModuleLoadData', 'hipModuleLoadDataEx', @@ -5787,7 +5830,7 @@ class struct___hip_surface(Structure): 'hipUserObjectFlags', 'hipUserObjectNoDestructorSync', 'hipUserObjectRelease', 'hipUserObjectRetain', 'hipUserObjectRetainFlags', 'hipUserObject_t', - 'hipWaitExternalSemaphoresAsync', 'hip_Memcpy2D', 'hiparray', + 'hipWaitExternalSemaphoresAsync', 'hip_Memcpy2D', 'hip_init', 'hipmipmappedArray', 'hiprtcAddNameExpression', 'hiprtcCompileProgram', 'hiprtcCreateProgram', 'hiprtcDestroyProgram', 'hiprtcGetBitcode', @@ -5813,10 +5856,11 @@ class struct___hip_surface(Structure): 'struct_hipAccessPolicyWindow', 'struct_hipArray', 'struct_hipArrayMapInfo', 'struct_hipArrayMapInfo_1_miptail', 'struct_hipArrayMapInfo_1_sparseLevel', - 'struct_hipChannelFormatDesc', 'struct_hipDeviceProp_t', + 'struct_hipChannelFormatDesc', 'struct_hipDeviceProp_tR0600', 'struct_hipExtent', 'struct_hipExternalMemoryBufferDesc_st', 'struct_hipExternalMemoryHandleDesc_st', 'struct_hipExternalMemoryHandleDesc_st_0_win32', + 'struct_hipExternalMemoryMipmappedArrayDesc_st', 'struct_hipExternalSemaphoreHandleDesc_st', 'struct_hipExternalSemaphoreHandleDesc_st_0_win32', 'struct_hipExternalSemaphoreSignalNodeParams', @@ -5857,5 +5901,8 @@ class struct___hip_surface(Structure): 'union_hipArrayMapInfo_subresource', 'union_hipExternalMemoryHandleDesc_st_handle', 'union_hipExternalSemaphoreHandleDesc_st_handle', - 'union_hipKernelNodeAttrValue', 'union_hipPointerAttribute_t_0', - 'union_hipResourceDesc_res'] + 'union_hipExternalSemaphoreSignalParams_st_0_nvSciSync', + 'union_hipExternalSemaphoreWaitParams_st_0_nvSciSync', + 'union_hipKernelNodeAttrValue', 'union_hipResourceDesc_res'] +hipDeviceProp_t = hipDeviceProp_tR0600 +hipGetDeviceProperties = hipGetDevicePropertiesR0600 diff --git a/setup.py b/setup.py index 841378d..19cfb71 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ description = (Path(__file__).resolve().parent / "README.md").read_text() setup(name='gpuctypes', - version='0.2.0', + version='0.3.0', description='ctypes wrappers for HIP, CUDA, and OpenCL', author='George Hotz', long_description=description, diff --git a/test/test_hip.py b/test/test_hip.py index 57aca33..ea88b24 100644 --- a/test/test_hip.py +++ b/test/test_hip.py @@ -1,6 +1,7 @@ import unittest import ctypes import gpuctypes.hip as hip +import gpuctypes.comgr as comgr from helpers import CI, expectedFailureIf, cuda_compile def check(status): @@ -29,6 +30,10 @@ def test_compile(self): prg = cuda_compile("int test() { return 42; }", ["--offload-arch=gfx1100"], HIPCompile, check) assert len(prg) > 10 + def test_comgr(self): + status = comgr.amd_comgr_create_action_info(ctypes.byref(action_info := comgr.amd_comgr_action_info_t())) + assert status == 0 + class TestHIPDevice(unittest.TestCase): @expectedFailureIf(CI) def test_malloc(self):