Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UR] Automatically update ur_structure_type_t #648

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 45 additions & 45 deletions include/ur.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ):
Expand Down Expand Up @@ -207,51 +252,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):
Expand Down
97 changes: 52 additions & 45 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -230,51 +282,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 {
Expand Down
73 changes: 0 additions & 73 deletions scripts/core/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading