diff --git a/intercept/src/cli_ext.h b/intercept/src/cli_ext.h index 048c31b0..55685d80 100644 --- a/intercept/src/cli_ext.h +++ b/intercept/src/cli_ext.h @@ -13,7 +13,7 @@ extern "C" { /////////////////////////////////////////////////////////////////////////////// // cl_khr_command_buffer -// Note: This implements the provisional extension v0.9.2. +// Note: This implements the provisional extension v0.9.5. typedef cl_bitfield cl_device_command_buffer_capabilities_khr; typedef struct _cl_command_buffer_khr* cl_command_buffer_khr; @@ -22,7 +22,7 @@ typedef cl_uint cl_command_buffer_info_khr; typedef cl_uint cl_command_buffer_state_khr; typedef cl_properties cl_command_buffer_properties_khr; typedef cl_bitfield cl_command_buffer_flags_khr; -typedef cl_properties cl_ndrange_kernel_command_properties_khr; +typedef cl_properties cl_command_properties_khr; typedef struct _cl_mutable_command_khr* cl_mutable_command_khr; #define CL_DEVICE_COMMAND_BUFFER_CAPABILITIES_KHR 0x12A9 @@ -86,6 +86,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr* sync_point_wait_list, cl_sync_point_khr* sync_point, @@ -95,6 +96,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, @@ -109,6 +111,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, const size_t* src_origin, @@ -127,6 +130,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, @@ -141,6 +145,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_image, const size_t* src_origin, @@ -155,6 +160,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_buffer, const size_t* src_origin, @@ -169,6 +175,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem buffer, const void* pattern, size_t pattern_size, @@ -183,6 +190,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem image, const void* fill_color, const size_t* origin, @@ -196,6 +204,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemcpyKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* dst_ptr, const void* src_ptr, size_t size, @@ -208,6 +217,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemFillKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* svm_ptr, const void* pattern, size_t pattern_size, @@ -221,7 +231,7 @@ extern CL_API_ENTRY cl_int CL_API_CALL clCommandNDRangeKernelKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - const cl_ndrange_kernel_command_properties_khr* properties, + const cl_command_properties_khr* properties, cl_kernel kernel, cl_uint work_dim, const size_t* global_work_offset, @@ -273,9 +283,9 @@ clRemapCommandBufferKHR( /////////////////////////////////////////////////////////////////////////////// // cl_khr_command_buffer_mutable_dispatch -// Note: This implements the provisional extension v0.9.1. +// Note: This implements the provisional extension v0.9.3. -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 { @@ -289,8 +299,6 @@ typedef struct _cl_mutable_dispatch_exec_info_khr { 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; cl_mutable_command_khr command; cl_uint num_args; cl_uint num_svm_args; @@ -303,12 +311,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; #define CL_COMMAND_BUFFER_MUTABLE_KHR (1 << 1) @@ -327,15 +329,14 @@ typedef cl_bitfield cl_mutable_dispatch_asserts_khr; #define CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR 0x12A0 #define CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR 0x12A1 #define CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR 0x12AD -#define CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR 0x12A2 +#define CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR 0x12A2 #define CL_MUTABLE_DISPATCH_KERNEL_KHR 0x12A3 #define CL_MUTABLE_DISPATCH_DIMENSIONS_KHR 0x12A4 #define CL_MUTABLE_DISPATCH_GLOBAL_WORK_OFFSET_KHR 0x12A5 #define CL_MUTABLE_DISPATCH_GLOBAL_WORK_SIZE_KHR 0x12A6 #define CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR 0x12A7 -#define CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR 0 -#define CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR 1 +#define CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR 0 #define CL_COMMAND_BUFFER_MUTABLE_DISPATCH_ASSERTS_KHR 0x12B7 @@ -346,7 +347,9 @@ typedef cl_bitfield cl_mutable_dispatch_asserts_khr; extern CL_API_ENTRY cl_int CL_API_CALL clUpdateMutableCommandsKHR( cl_command_buffer_khr command_buffer, - const cl_mutable_base_config_khr* mutable_config) ; + 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( diff --git a/intercept/src/dispatch.cpp b/intercept/src/dispatch.cpp index f821cb7c..5aac4194 100644 --- a/intercept/src/dispatch.cpp +++ b/intercept/src/dispatch.cpp @@ -10665,6 +10665,7 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueCommandBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr* sync_point_wait_list, cl_sync_point_khr* sync_point, @@ -10694,6 +10695,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( cl_int retVal = dispatchX.clCommandBarrierWithWaitListKHR( command_buffer, command_queue, + properties, num_sync_points_in_wait_list, sync_point_wait_list, sync_point, @@ -10717,6 +10719,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandBarrierWithWaitListKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, @@ -10751,6 +10754,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( cl_int retVal = dispatchX.clCommandCopyBufferKHR( command_buffer, command_queue, + properties, src_buffer, dst_buffer, src_offset, @@ -10779,6 +10783,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, const size_t* src_origin, @@ -10817,6 +10822,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( cl_int retVal = dispatchX.clCommandCopyBufferRectKHR( command_buffer, command_queue, + properties, src_buffer, dst_buffer, src_origin, @@ -10849,6 +10855,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferRectKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, @@ -10883,6 +10890,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( cl_int retVal = dispatchX.clCommandCopyBufferToImageKHR( command_buffer, command_queue, + properties, src_buffer, dst_image, src_offset, @@ -10911,6 +10919,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyBufferToImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_image, const size_t* src_origin, @@ -10945,6 +10954,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( cl_int retVal = dispatchX.clCommandCopyImageKHR( command_buffer, command_queue, + properties, src_image, dst_image, src_origin, @@ -10973,6 +10983,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_buffer, const size_t* src_origin, @@ -11009,6 +11020,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( cl_int retVal = dispatchX.clCommandCopyImageToBufferKHR( command_buffer, command_queue, + properties, src_image, dst_buffer, src_origin, @@ -11037,6 +11049,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandCopyImageToBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem buffer, const void* pattern, size_t pattern_size, @@ -11071,6 +11084,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( cl_int retVal = dispatchX.clCommandFillBufferKHR( command_buffer, command_queue, + properties, buffer, pattern, pattern_size, @@ -11099,6 +11113,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillBufferKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem image, const void* fill_color, const size_t* origin, @@ -11132,6 +11147,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( cl_int retVal = dispatchX.clCommandFillImageKHR( command_buffer, command_queue, + properties, image, fill_color, origin, @@ -11159,6 +11175,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandFillImageKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemcpyKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* dst_ptr, const void* src_ptr, size_t size, @@ -11194,6 +11211,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemcpyKHR( cl_int retVal = dispatchX.clCommandSVMMemcpyKHR( command_buffer, command_queue, + properties, dst_ptr, src_ptr, size, @@ -11220,6 +11238,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemcpyKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemFillKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* svm_ptr, const void* pattern, size_t pattern_size, @@ -11256,6 +11275,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemFillKHR( cl_int retVal = dispatchX.clCommandSVMMemFillKHR( command_buffer, command_queue, + properties, svm_ptr, pattern, pattern_size, @@ -11283,7 +11303,7 @@ CL_API_ENTRY cl_int CL_API_CALL clCommandSVMMemFillKHR( CL_API_ENTRY cl_int CL_API_CALL clCommandNDRangeKernelKHR( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - const cl_ndrange_kernel_command_properties_khr* properties, + const cl_command_properties_khr* properties, cl_kernel kernel, cl_uint work_dim, const size_t* global_work_offset, @@ -11476,7 +11496,9 @@ CL_API_ENTRY cl_command_buffer_khr CL_API_CALL clRemapCommandBufferKHR( // cl_khr_command_buffer_mutable_dispatch CL_API_ENTRY cl_int CL_API_CALL clUpdateMutableCommandsKHR( cl_command_buffer_khr command_buffer, - const cl_mutable_base_config_khr* mutable_config) + cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs) { CLIntercept* pIntercept = GetIntercept(); @@ -11486,24 +11508,27 @@ CL_API_ENTRY cl_int CL_API_CALL clUpdateMutableCommandsKHR( if( dispatchX.clUpdateMutableCommandsKHR ) { GET_ENQUEUE_COUNTER(); - CALL_LOGGING_ENTER( "command_buffer = %p, mutable_config = %p", + CALL_LOGGING_ENTER( "command_buffer = %p, num_configs = %u", command_buffer, - mutable_config ); + num_configs ); if( pIntercept->config().CallLogging ) { std::string configStr; pIntercept->getCommandBufferMutableConfigString( - mutable_config, + num_configs, + config_types, + configs, configStr ); - CALL_LOGGING_INFO("mutable_config %p: %s", - mutable_config, + CALL_LOGGING_INFO(" configs = %s", configStr.c_str() ); } HOST_PERFORMANCE_TIMING_START(); cl_int retVal = dispatchX.clUpdateMutableCommandsKHR( command_buffer, - mutable_config ); + num_configs, + config_types, + configs ); HOST_PERFORMANCE_TIMING_END(); CHECK_ERROR( retVal ); diff --git a/intercept/src/dispatch.h b/intercept/src/dispatch.h index 70f71b75..84c30fe6 100644 --- a/intercept/src/dispatch.h +++ b/intercept/src/dispatch.h @@ -188,6 +188,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandBarrierWithWaitListKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_uint num_sync_points_in_wait_list, const cl_sync_point_khr* sync_point_wait_list, cl_sync_point_khr* sync_point, @@ -197,6 +198,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandCopyBufferKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, size_t src_offset, @@ -211,6 +213,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandCopyBufferRectKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_buffer, const size_t* src_origin, @@ -229,6 +232,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandCopyBufferToImageKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_buffer, cl_mem dst_image, size_t src_offset, @@ -243,6 +247,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandCopyImageKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_image, const size_t* src_origin, @@ -257,6 +262,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandCopyImageToBufferKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem src_image, cl_mem dst_buffer, const size_t* src_origin, @@ -271,6 +277,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandFillBufferKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem buffer, const void* pattern, size_t pattern_size, @@ -285,6 +292,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandFillImageKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, cl_mem image, const void* fill_color, const size_t* origin, @@ -298,6 +306,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandSVMMemcpyKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* dst_ptr, const void* src_ptr, size_t size, @@ -310,6 +319,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandSVMMemFillKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, + const cl_command_properties_khr* properties, void* svm_ptr, const void* pattern, size_t pattern_size, @@ -323,7 +333,7 @@ struct CLdispatchX cl_int (CL_API_CALL *clCommandNDRangeKernelKHR) ( cl_command_buffer_khr command_buffer, cl_command_queue command_queue, - const cl_ndrange_kernel_command_properties_khr* properties, + const cl_command_properties_khr* properties, cl_kernel kernel, cl_uint work_dim, const size_t* global_work_offset, @@ -356,7 +366,9 @@ struct CLdispatchX // cl_khr_command_buffer_mutable_dispatch cl_int (CL_API_CALL *clUpdateMutableCommandsKHR) ( cl_command_buffer_khr command_buffer, - const cl_mutable_base_config_khr* mutable_config) ; + cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs); // cl_khr_command_buffer_mutable_dispatch cl_int (CL_API_CALL *clGetMutableCommandInfoKHR) ( diff --git a/intercept/src/enummap.cpp b/intercept/src/enummap.cpp index 1989c149..7a75fc54 100644 --- a/intercept/src/enummap.cpp +++ b/intercept/src/enummap.cpp @@ -748,15 +748,14 @@ CEnumNameMap::CEnumNameMap() ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_COMMAND_COMMAND_QUEUE_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_COMMAND_COMMAND_BUFFER_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_COMMAND_COMMAND_TYPE_KHR ); - ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_PROPERTIES_ARRAY_KHR ); + ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_COMMAND_PROPERTIES_ARRAY_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_KERNEL_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_DIMENSIONS_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_GLOBAL_WORK_OFFSET_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_GLOBAL_WORK_SIZE_KHR ); ADD_ENUM_NAME( m_cl_int, CL_MUTABLE_DISPATCH_LOCAL_WORK_SIZE_KHR ); - ADD_ENUM_NAME( m_cl_command_buffer_structure_type_khr, CL_STRUCTURE_TYPE_MUTABLE_BASE_CONFIG_KHR ); - ADD_ENUM_NAME( m_cl_command_buffer_structure_type_khr, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR ); + ADD_ENUM_NAME( m_cl_command_buffer_update_type_khr, CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR ); ADD_ENUM_NAME( m_cl_int, CL_COMMAND_BUFFER_MUTABLE_DISPATCH_ASSERTS_KHR ); diff --git a/intercept/src/enummap.h b/intercept/src/enummap.h index 0bb81a3f..9c03bb16 100644 --- a/intercept/src/enummap.h +++ b/intercept/src/enummap.h @@ -113,7 +113,7 @@ class CEnumNameMap GENERATE_MAP_AND_BITFIELD_FUNC( name_platform_command_buffer_capabilities, cl_platform_command_buffer_capabilities_khr ); GENERATE_MAP_AND_BITFIELD_FUNC( name_device_command_buffer_capabilities, cl_device_command_buffer_capabilities_khr ); GENERATE_MAP_AND_BITFIELD_FUNC( name_command_buffer_flags, cl_command_buffer_flags_khr ); - GENERATE_MAP_AND_FUNC( name_command_buffer_structure_type, cl_command_buffer_structure_type_khr ); + GENERATE_MAP_AND_FUNC( name_command_buffer_update_type, cl_command_buffer_update_type_khr ); GENERATE_MAP_AND_BITFIELD_FUNC( name_mutable_dispatch_fields, cl_mutable_dispatch_fields_khr ); GENERATE_MAP_AND_BITFIELD_FUNC( name_mutable_dispatch_asserts, cl_mutable_dispatch_asserts_khr ); diff --git a/intercept/src/intercept.cpp b/intercept/src/intercept.cpp index 05854899..a05489f2 100644 --- a/intercept/src/intercept.cpp +++ b/intercept/src/intercept.cpp @@ -2639,34 +2639,34 @@ void CLIntercept::getCommandBufferPropertiesString( /////////////////////////////////////////////////////////////////////////////// // void CLIntercept::getCommandBufferMutableConfigString( - const cl_mutable_base_config_khr* mutable_config, + cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs, std::string& str ) const { str = ""; - if( mutable_config ) + if( num_configs > 0 && config_types != nullptr && configs != nullptr ) { char s[256]; - CLI_SPRINTF(s, 256, "type = %s (%u), next = %p, num_mutable_dispatch = %u", - enumName().name_command_buffer_structure_type(mutable_config->type).c_str(), - mutable_config->type, - mutable_config->next, - mutable_config->num_mutable_dispatch); - str += s; - - for( cl_uint i = 0; i < mutable_config->num_mutable_dispatch; i++ ) - { - const cl_mutable_dispatch_config_khr* dispatchConfig = - &mutable_config->mutable_dispatch_list[i]; - CLI_SPRINTF(s, 256, "\n dispatch config %u: type = %s (%u), next = %p, command = %p:", - i, - enumName().name_command_buffer_structure_type(dispatchConfig->type).c_str(), - dispatchConfig->type, - dispatchConfig->next, - dispatchConfig->command); - str += s; - if( dispatchConfig->type == CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR ) + + for( cl_uint i = 0; i < num_configs; i++ ) + { + if( configs[i] == nullptr ) + { + CLI_SPRINTF(s, 256, "\n config %u: NULL!", i ); + str += s; + } + else if( config_types[i] == CL_STRUCTURE_TYPE_MUTABLE_DISPATCH_CONFIG_KHR ) { + auto dispatchConfig = (const cl_mutable_dispatch_config_khr*)configs[i]; + CLI_SPRINTF(s, 256, "\n config %u: type = %s (%u), command = %p:", + i, + enumName().name_command_buffer_update_type(config_types[i]).c_str(), + config_types[i], + dispatchConfig->command); + str += s; + CLI_SPRINTF(s, 256, "\n num_args = %u, num_svm_args = %u, num_exec_infos = %u, work_dim = %u", dispatchConfig->num_args, dispatchConfig->num_svm_args, @@ -2802,12 +2802,15 @@ void CLIntercept::getCommandBufferMutableConfigString( } } } + else + { + CLI_SPRINTF(s, 256, "\n config %u: unknown type %u!", + i, + config_types[i] ); + str += s; + } } } - else - { - str = "NULL"; - } } /////////////////////////////////////////////////////////////////////////////// diff --git a/intercept/src/intercept.h b/intercept/src/intercept.h index a65ce83a..81351e79 100644 --- a/intercept/src/intercept.h +++ b/intercept/src/intercept.h @@ -174,7 +174,9 @@ class CLIntercept const cl_command_buffer_properties_khr* properties, std::string& str ) const; void getCommandBufferMutableConfigString( - const cl_mutable_base_config_khr* mutable_config, + cl_uint num_configs, + const cl_command_buffer_update_type_khr* config_types, + const void** configs, std::string& str ) const; void getCreateKernelsInProgramRetString( cl_int retVal, @@ -3299,6 +3301,7 @@ inline bool CLIntercept::checkDevicePerformanceTimingEnqueueLimits( pIntercept->config().ITTPerformanceTiming || \ pIntercept->config().ChromePerformanceTiming || \ pIntercept->config().DevicePerfCounterEventBasedSampling ) \ + /* TODO: checkDevicePerformanceTimingEnqueueLimits? */ \ { \ queuedTime = CLIntercept::clock::now(); \ if( pEvent == NULL ) \