From 9fed87c54fe1737a2befe18ab59af03eadf92ab0 Mon Sep 17 00:00:00 2001 From: Ewan Crawford Date: Mon, 15 Jan 2024 16:54:57 +0000 Subject: [PATCH] Use array for clUpdateMutableCommandsKHR Proposal to pass the update configs to `clUpdateMutableCommandsKHR` as an array, rather than pointer changed linked list. See https://github.com/KhronosGroup/OpenCL-Docs/issues/1041 for motivation. --- CL/cl_ext.h | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/CL/cl_ext.h b/CL/cl_ext.h index f272c04d..c8936802 100644 --- a/CL/cl_ext.h +++ b/CL/cl_ext.h @@ -605,9 +605,9 @@ clRemapCommandBufferKHR( #define CL_KHR_COMMAND_BUFFER_MUTABLE_DISPATCH_EXTENSION_VERSION \ - CL_MAKE_VERSION(0, 9, 1) + CL_MAKE_VERSION(0, 9, 2) -typedef cl_uint cl_command_buffer_structure_type_khr; +typedef cl_uint cl_command_buffer_update_type_khr; typedef cl_bitfield cl_mutable_dispatch_fields_khr; typedef cl_uint cl_mutable_command_info_khr; typedef struct _cl_mutable_dispatch_arg_khr { @@ -620,9 +620,8 @@ typedef struct _cl_mutable_dispatch_exec_info_khr { size_t param_value_size; const void* param_value; } cl_mutable_dispatch_exec_info_khr; -typedef struct _cl_mutable_dispatch_config_khr { - cl_command_buffer_structure_type_khr type; - const void* next; +typedef struct _cl_mutable_dispatch_config_khr +{ cl_mutable_command_khr command; cl_uint num_args; cl_uint num_svm_args; @@ -635,12 +634,6 @@ typedef struct _cl_mutable_dispatch_config_khr { const size_t* global_work_size; const size_t* local_work_size; } cl_mutable_dispatch_config_khr; -typedef struct _cl_mutable_base_config_khr { - cl_command_buffer_structure_type_khr type; - const void* next; - cl_uint num_mutable_dispatch; - const cl_mutable_dispatch_config_khr* mutable_dispatch_list; -} cl_mutable_base_config_khr; typedef cl_bitfield cl_mutable_dispatch_asserts_khr; /* cl_command_buffer_flags_khr - bitfield */ @@ -673,9 +666,8 @@ typedef cl_bitfield cl_mutable_dispatch_asserts_khr; #define CL_MUTABLE_DISPATCH_GLOBAL_WORK_SIZE_KHR 0x12A6 #define CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR 0x12A7 -/* cl_command_buffer_structure_type_khr */ -#define CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR 0 -#define CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR 1 +/* cl_command_buffer_update_type_khr */ +#define CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR 0 /* cl_command_buffer_properties_khr */ #define CL_COMMAND_BUFFER_MUTABLE_DISPATCH_ASSERTS_KHR 0x12B7 @@ -687,10 +679,10 @@ typedef cl_bitfield cl_mutable_dispatch_asserts_khr; #define CL_MUTABLE_DISPATCH_ASSERT_NO_ADDITIONAL_WORK_GROUPS_KHR (1 << 0) -typedef cl_int CL_API_CALL -clUpdateMutableCommandsKHR_t( - cl_command_buffer_khr command_buffer, - const cl_mutable_base_config_khr* mutable_config); +typedef cl_int CL_API_CALL clUpdateMutableCommandsKHR_t( + cl_command_buffer_khr command_buffer, cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs); typedef clUpdateMutableCommandsKHR_t * clUpdateMutableCommandsKHR_fn ; @@ -708,10 +700,10 @@ clGetMutableCommandInfoKHR_fn ; #if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) -extern CL_API_ENTRY cl_int CL_API_CALL -clUpdateMutableCommandsKHR( - cl_command_buffer_khr command_buffer, - const cl_mutable_base_config_khr* mutable_config) ; +extern CL_API_ENTRY cl_int CL_API_CALL clUpdateMutableCommandsKHR( + cl_command_buffer_khr command_buffer, cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs); extern CL_API_ENTRY cl_int CL_API_CALL clGetMutableCommandInfoKHR(