diff --git a/include/ur.py b/include/ur.py index 7b95e910a8..4e666c8114 100644 --- a/include/ur.py +++ b/include/ur.py @@ -19,6 +19,51 @@ ############################################################################### __version__ = "1.0" +############################################################################### +## @brief Defines structure types +class ur_structure_type_v(IntEnum): + CONTEXT_PROPERTIES = 0 ## ::ur_context_properties_t + IMAGE_DESC = 1 ## ::ur_image_desc_t + BUFFER_PROPERTIES = 2 ## ::ur_buffer_properties_t + BUFFER_REGION = 3 ## ::ur_buffer_region_t + BUFFER_CHANNEL_PROPERTIES = 4 ## ::ur_buffer_channel_properties_t + BUFFER_ALLOC_LOCATION_PROPERTIES = 5 ## ::ur_buffer_alloc_location_properties_t + PROGRAM_PROPERTIES = 6 ## ::ur_program_properties_t + USM_DESC = 7 ## ::ur_usm_desc_t + USM_HOST_DESC = 8 ## ::ur_usm_host_desc_t + USM_DEVICE_DESC = 9 ## ::ur_usm_device_desc_t + USM_POOL_DESC = 10 ## ::ur_usm_pool_desc_t + USM_POOL_LIMITS_DESC = 11 ## ::ur_usm_pool_limits_desc_t + DEVICE_BINARY = 12 ## ::ur_device_binary_t + SAMPLER_DESC = 13 ## ::ur_sampler_desc_t + QUEUE_PROPERTIES = 14 ## ::ur_queue_properties_t + QUEUE_INDEX_PROPERTIES = 15 ## ::ur_queue_properties_t + CONTEXT_NATIVE_PROPERTIES = 16 ## ::ur_context_native_properties_t + KERNEL_NATIVE_PROPERTIES = 17 ## ::ur_kernel_native_properties_t + QUEUE_NATIVE_PROPERTIES = 18 ## ::ur_queue_native_properties_t + MEM_NATIVE_PROPERTIES = 19 ## ::ur_mem_native_properties_t + EVENT_NATIVE_PROPERTIES = 20 ## ::ur_event_native_properties_t + PLATFORM_NATIVE_PROPERTIES = 21 ## ::ur_platform_native_properties_t + DEVICE_NATIVE_PROPERTIES = 22 ## ::ur_device_native_properties_t + PROGRAM_NATIVE_PROPERTIES = 23 ## ::ur_program_native_properties_t + SAMPLER_NATIVE_PROPERTIES = 24 ## ::ur_sampler_native_properties_t + QUEUE_NATIVE_DESC = 25 ## ::ur_queue_native_desc_t + DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t + KERNEL_ARG_MEM_OBJ_PROPERTIES = 27 ## ::ur_kernel_arg_mem_obj_properties_t + PHYSICAL_MEM_PROPERTIES = 28 ## ::ur_physical_mem_properties_t + KERNEL_ARG_VALUE_PROPERTIES = 29 ## ::ur_kernel_arg_value_properties_t + KERNEL_ARG_LOCAL_PROPERTIES = 30 ## ::ur_kernel_arg_local_properties_t + KERNEL_ARG_POINTER_PROPERTIES = 31 ## ::ur_kernel_arg_pointer_properties_t + KERNEL_EXEC_INFO_PROPERTIES = 32 ## ::ur_kernel_exec_info_properties_t + KERNEL_ARG_SAMPLER_PROPERTIES = 33 ## ::ur_kernel_arg_sampler_properties_t + EXP_COMMAND_BUFFER_DESC = 0x1000 ## ::ur_exp_command_buffer_desc_t + EXP_SAMPLER_MIP_PROPERTIES = 0x2000 ## ::ur_exp_sampler_mip_properties_t + +class ur_structure_type_t(c_int): + def __str__(self): + return str(ur_structure_type_v(self.value)) + + ############################################################################### ## @brief Generates generic 'oneAPI' API versions def UR_MAKE_VERSION( _major, _minor ): @@ -206,51 +251,6 @@ def __str__(self): return str(ur_result_v(self.value)) -############################################################################### -## @brief Defines structure types -class ur_structure_type_v(IntEnum): - CONTEXT_PROPERTIES = 0 ## ::ur_context_properties_t - IMAGE_DESC = 1 ## ::ur_image_desc_t - BUFFER_PROPERTIES = 2 ## ::ur_buffer_properties_t - BUFFER_REGION = 3 ## ::ur_buffer_region_t - BUFFER_CHANNEL_PROPERTIES = 4 ## ::ur_buffer_channel_properties_t - BUFFER_ALLOC_LOCATION_PROPERTIES = 5 ## ::ur_buffer_alloc_location_properties_t - PROGRAM_PROPERTIES = 6 ## ::ur_program_properties_t - USM_DESC = 7 ## ::ur_usm_desc_t - USM_HOST_DESC = 8 ## ::ur_usm_host_desc_t - USM_DEVICE_DESC = 9 ## ::ur_usm_device_desc_t - USM_POOL_DESC = 10 ## ::ur_usm_pool_desc_t - USM_POOL_LIMITS_DESC = 11 ## ::ur_usm_pool_limits_desc_t - DEVICE_BINARY = 12 ## ::ur_device_binary_t - SAMPLER_DESC = 13 ## ::ur_sampler_desc_t - QUEUE_PROPERTIES = 14 ## ::ur_queue_properties_t - QUEUE_INDEX_PROPERTIES = 15 ## ::ur_queue_properties_t - CONTEXT_NATIVE_PROPERTIES = 16 ## ::ur_context_native_properties_t - KERNEL_NATIVE_PROPERTIES = 17 ## ::ur_kernel_native_properties_t - QUEUE_NATIVE_PROPERTIES = 18 ## ::ur_queue_native_properties_t - MEM_NATIVE_PROPERTIES = 19 ## ::ur_mem_native_properties_t - EVENT_NATIVE_PROPERTIES = 20 ## ::ur_event_native_properties_t - PLATFORM_NATIVE_PROPERTIES = 21 ## ::ur_platform_native_properties_t - DEVICE_NATIVE_PROPERTIES = 22 ## ::ur_device_native_properties_t - PROGRAM_NATIVE_PROPERTIES = 23 ## ::ur_program_native_properties_t - SAMPLER_NATIVE_PROPERTIES = 24 ## ::ur_sampler_native_properties_t - QUEUE_NATIVE_DESC = 25 ## ::ur_queue_native_desc_t - DEVICE_PARTITION_PROPERTIES = 26 ## ::ur_device_partition_properties_t - KERNEL_ARG_MEM_OBJ_PROPERTIES = 27 ## ::ur_kernel_arg_mem_obj_properties_t - PHYSICAL_MEM_PROPERTIES = 28 ## ::ur_physical_mem_properties_t - KERNEL_ARG_POINTER_PROPERTIES = 29 ## ::ur_kernel_arg_pointer_properties_t - KERNEL_ARG_SAMPLER_PROPERTIES = 30 ## ::ur_kernel_arg_sampler_properties_t - KERNEL_EXEC_INFO_PROPERTIES = 31 ## ::ur_kernel_exec_info_properties_t - KERNEL_ARG_VALUE_PROPERTIES = 32 ## ::ur_kernel_arg_value_properties_t - KERNEL_ARG_LOCAL_PROPERTIES = 33 ## ::ur_kernel_arg_local_properties_t - EXP_COMMAND_BUFFER_DESC = 0x1000 ## ::ur_exp_command_buffer_desc_t - EXP_SAMPLER_MIP_PROPERTIES = 0x2000 ## ::ur_exp_sampler_mip_properties_t - -class ur_structure_type_t(c_int): - def __str__(self): - return str(ur_structure_type_v(self.value)) - - ############################################################################### ## @brief Base for all properties types class ur_base_properties_t(Structure): diff --git a/include/ur_api.h b/include/ur_api.h index 622bb325cc..e1f89e2109 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -24,6 +24,58 @@ extern "C" { #endif +// Intel 'oneAPI' Unified Runtime structure type +#if !defined(__GNUC__) +#pragma region structure +#endif +/////////////////////////////////////////////////////////////////////////////// +/// @brief Defines structure types +typedef enum ur_structure_type_t { + UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES = 0, ///< ::ur_context_properties_t + UR_STRUCTURE_TYPE_IMAGE_DESC = 1, ///< ::ur_image_desc_t + UR_STRUCTURE_TYPE_BUFFER_PROPERTIES = 2, ///< ::ur_buffer_properties_t + UR_STRUCTURE_TYPE_BUFFER_REGION = 3, ///< ::ur_buffer_region_t + UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES = 4, ///< ::ur_buffer_channel_properties_t + UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES = 5, ///< ::ur_buffer_alloc_location_properties_t + UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES = 6, ///< ::ur_program_properties_t + UR_STRUCTURE_TYPE_USM_DESC = 7, ///< ::ur_usm_desc_t + UR_STRUCTURE_TYPE_USM_HOST_DESC = 8, ///< ::ur_usm_host_desc_t + UR_STRUCTURE_TYPE_USM_DEVICE_DESC = 9, ///< ::ur_usm_device_desc_t + UR_STRUCTURE_TYPE_USM_POOL_DESC = 10, ///< ::ur_usm_pool_desc_t + UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC = 11, ///< ::ur_usm_pool_limits_desc_t + UR_STRUCTURE_TYPE_DEVICE_BINARY = 12, ///< ::ur_device_binary_t + UR_STRUCTURE_TYPE_SAMPLER_DESC = 13, ///< ::ur_sampler_desc_t + UR_STRUCTURE_TYPE_QUEUE_PROPERTIES = 14, ///< ::ur_queue_properties_t + UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES = 15, ///< ::ur_queue_properties_t + UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES = 16, ///< ::ur_context_native_properties_t + UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES = 17, ///< ::ur_kernel_native_properties_t + UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES = 18, ///< ::ur_queue_native_properties_t + UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES = 19, ///< ::ur_mem_native_properties_t + UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES = 20, ///< ::ur_event_native_properties_t + UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES = 21, ///< ::ur_platform_native_properties_t + UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES = 22, ///< ::ur_device_native_properties_t + UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES = 23, ///< ::ur_program_native_properties_t + UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES = 24, ///< ::ur_sampler_native_properties_t + UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC = 25, ///< ::ur_queue_native_desc_t + UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES = 27, ///< ::ur_kernel_arg_mem_obj_properties_t + UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES = 28, ///< ::ur_physical_mem_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES = 29, ///< ::ur_kernel_arg_value_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES = 30, ///< ::ur_kernel_arg_local_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES = 31, ///< ::ur_kernel_arg_pointer_properties_t + UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES = 32, ///< ::ur_kernel_exec_info_properties_t + UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES = 33, ///< ::ur_kernel_arg_sampler_properties_t + UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC = 0x1000, ///< ::ur_exp_command_buffer_desc_t + UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES = 0x2000, ///< ::ur_exp_sampler_mip_properties_t + /// @cond + UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff + /// @endcond + +} ur_structure_type_t; + +#if !defined(__GNUC__) +#pragma endregion +#endif // Intel 'oneAPI' Unified Runtime API common types #if !defined(__GNUC__) #pragma region common @@ -229,51 +281,6 @@ typedef enum ur_result_t { } ur_result_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Defines structure types -typedef enum ur_structure_type_t { - UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES = 0, ///< ::ur_context_properties_t - UR_STRUCTURE_TYPE_IMAGE_DESC = 1, ///< ::ur_image_desc_t - UR_STRUCTURE_TYPE_BUFFER_PROPERTIES = 2, ///< ::ur_buffer_properties_t - UR_STRUCTURE_TYPE_BUFFER_REGION = 3, ///< ::ur_buffer_region_t - UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES = 4, ///< ::ur_buffer_channel_properties_t - UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES = 5, ///< ::ur_buffer_alloc_location_properties_t - UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES = 6, ///< ::ur_program_properties_t - UR_STRUCTURE_TYPE_USM_DESC = 7, ///< ::ur_usm_desc_t - UR_STRUCTURE_TYPE_USM_HOST_DESC = 8, ///< ::ur_usm_host_desc_t - UR_STRUCTURE_TYPE_USM_DEVICE_DESC = 9, ///< ::ur_usm_device_desc_t - UR_STRUCTURE_TYPE_USM_POOL_DESC = 10, ///< ::ur_usm_pool_desc_t - UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC = 11, ///< ::ur_usm_pool_limits_desc_t - UR_STRUCTURE_TYPE_DEVICE_BINARY = 12, ///< ::ur_device_binary_t - UR_STRUCTURE_TYPE_SAMPLER_DESC = 13, ///< ::ur_sampler_desc_t - UR_STRUCTURE_TYPE_QUEUE_PROPERTIES = 14, ///< ::ur_queue_properties_t - UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES = 15, ///< ::ur_queue_properties_t - UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES = 16, ///< ::ur_context_native_properties_t - UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES = 17, ///< ::ur_kernel_native_properties_t - UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES = 18, ///< ::ur_queue_native_properties_t - UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES = 19, ///< ::ur_mem_native_properties_t - UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES = 20, ///< ::ur_event_native_properties_t - UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES = 21, ///< ::ur_platform_native_properties_t - UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES = 22, ///< ::ur_device_native_properties_t - UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES = 23, ///< ::ur_program_native_properties_t - UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES = 24, ///< ::ur_sampler_native_properties_t - UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC = 25, ///< ::ur_queue_native_desc_t - UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES = 26, ///< ::ur_device_partition_properties_t - UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES = 27, ///< ::ur_kernel_arg_mem_obj_properties_t - UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES = 28, ///< ::ur_physical_mem_properties_t - UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES = 29, ///< ::ur_kernel_arg_pointer_properties_t - UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES = 30, ///< ::ur_kernel_arg_sampler_properties_t - UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES = 31, ///< ::ur_kernel_exec_info_properties_t - UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES = 32, ///< ::ur_kernel_arg_value_properties_t - UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES = 33, ///< ::ur_kernel_arg_local_properties_t - UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC = 0x1000, ///< ::ur_exp_command_buffer_desc_t - UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES = 0x2000, ///< ::ur_exp_sampler_mip_properties_t - /// @cond - UR_STRUCTURE_TYPE_FORCE_UINT32 = 0x7fffffff - /// @endcond - -} ur_structure_type_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Base for all properties types typedef struct ur_base_properties_t { diff --git a/scripts/core/common.yml b/scripts/core/common.yml index 02bffd0751..d6959959aa 100644 --- a/scripts/core/common.yml +++ b/scripts/core/common.yml @@ -265,79 +265,6 @@ etors: value: "0x7ffffffe" desc: "Unknown or internal error" --- #-------------------------------------------------------------------------- -type: enum -desc: "Defines structure types" -name: $x_structure_type_t -etors: - - name: CONTEXT_PROPERTIES - desc: $x_context_properties_t - - name: IMAGE_DESC - desc: $x_image_desc_t - - name: BUFFER_PROPERTIES - desc: $x_buffer_properties_t - - name: BUFFER_REGION - desc: $x_buffer_region_t - - name: BUFFER_CHANNEL_PROPERTIES - desc: $x_buffer_channel_properties_t - - name: BUFFER_ALLOC_LOCATION_PROPERTIES - desc: $x_buffer_alloc_location_properties_t - - name: PROGRAM_PROPERTIES - desc: $x_program_properties_t - - name: USM_DESC - desc: $x_usm_desc_t - - name: USM_HOST_DESC - desc: $x_usm_host_desc_t - - name: USM_DEVICE_DESC - desc: $x_usm_device_desc_t - - name: USM_POOL_DESC - desc: $x_usm_pool_desc_t - - name: USM_POOL_LIMITS_DESC - desc: $x_usm_pool_limits_desc_t - - name: DEVICE_BINARY - desc: $x_device_binary_t - - name: SAMPLER_DESC - desc: $x_sampler_desc_t - - name: QUEUE_PROPERTIES - desc: $x_queue_properties_t - - name: QUEUE_INDEX_PROPERTIES - desc: $x_queue_properties_t - - name: CONTEXT_NATIVE_PROPERTIES - desc: $x_context_native_properties_t - - name: KERNEL_NATIVE_PROPERTIES - desc: $x_kernel_native_properties_t - - name: QUEUE_NATIVE_PROPERTIES - desc: $x_queue_native_properties_t - - name: MEM_NATIVE_PROPERTIES - desc: $x_mem_native_properties_t - - name: EVENT_NATIVE_PROPERTIES - desc: $x_event_native_properties_t - - name: PLATFORM_NATIVE_PROPERTIES - desc: $x_platform_native_properties_t - - name: DEVICE_NATIVE_PROPERTIES - desc: $x_device_native_properties_t - - name: PROGRAM_NATIVE_PROPERTIES - desc: $x_program_native_properties_t - - name: SAMPLER_NATIVE_PROPERTIES - desc: $x_sampler_native_properties_t - - name: QUEUE_NATIVE_DESC - desc: $x_queue_native_desc_t - - name: DEVICE_PARTITION_PROPERTIES - desc: $x_device_partition_properties_t - - name: KERNEL_ARG_MEM_OBJ_PROPERTIES - desc: $x_kernel_arg_mem_obj_properties_t - - name: PHYSICAL_MEM_PROPERTIES - desc: $x_physical_mem_properties_t - - name: KERNEL_ARG_POINTER_PROPERTIES - desc: $x_kernel_arg_pointer_properties_t - - name: KERNEL_ARG_SAMPLER_PROPERTIES - desc: $x_kernel_arg_sampler_properties_t - - name: KERNEL_EXEC_INFO_PROPERTIES - desc: $x_kernel_exec_info_properties_t - - name: KERNEL_ARG_VALUE_PROPERTIES - desc: $x_kernel_arg_value_properties_t - - name: KERNEL_ARG_LOCAL_PROPERTIES - desc: $x_kernel_arg_local_properties_t ---- #-------------------------------------------------------------------------- type: struct desc: "Base for all properties types" name: $x_base_properties_t diff --git a/scripts/core/structure.yml b/scripts/core/structure.yml new file mode 100644 index 0000000000..a4d14b8559 --- /dev/null +++ b/scripts/core/structure.yml @@ -0,0 +1,77 @@ +--- +type: header +desc: Intel $OneApi Unified Runtime structure type +ordinal: '0' +--- +type: enum +desc: Defines structure types +name: $x_structure_type_t +etors: +- name: CONTEXT_PROPERTIES + desc: $x_context_properties_t +- name: IMAGE_DESC + desc: $x_image_desc_t +- name: BUFFER_PROPERTIES + desc: $x_buffer_properties_t +- name: BUFFER_REGION + desc: $x_buffer_region_t +- name: BUFFER_CHANNEL_PROPERTIES + desc: $x_buffer_channel_properties_t +- name: BUFFER_ALLOC_LOCATION_PROPERTIES + desc: $x_buffer_alloc_location_properties_t +- name: PROGRAM_PROPERTIES + desc: $x_program_properties_t +- name: USM_DESC + desc: $x_usm_desc_t +- name: USM_HOST_DESC + desc: $x_usm_host_desc_t +- name: USM_DEVICE_DESC + desc: $x_usm_device_desc_t +- name: USM_POOL_DESC + desc: $x_usm_pool_desc_t +- name: USM_POOL_LIMITS_DESC + desc: $x_usm_pool_limits_desc_t +- name: DEVICE_BINARY + desc: $x_device_binary_t +- name: SAMPLER_DESC + desc: $x_sampler_desc_t +- name: QUEUE_PROPERTIES + desc: $x_queue_properties_t +- name: QUEUE_INDEX_PROPERTIES + desc: $x_queue_properties_t +- name: CONTEXT_NATIVE_PROPERTIES + desc: $x_context_native_properties_t +- name: KERNEL_NATIVE_PROPERTIES + desc: $x_kernel_native_properties_t +- name: QUEUE_NATIVE_PROPERTIES + desc: $x_queue_native_properties_t +- name: MEM_NATIVE_PROPERTIES + desc: $x_mem_native_properties_t +- name: EVENT_NATIVE_PROPERTIES + desc: $x_event_native_properties_t +- name: PLATFORM_NATIVE_PROPERTIES + desc: $x_platform_native_properties_t +- name: DEVICE_NATIVE_PROPERTIES + desc: $x_device_native_properties_t +- name: PROGRAM_NATIVE_PROPERTIES + desc: $x_program_native_properties_t +- name: SAMPLER_NATIVE_PROPERTIES + desc: $x_sampler_native_properties_t +- name: QUEUE_NATIVE_DESC + desc: $x_queue_native_desc_t +- name: DEVICE_PARTITION_PROPERTIES + desc: $x_device_partition_properties_t +- name: KERNEL_ARG_MEM_OBJ_PROPERTIES + desc: $x_kernel_arg_mem_obj_properties_t +- name: PHYSICAL_MEM_PROPERTIES + desc: $x_physical_mem_properties_t +- name: KERNEL_ARG_VALUE_PROPERTIES + desc: $x_kernel_arg_value_properties_t +- name: KERNEL_ARG_LOCAL_PROPERTIES + desc: $x_kernel_arg_local_properties_t +- name: KERNEL_ARG_POINTER_PROPERTIES + desc: $x_kernel_arg_pointer_properties_t +- name: KERNEL_EXEC_INFO_PROPERTIES + desc: $x_kernel_exec_info_properties_t +- name: KERNEL_ARG_SAMPLER_PROPERTIES + desc: $x_kernel_arg_sampler_properties_t diff --git a/scripts/generate_ids.py b/scripts/generate_ids.py index 26dfd89fb7..6149c29aef 100644 --- a/scripts/generate_ids.py +++ b/scripts/generate_ids.py @@ -12,12 +12,6 @@ ENUM_NAME = '$x_function_t' -class quoted(str): - pass - -def quoted_presenter(dumper, data): - return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"') - def generate_registry(path, specs): try: existing_registry = list(util.yamlRead(path))[1]['etors'] @@ -34,10 +28,8 @@ def generate_registry(path, specs): registry.append({'name': util.to_snake_case(fname).upper(), 'desc': 'Enumerator for $x'+fname, 'value': str(id)}) registry = sorted(registry, key=lambda x: int(x['value'])) wrapper = { 'name': ENUM_NAME, 'type': 'enum', 'desc': 'Defines unique stable identifiers for all functions' , 'etors': registry} - header = {'type': 'header', 'desc': quoted('Intel $OneApi Unified Runtime function registry'), 'ordinal': quoted(9)} - with open(path, 'w') as fout: - yaml.add_representer(quoted, quoted_presenter) - yaml.dump_all([header, wrapper], fout, + header = {'type': 'header', 'desc': util.quoted('Intel $OneApi Unified Runtime function registry'), 'ordinal': util.quoted(9)} + util.yamlWrite(path, [header, wrapper], default_flow_style=False, sort_keys=False, explicit_start=True) diff --git a/scripts/parse_specs.py b/scripts/parse_specs.py index 63cce5769d..ee8c5e124f 100644 --- a/scripts/parse_specs.py +++ b/scripts/parse_specs.py @@ -676,6 +676,29 @@ def _inline_base(obj, meta): obj['members'].insert(i, m) return obj +def _generate_structure_type(specs, file): + extended_structs = [obj for s in specs for obj in s['objects'] if re.match(r"struct|union", obj['type']) and 'base' in obj] + in_yml = list(util.yamlRead(file)) + structure_type = [item for item in in_yml if item.get('name') == "$x_structure_type_t"][0] + + requires_update = False + for struct in extended_structs: + stype = [mem for mem in struct['members'] if mem['name'] == 'stype'][0] + etor = stype['init'][len("$X_STRUCTURE_TYPE_"):] + if etor not in [e['name'] for e in structure_type['etors']]: + ## skip experimental features + if etor.startswith("EXP_"): + continue + requires_update = True + structure_type['etors'].append({"name": etor, "desc": struct['name']}) + + if requires_update: + util.yamlWrite(file, in_yml,default_flow_style=False, + sort_keys=False, + explicit_start=True) + + return requires_update + """ generate complete return permutations """ @@ -773,7 +796,6 @@ def _generate_extra(specs, meta): obj = _inline_base(obj, meta) obj = _generate_returns(obj, meta) s['objects'][i] = obj - """ generates reference-data on all objects """ @@ -856,9 +878,16 @@ def parse(section, version, tags, meta, ref): specs = [] files = util.findFiles(path, "*.yml") - # make sure registry is last, because it's autogenerated based on the rest of the spec - files = sorted(files, key=lambda f: 1 if f.endswith('registry.yml') else 0) - + def sort_files(file): + # make sure registry is last, because it's autogenerated based on the rest of the spec + if file.endswith("registry.yml"): + return 2 + # make sure structure is first, so that values are available to be used + if file.endswith("structure.yml"): + return 0 + return 1 + + files = sorted(files, key=sort_files) enum_extensions = [] for f in files: if f.endswith('registry.yml'): @@ -871,6 +900,7 @@ def parse(section, version, tags, meta, ref): header = None name = None objects = [] + docs = list(docs) for i, d in enumerate(docs): d = _preprocess(d) @@ -917,6 +947,10 @@ def parse(section, version, tags, meta, ref): _extend_enums(enum_extensions, specs, meta) _generate_extra(specs, meta) + structure_file = [f for f in files if f.endswith("structure.yml")][0] + if _generate_structure_type(specs, structure_file): + return parse(section, version, tags, {}, {}) + ref = _generate_ref(specs, tags, ref) print("Parsed %s files and found:"%len(specs)) diff --git a/scripts/util.py b/scripts/util.py index a9efed951d..d1a87a100a 100644 --- a/scripts/util.py +++ b/scripts/util.py @@ -144,6 +144,21 @@ def yamlRead(path): print("error: unable to read %s"%path) return None +class quoted(str): + pass + +def quoted_presenter(dumper, data): + return dumper.represent_scalar('tag:yaml.org,2002:str', data, style='"') + +def yamlWrite(path, data, **kwargs): + + try: + with open(path, 'w') as fout: + yaml.add_representer(quoted, quoted_presenter) + yaml.dump_all(data, fout, **kwargs) + except: + print(f"error: unable to write {path}") + """ generates file using template, args """ diff --git a/source/common/ur_params.hpp b/source/common/ur_params.hpp index 192bd366c2..b723649377 100644 --- a/source/common/ur_params.hpp +++ b/source/common/ur_params.hpp @@ -181,9 +181,9 @@ inline void serializeTagged(std::ostream &os, const void *ptr, } // namespace ur_params -inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value); inline std::ostream &operator<<(std::ostream &os, enum ur_structure_type_t value); +inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value); inline std::ostream &operator<<(std::ostream &os, const struct ur_base_properties_t params); inline std::ostream &operator<<(std::ostream &os, @@ -393,678 +393,678 @@ operator<<(std::ostream &os, const struct ur_exp_command_buffer_desc_t params); inline std::ostream &operator<<(std::ostream &os, enum ur_exp_peer_info_t value); -inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) { +inline std::ostream &operator<<(std::ostream &os, + enum ur_structure_type_t value) { switch (value) { - case UR_RESULT_SUCCESS: - os << "UR_RESULT_SUCCESS"; - break; - - case UR_RESULT_ERROR_INVALID_OPERATION: - os << "UR_RESULT_ERROR_INVALID_OPERATION"; + case UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES: + os << "UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES: - os << "UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES"; + case UR_STRUCTURE_TYPE_IMAGE_DESC: + os << "UR_STRUCTURE_TYPE_IMAGE_DESC"; break; - case UR_RESULT_ERROR_INVALID_QUEUE: - os << "UR_RESULT_ERROR_INVALID_QUEUE"; + case UR_STRUCTURE_TYPE_BUFFER_PROPERTIES: + os << "UR_STRUCTURE_TYPE_BUFFER_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_VALUE: - os << "UR_RESULT_ERROR_INVALID_VALUE"; + case UR_STRUCTURE_TYPE_BUFFER_REGION: + os << "UR_STRUCTURE_TYPE_BUFFER_REGION"; break; - case UR_RESULT_ERROR_INVALID_CONTEXT: - os << "UR_RESULT_ERROR_INVALID_CONTEXT"; + case UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES: + os << "UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_PLATFORM: - os << "UR_RESULT_ERROR_INVALID_PLATFORM"; + case UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES: + os << "UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_BINARY: - os << "UR_RESULT_ERROR_INVALID_BINARY"; + case UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES: + os << "UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_PROGRAM: - os << "UR_RESULT_ERROR_INVALID_PROGRAM"; + case UR_STRUCTURE_TYPE_USM_DESC: + os << "UR_STRUCTURE_TYPE_USM_DESC"; break; - case UR_RESULT_ERROR_INVALID_SAMPLER: - os << "UR_RESULT_ERROR_INVALID_SAMPLER"; + case UR_STRUCTURE_TYPE_USM_HOST_DESC: + os << "UR_STRUCTURE_TYPE_USM_HOST_DESC"; break; - case UR_RESULT_ERROR_INVALID_BUFFER_SIZE: - os << "UR_RESULT_ERROR_INVALID_BUFFER_SIZE"; + case UR_STRUCTURE_TYPE_USM_DEVICE_DESC: + os << "UR_STRUCTURE_TYPE_USM_DEVICE_DESC"; break; - case UR_RESULT_ERROR_INVALID_MEM_OBJECT: - os << "UR_RESULT_ERROR_INVALID_MEM_OBJECT"; + case UR_STRUCTURE_TYPE_USM_POOL_DESC: + os << "UR_STRUCTURE_TYPE_USM_POOL_DESC"; break; - case UR_RESULT_ERROR_INVALID_EVENT: - os << "UR_RESULT_ERROR_INVALID_EVENT"; + case UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC: + os << "UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC"; break; - case UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST: - os << "UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST"; + case UR_STRUCTURE_TYPE_DEVICE_BINARY: + os << "UR_STRUCTURE_TYPE_DEVICE_BINARY"; break; - case UR_RESULT_ERROR_MISALIGNED_SUB_BUFFER_OFFSET: - os << "UR_RESULT_ERROR_MISALIGNED_SUB_BUFFER_OFFSET"; + case UR_STRUCTURE_TYPE_SAMPLER_DESC: + os << "UR_STRUCTURE_TYPE_SAMPLER_DESC"; break; - case UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE: - os << "UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE"; + case UR_STRUCTURE_TYPE_QUEUE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_QUEUE_PROPERTIES"; break; - case UR_RESULT_ERROR_COMPILER_NOT_AVAILABLE: - os << "UR_RESULT_ERROR_COMPILER_NOT_AVAILABLE"; + case UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES: + os << "UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES"; break; - case UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE: - os << "UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE"; + case UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_DEVICE_NOT_FOUND: - os << "UR_RESULT_ERROR_DEVICE_NOT_FOUND"; + case UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_DEVICE: - os << "UR_RESULT_ERROR_INVALID_DEVICE"; + case UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_DEVICE_LOST: - os << "UR_RESULT_ERROR_DEVICE_LOST"; + case UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_DEVICE_REQUIRES_RESET: - os << "UR_RESULT_ERROR_DEVICE_REQUIRES_RESET"; + case UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE: - os << "UR_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE"; + case UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_DEVICE_PARTITION_FAILED: - os << "UR_RESULT_ERROR_DEVICE_PARTITION_FAILED"; + case UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_DEVICE_PARTITION_COUNT: - os << "UR_RESULT_ERROR_INVALID_DEVICE_PARTITION_COUNT"; + case UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_WORK_ITEM_SIZE: - os << "UR_RESULT_ERROR_INVALID_WORK_ITEM_SIZE"; + case UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_WORK_DIMENSION: - os << "UR_RESULT_ERROR_INVALID_WORK_DIMENSION"; + case UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC: + os << "UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC"; break; - case UR_RESULT_ERROR_INVALID_KERNEL_ARGS: - os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGS"; + case UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES: + os << "UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_KERNEL: - os << "UR_RESULT_ERROR_INVALID_KERNEL"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_KERNEL_NAME: - os << "UR_RESULT_ERROR_INVALID_KERNEL_NAME"; + case UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES: + os << "UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX: - os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE: - os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE: - os << "UR_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_IMAGE_SIZE: - os << "UR_RESULT_ERROR_INVALID_IMAGE_SIZE"; + case UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES"; break; - case UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR: - os << "UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR"; + case UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES: + os << "UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES"; break; - case UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED: - os << "UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED"; + case UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC: + os << "UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC"; break; - case UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE: - os << "UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE"; + case UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES: + os << "UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES"; break; - - case UR_RESULT_ERROR_INVALID_PROGRAM_EXECUTABLE: - os << "UR_RESULT_ERROR_INVALID_PROGRAM_EXECUTABLE"; + default: + os << "unknown enumerator"; break; + } + return os; +} +namespace ur_params { +inline void serializeStruct(std::ostream &os, const void *ptr) { + if (ptr == NULL) { + ur_params::serializePtr(os, ptr); + return; + } - case UR_RESULT_ERROR_UNINITIALIZED: - os << "UR_RESULT_ERROR_UNINITIALIZED"; - break; + enum ur_structure_type_t *value = (enum ur_structure_type_t *)ptr; + switch (*value) { - case UR_RESULT_ERROR_OUT_OF_HOST_MEMORY: - os << "UR_RESULT_ERROR_OUT_OF_HOST_MEMORY"; - break; + case UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES: { + const ur_context_properties_t *pstruct = + (const ur_context_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY: - os << "UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"; - break; + case UR_STRUCTURE_TYPE_IMAGE_DESC: { + const ur_image_desc_t *pstruct = (const ur_image_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_OUT_OF_RESOURCES: - os << "UR_RESULT_ERROR_OUT_OF_RESOURCES"; - break; + case UR_STRUCTURE_TYPE_BUFFER_PROPERTIES: { + const ur_buffer_properties_t *pstruct = + (const ur_buffer_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE: - os << "UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE"; - break; + case UR_STRUCTURE_TYPE_BUFFER_REGION: { + const ur_buffer_region_t *pstruct = (const ur_buffer_region_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_PROGRAM_LINK_FAILURE: - os << "UR_RESULT_ERROR_PROGRAM_LINK_FAILURE"; - break; + case UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES: { + const ur_buffer_channel_properties_t *pstruct = + (const ur_buffer_channel_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_VERSION: - os << "UR_RESULT_ERROR_UNSUPPORTED_VERSION"; - break; + case UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES: { + const ur_buffer_alloc_location_properties_t *pstruct = + (const ur_buffer_alloc_location_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_FEATURE: - os << "UR_RESULT_ERROR_UNSUPPORTED_FEATURE"; - break; + case UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES: { + const ur_program_properties_t *pstruct = + (const ur_program_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_ARGUMENT: - os << "UR_RESULT_ERROR_INVALID_ARGUMENT"; - break; + case UR_STRUCTURE_TYPE_USM_DESC: { + const ur_usm_desc_t *pstruct = (const ur_usm_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_NULL_HANDLE: - os << "UR_RESULT_ERROR_INVALID_NULL_HANDLE"; - break; + case UR_STRUCTURE_TYPE_USM_HOST_DESC: { + const ur_usm_host_desc_t *pstruct = (const ur_usm_host_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE: - os << "UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE"; - break; + case UR_STRUCTURE_TYPE_USM_DEVICE_DESC: { + const ur_usm_device_desc_t *pstruct = (const ur_usm_device_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_NULL_POINTER: - os << "UR_RESULT_ERROR_INVALID_NULL_POINTER"; - break; + case UR_STRUCTURE_TYPE_USM_POOL_DESC: { + const ur_usm_pool_desc_t *pstruct = (const ur_usm_pool_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_SIZE: - os << "UR_RESULT_ERROR_INVALID_SIZE"; - break; + case UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC: { + const ur_usm_pool_limits_desc_t *pstruct = + (const ur_usm_pool_limits_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_SIZE: - os << "UR_RESULT_ERROR_UNSUPPORTED_SIZE"; - break; + case UR_STRUCTURE_TYPE_DEVICE_BINARY: { + const ur_device_binary_t *pstruct = (const ur_device_binary_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_ALIGNMENT: - os << "UR_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"; - break; + case UR_STRUCTURE_TYPE_SAMPLER_DESC: { + const ur_sampler_desc_t *pstruct = (const ur_sampler_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT: - os << "UR_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"; - break; + case UR_STRUCTURE_TYPE_QUEUE_PROPERTIES: { + const ur_queue_properties_t *pstruct = + (const ur_queue_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_ENUMERATION: - os << "UR_RESULT_ERROR_INVALID_ENUMERATION"; - break; + case UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES: { + const ur_queue_properties_t *pstruct = + (const ur_queue_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION: - os << "UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION"; - break; + case UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES: { + const ur_context_native_properties_t *pstruct = + (const ur_context_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT: - os << "UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT"; - break; + case UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES: { + const ur_kernel_native_properties_t *pstruct = + (const ur_kernel_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_NATIVE_BINARY: - os << "UR_RESULT_ERROR_INVALID_NATIVE_BINARY"; - break; + case UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES: { + const ur_queue_native_properties_t *pstruct = + (const ur_queue_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_GLOBAL_NAME: - os << "UR_RESULT_ERROR_INVALID_GLOBAL_NAME"; - break; + case UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES: { + const ur_mem_native_properties_t *pstruct = + (const ur_mem_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_FUNCTION_NAME: - os << "UR_RESULT_ERROR_INVALID_FUNCTION_NAME"; - break; + case UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES: { + const ur_event_native_properties_t *pstruct = + (const ur_event_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION: - os << "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION"; - break; + case UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES: { + const ur_platform_native_properties_t *pstruct = + (const ur_platform_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION: - os << "UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION"; - break; + case UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES: { + const ur_device_native_properties_t *pstruct = + (const ur_device_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_PROGRAM_UNLINKED: - os << "UR_RESULT_ERROR_PROGRAM_UNLINKED"; - break; + case UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES: { + const ur_program_native_properties_t *pstruct = + (const ur_program_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_OVERLAPPING_REGIONS: - os << "UR_RESULT_ERROR_OVERLAPPING_REGIONS"; - break; + case UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES: { + const ur_sampler_native_properties_t *pstruct = + (const ur_sampler_native_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_HOST_PTR: - os << "UR_RESULT_ERROR_INVALID_HOST_PTR"; - break; + case UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC: { + const ur_queue_native_desc_t *pstruct = + (const ur_queue_native_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_USM_SIZE: - os << "UR_RESULT_ERROR_INVALID_USM_SIZE"; - break; + case UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES: { + const ur_device_partition_properties_t *pstruct = + (const ur_device_partition_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_OBJECT_ALLOCATION_FAILURE: - os << "UR_RESULT_ERROR_OBJECT_ALLOCATION_FAILURE"; - break; + case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: { + const ur_kernel_arg_mem_obj_properties_t *pstruct = + (const ur_kernel_arg_mem_obj_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_ADAPTER_SPECIFIC: - os << "UR_RESULT_ERROR_ADAPTER_SPECIFIC"; - break; + case UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES: { + const ur_physical_mem_properties_t *pstruct = + (const ur_physical_mem_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP: - os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP"; - break; + case UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES: { + const ur_kernel_arg_value_properties_t *pstruct = + (const ur_kernel_arg_value_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP: - os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP"; - break; + case UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES: { + const ur_kernel_arg_local_properties_t *pstruct = + (const ur_kernel_arg_local_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP: - os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP"; - break; + case UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES: { + const ur_kernel_arg_pointer_properties_t *pstruct = + (const ur_kernel_arg_pointer_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; - case UR_RESULT_ERROR_UNKNOWN: - os << "UR_RESULT_ERROR_UNKNOWN"; - break; + case UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES: { + const ur_kernel_exec_info_properties_t *pstruct = + (const ur_kernel_exec_info_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; + + case UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES: { + const ur_kernel_arg_sampler_properties_t *pstruct = + (const ur_kernel_arg_sampler_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; + + case UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC: { + const ur_exp_command_buffer_desc_t *pstruct = + (const ur_exp_command_buffer_desc_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; + + case UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES: { + const ur_exp_sampler_mip_properties_t *pstruct = + (const ur_exp_sampler_mip_properties_t *)ptr; + ur_params::serializePtr(os, pstruct); + } break; default: os << "unknown enumerator"; break; } - return os; } -inline std::ostream &operator<<(std::ostream &os, - enum ur_structure_type_t value) { +} // namespace ur_params +inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) { switch (value) { - case UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES: - os << "UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES"; + case UR_RESULT_SUCCESS: + os << "UR_RESULT_SUCCESS"; break; - case UR_STRUCTURE_TYPE_IMAGE_DESC: - os << "UR_STRUCTURE_TYPE_IMAGE_DESC"; + case UR_RESULT_ERROR_INVALID_OPERATION: + os << "UR_RESULT_ERROR_INVALID_OPERATION"; break; - case UR_STRUCTURE_TYPE_BUFFER_PROPERTIES: - os << "UR_STRUCTURE_TYPE_BUFFER_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES: + os << "UR_RESULT_ERROR_INVALID_QUEUE_PROPERTIES"; break; - case UR_STRUCTURE_TYPE_BUFFER_REGION: - os << "UR_STRUCTURE_TYPE_BUFFER_REGION"; + case UR_RESULT_ERROR_INVALID_QUEUE: + os << "UR_RESULT_ERROR_INVALID_QUEUE"; break; - case UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES: - os << "UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_VALUE: + os << "UR_RESULT_ERROR_INVALID_VALUE"; break; - case UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES: - os << "UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_CONTEXT: + os << "UR_RESULT_ERROR_INVALID_CONTEXT"; break; - case UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES: - os << "UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_PLATFORM: + os << "UR_RESULT_ERROR_INVALID_PLATFORM"; break; - case UR_STRUCTURE_TYPE_USM_DESC: - os << "UR_STRUCTURE_TYPE_USM_DESC"; + case UR_RESULT_ERROR_INVALID_BINARY: + os << "UR_RESULT_ERROR_INVALID_BINARY"; break; - case UR_STRUCTURE_TYPE_USM_HOST_DESC: - os << "UR_STRUCTURE_TYPE_USM_HOST_DESC"; + case UR_RESULT_ERROR_INVALID_PROGRAM: + os << "UR_RESULT_ERROR_INVALID_PROGRAM"; break; - case UR_STRUCTURE_TYPE_USM_DEVICE_DESC: - os << "UR_STRUCTURE_TYPE_USM_DEVICE_DESC"; + case UR_RESULT_ERROR_INVALID_SAMPLER: + os << "UR_RESULT_ERROR_INVALID_SAMPLER"; break; - case UR_STRUCTURE_TYPE_USM_POOL_DESC: - os << "UR_STRUCTURE_TYPE_USM_POOL_DESC"; + case UR_RESULT_ERROR_INVALID_BUFFER_SIZE: + os << "UR_RESULT_ERROR_INVALID_BUFFER_SIZE"; break; - case UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC: - os << "UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC"; + case UR_RESULT_ERROR_INVALID_MEM_OBJECT: + os << "UR_RESULT_ERROR_INVALID_MEM_OBJECT"; break; - case UR_STRUCTURE_TYPE_DEVICE_BINARY: - os << "UR_STRUCTURE_TYPE_DEVICE_BINARY"; + case UR_RESULT_ERROR_INVALID_EVENT: + os << "UR_RESULT_ERROR_INVALID_EVENT"; break; - case UR_STRUCTURE_TYPE_SAMPLER_DESC: - os << "UR_STRUCTURE_TYPE_SAMPLER_DESC"; + case UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST: + os << "UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST"; break; - case UR_STRUCTURE_TYPE_QUEUE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_QUEUE_PROPERTIES"; + case UR_RESULT_ERROR_MISALIGNED_SUB_BUFFER_OFFSET: + os << "UR_RESULT_ERROR_MISALIGNED_SUB_BUFFER_OFFSET"; break; - case UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES: - os << "UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE: + os << "UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE"; break; - case UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_COMPILER_NOT_AVAILABLE: + os << "UR_RESULT_ERROR_COMPILER_NOT_AVAILABLE"; break; - case UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE: + os << "UR_RESULT_ERROR_PROFILING_INFO_NOT_AVAILABLE"; break; - case UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_DEVICE_NOT_FOUND: + os << "UR_RESULT_ERROR_DEVICE_NOT_FOUND"; break; - case UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_DEVICE: + os << "UR_RESULT_ERROR_INVALID_DEVICE"; break; - case UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_DEVICE_LOST: + os << "UR_RESULT_ERROR_DEVICE_LOST"; break; - case UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_DEVICE_REQUIRES_RESET: + os << "UR_RESULT_ERROR_DEVICE_REQUIRES_RESET"; break; - case UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE: + os << "UR_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE"; break; - case UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_DEVICE_PARTITION_FAILED: + os << "UR_RESULT_ERROR_DEVICE_PARTITION_FAILED"; break; - case UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_DEVICE_PARTITION_COUNT: + os << "UR_RESULT_ERROR_INVALID_DEVICE_PARTITION_COUNT"; break; - case UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC: - os << "UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC"; + case UR_RESULT_ERROR_INVALID_WORK_ITEM_SIZE: + os << "UR_RESULT_ERROR_INVALID_WORK_ITEM_SIZE"; break; - case UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES: - os << "UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_WORK_DIMENSION: + os << "UR_RESULT_ERROR_INVALID_WORK_DIMENSION"; break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL_ARGS: + os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGS"; break; - case UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES: - os << "UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL: + os << "UR_RESULT_ERROR_INVALID_KERNEL"; break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL_NAME: + os << "UR_RESULT_ERROR_INVALID_KERNEL_NAME"; break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX: + os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX"; break; - case UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE: + os << "UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE"; break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE: + os << "UR_RESULT_ERROR_INVALID_KERNEL_ATTRIBUTE_VALUE"; break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES: - os << "UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES"; + case UR_RESULT_ERROR_INVALID_IMAGE_SIZE: + os << "UR_RESULT_ERROR_INVALID_IMAGE_SIZE"; break; - case UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC: - os << "UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC"; + case UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR: + os << "UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR"; break; - case UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES: - os << "UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES"; - break; - default: - os << "unknown enumerator"; + case UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED: + os << "UR_RESULT_ERROR_IMAGE_FORMAT_NOT_SUPPORTED"; break; - } - return os; -} -namespace ur_params { -inline void serializeStruct(std::ostream &os, const void *ptr) { - if (ptr == NULL) { - ur_params::serializePtr(os, ptr); - return; - } - enum ur_structure_type_t *value = (enum ur_structure_type_t *)ptr; - switch (*value) { - - case UR_STRUCTURE_TYPE_CONTEXT_PROPERTIES: { - const ur_context_properties_t *pstruct = - (const ur_context_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE: + os << "UR_RESULT_ERROR_MEM_OBJECT_ALLOCATION_FAILURE"; + break; - case UR_STRUCTURE_TYPE_IMAGE_DESC: { - const ur_image_desc_t *pstruct = (const ur_image_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_PROGRAM_EXECUTABLE: + os << "UR_RESULT_ERROR_INVALID_PROGRAM_EXECUTABLE"; + break; - case UR_STRUCTURE_TYPE_BUFFER_PROPERTIES: { - const ur_buffer_properties_t *pstruct = - (const ur_buffer_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNINITIALIZED: + os << "UR_RESULT_ERROR_UNINITIALIZED"; + break; - case UR_STRUCTURE_TYPE_BUFFER_REGION: { - const ur_buffer_region_t *pstruct = (const ur_buffer_region_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_OUT_OF_HOST_MEMORY: + os << "UR_RESULT_ERROR_OUT_OF_HOST_MEMORY"; + break; - case UR_STRUCTURE_TYPE_BUFFER_CHANNEL_PROPERTIES: { - const ur_buffer_channel_properties_t *pstruct = - (const ur_buffer_channel_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY: + os << "UR_RESULT_ERROR_OUT_OF_DEVICE_MEMORY"; + break; - case UR_STRUCTURE_TYPE_BUFFER_ALLOC_LOCATION_PROPERTIES: { - const ur_buffer_alloc_location_properties_t *pstruct = - (const ur_buffer_alloc_location_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_OUT_OF_RESOURCES: + os << "UR_RESULT_ERROR_OUT_OF_RESOURCES"; + break; - case UR_STRUCTURE_TYPE_PROGRAM_PROPERTIES: { - const ur_program_properties_t *pstruct = - (const ur_program_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE: + os << "UR_RESULT_ERROR_PROGRAM_BUILD_FAILURE"; + break; - case UR_STRUCTURE_TYPE_USM_DESC: { - const ur_usm_desc_t *pstruct = (const ur_usm_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_PROGRAM_LINK_FAILURE: + os << "UR_RESULT_ERROR_PROGRAM_LINK_FAILURE"; + break; - case UR_STRUCTURE_TYPE_USM_HOST_DESC: { - const ur_usm_host_desc_t *pstruct = (const ur_usm_host_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_VERSION: + os << "UR_RESULT_ERROR_UNSUPPORTED_VERSION"; + break; - case UR_STRUCTURE_TYPE_USM_DEVICE_DESC: { - const ur_usm_device_desc_t *pstruct = (const ur_usm_device_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_FEATURE: + os << "UR_RESULT_ERROR_UNSUPPORTED_FEATURE"; + break; - case UR_STRUCTURE_TYPE_USM_POOL_DESC: { - const ur_usm_pool_desc_t *pstruct = (const ur_usm_pool_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_ARGUMENT: + os << "UR_RESULT_ERROR_INVALID_ARGUMENT"; + break; - case UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC: { - const ur_usm_pool_limits_desc_t *pstruct = - (const ur_usm_pool_limits_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_NULL_HANDLE: + os << "UR_RESULT_ERROR_INVALID_NULL_HANDLE"; + break; - case UR_STRUCTURE_TYPE_DEVICE_BINARY: { - const ur_device_binary_t *pstruct = (const ur_device_binary_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE: + os << "UR_RESULT_ERROR_HANDLE_OBJECT_IN_USE"; + break; - case UR_STRUCTURE_TYPE_SAMPLER_DESC: { - const ur_sampler_desc_t *pstruct = (const ur_sampler_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_NULL_POINTER: + os << "UR_RESULT_ERROR_INVALID_NULL_POINTER"; + break; - case UR_STRUCTURE_TYPE_QUEUE_PROPERTIES: { - const ur_queue_properties_t *pstruct = - (const ur_queue_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_SIZE: + os << "UR_RESULT_ERROR_INVALID_SIZE"; + break; - case UR_STRUCTURE_TYPE_QUEUE_INDEX_PROPERTIES: { - const ur_queue_properties_t *pstruct = - (const ur_queue_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_SIZE: + os << "UR_RESULT_ERROR_UNSUPPORTED_SIZE"; + break; - case UR_STRUCTURE_TYPE_CONTEXT_NATIVE_PROPERTIES: { - const ur_context_native_properties_t *pstruct = - (const ur_context_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_ALIGNMENT: + os << "UR_RESULT_ERROR_UNSUPPORTED_ALIGNMENT"; + break; - case UR_STRUCTURE_TYPE_KERNEL_NATIVE_PROPERTIES: { - const ur_kernel_native_properties_t *pstruct = - (const ur_kernel_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT: + os << "UR_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT"; + break; - case UR_STRUCTURE_TYPE_QUEUE_NATIVE_PROPERTIES: { - const ur_queue_native_properties_t *pstruct = - (const ur_queue_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_ENUMERATION: + os << "UR_RESULT_ERROR_INVALID_ENUMERATION"; + break; - case UR_STRUCTURE_TYPE_MEM_NATIVE_PROPERTIES: { - const ur_mem_native_properties_t *pstruct = - (const ur_mem_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION: + os << "UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION"; + break; - case UR_STRUCTURE_TYPE_EVENT_NATIVE_PROPERTIES: { - const ur_event_native_properties_t *pstruct = - (const ur_event_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT: + os << "UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT"; + break; - case UR_STRUCTURE_TYPE_PLATFORM_NATIVE_PROPERTIES: { - const ur_platform_native_properties_t *pstruct = - (const ur_platform_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_NATIVE_BINARY: + os << "UR_RESULT_ERROR_INVALID_NATIVE_BINARY"; + break; - case UR_STRUCTURE_TYPE_DEVICE_NATIVE_PROPERTIES: { - const ur_device_native_properties_t *pstruct = - (const ur_device_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_GLOBAL_NAME: + os << "UR_RESULT_ERROR_INVALID_GLOBAL_NAME"; + break; - case UR_STRUCTURE_TYPE_PROGRAM_NATIVE_PROPERTIES: { - const ur_program_native_properties_t *pstruct = - (const ur_program_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_FUNCTION_NAME: + os << "UR_RESULT_ERROR_INVALID_FUNCTION_NAME"; + break; - case UR_STRUCTURE_TYPE_SAMPLER_NATIVE_PROPERTIES: { - const ur_sampler_native_properties_t *pstruct = - (const ur_sampler_native_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION: + os << "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION"; + break; - case UR_STRUCTURE_TYPE_QUEUE_NATIVE_DESC: { - const ur_queue_native_desc_t *pstruct = - (const ur_queue_native_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION: + os << "UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION"; + break; - case UR_STRUCTURE_TYPE_DEVICE_PARTITION_PROPERTIES: { - const ur_device_partition_properties_t *pstruct = - (const ur_device_partition_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_PROGRAM_UNLINKED: + os << "UR_RESULT_ERROR_PROGRAM_UNLINKED"; + break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_MEM_OBJ_PROPERTIES: { - const ur_kernel_arg_mem_obj_properties_t *pstruct = - (const ur_kernel_arg_mem_obj_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_OVERLAPPING_REGIONS: + os << "UR_RESULT_ERROR_OVERLAPPING_REGIONS"; + break; - case UR_STRUCTURE_TYPE_PHYSICAL_MEM_PROPERTIES: { - const ur_physical_mem_properties_t *pstruct = - (const ur_physical_mem_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_HOST_PTR: + os << "UR_RESULT_ERROR_INVALID_HOST_PTR"; + break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_POINTER_PROPERTIES: { - const ur_kernel_arg_pointer_properties_t *pstruct = - (const ur_kernel_arg_pointer_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_USM_SIZE: + os << "UR_RESULT_ERROR_INVALID_USM_SIZE"; + break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_SAMPLER_PROPERTIES: { - const ur_kernel_arg_sampler_properties_t *pstruct = - (const ur_kernel_arg_sampler_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_OBJECT_ALLOCATION_FAILURE: + os << "UR_RESULT_ERROR_OBJECT_ALLOCATION_FAILURE"; + break; - case UR_STRUCTURE_TYPE_KERNEL_EXEC_INFO_PROPERTIES: { - const ur_kernel_exec_info_properties_t *pstruct = - (const ur_kernel_exec_info_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_ADAPTER_SPECIFIC: + os << "UR_RESULT_ERROR_ADAPTER_SPECIFIC"; + break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_VALUE_PROPERTIES: { - const ur_kernel_arg_value_properties_t *pstruct = - (const ur_kernel_arg_value_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP: + os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP"; + break; - case UR_STRUCTURE_TYPE_KERNEL_ARG_LOCAL_PROPERTIES: { - const ur_kernel_arg_local_properties_t *pstruct = - (const ur_kernel_arg_local_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP: + os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP"; + break; - case UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC: { - const ur_exp_command_buffer_desc_t *pstruct = - (const ur_exp_command_buffer_desc_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP: + os << "UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP"; + break; - case UR_STRUCTURE_TYPE_EXP_SAMPLER_MIP_PROPERTIES: { - const ur_exp_sampler_mip_properties_t *pstruct = - (const ur_exp_sampler_mip_properties_t *)ptr; - ur_params::serializePtr(os, pstruct); - } break; + case UR_RESULT_ERROR_UNKNOWN: + os << "UR_RESULT_ERROR_UNKNOWN"; + break; default: os << "unknown enumerator"; break; } + return os; } -} // namespace ur_params inline std::ostream &operator<<(std::ostream &os, const struct ur_base_properties_t params) { os << "(struct ur_base_properties_t){";