Skip to content

Commit

Permalink
Fix Backwards compatibility in ddi structs for EXP features
Browse files Browse the repository at this point in the history
- Fix incorrect reordering from 1.9.x of the EXP function pointers in
  ddi tables.

Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
  • Loading branch information
nrspruit authored and lisanna-dettwyler committed Oct 24, 2024
1 parent 6fa9416 commit a95298b
Show file tree
Hide file tree
Showing 9 changed files with 2,561 additions and 2,561 deletions.
350 changes: 175 additions & 175 deletions include/ze.py

Large diffs are not rendered by default.

4,622 changes: 2,311 additions & 2,311 deletions include/ze_api.h

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions include/ze_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-License-Identifier: MIT
*
* @file ze_ddi.h
* @version v1.11-r1.11.3
* @version v1.11-r1.11.4
*
*/
#ifndef _ZE_DDI_H
Expand Down Expand Up @@ -1134,23 +1134,6 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListCreateCloneExp_t)(
ze_command_list_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListGetNextCommandIdExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetNextCommandIdExp_t)(
ze_command_list_handle_t,
const ze_mutable_command_id_exp_desc_t*,
uint64_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListUpdateMutableCommandWaitEventsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t)(
ze_command_list_handle_t,
uint64_t,
uint32_t,
ze_event_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListImmediateAppendCommandListsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateAppendCommandListsExp_t)(
Expand All @@ -1163,12 +1146,10 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListImmediateAppendCommandListsExp
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListGetNextCommandIdWithKernelsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetNextCommandIdWithKernelsExp_t)(
/// @brief Function-pointer for zeCommandListGetNextCommandIdExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetNextCommandIdExp_t)(
ze_command_list_handle_t,
const ze_mutable_command_id_exp_desc_t*,
uint32_t,
ze_kernel_handle_t*,
uint64_t*
);

Expand All @@ -1187,6 +1168,25 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandSignalEven
ze_event_handle_t
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListUpdateMutableCommandWaitEventsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t)(
ze_command_list_handle_t,
uint64_t,
uint32_t,
ze_event_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListGetNextCommandIdWithKernelsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListGetNextCommandIdWithKernelsExp_t)(
ze_command_list_handle_t,
const ze_mutable_command_id_exp_desc_t*,
uint32_t,
ze_kernel_handle_t*,
uint64_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zeCommandListUpdateMutableCommandKernelsExp
typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandKernelsExp_t)(
Expand All @@ -1201,12 +1201,12 @@ typedef ze_result_t (ZE_APICALL *ze_pfnCommandListUpdateMutableCommandKernelsExp
typedef struct _ze_command_list_exp_dditable_t
{
ze_pfnCommandListCreateCloneExp_t pfnCreateCloneExp;
ze_pfnCommandListGetNextCommandIdExp_t pfnGetNextCommandIdExp;
ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp;
ze_pfnCommandListImmediateAppendCommandListsExp_t pfnImmediateAppendCommandListsExp;
ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp;
ze_pfnCommandListGetNextCommandIdExp_t pfnGetNextCommandIdExp;
ze_pfnCommandListUpdateMutableCommandsExp_t pfnUpdateMutableCommandsExp;
ze_pfnCommandListUpdateMutableCommandSignalEventExp_t pfnUpdateMutableCommandSignalEventExp;
ze_pfnCommandListUpdateMutableCommandWaitEventsExp_t pfnUpdateMutableCommandWaitEventsExp;
ze_pfnCommandListGetNextCommandIdWithKernelsExp_t pfnGetNextCommandIdWithKernelsExp;
ze_pfnCommandListUpdateMutableCommandKernelsExp_t pfnUpdateMutableCommandKernelsExp;
} ze_command_list_exp_dditable_t;

Expand Down
2 changes: 1 addition & 1 deletion include/zes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SPDX-License-Identifier: MIT
@file zes.py
@version v1.11-r1.11.3
@version v1.11-r1.11.4
"""
import platform
Expand Down
2 changes: 1 addition & 1 deletion include/zes_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-License-Identifier: MIT
*
* @file zes_api.h
* @version v1.11-r1.11.3
* @version v1.11-r1.11.4
*
*/
#ifndef _ZES_API_H
Expand Down
2 changes: 1 addition & 1 deletion include/zes_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-License-Identifier: MIT
*
* @file zes_ddi.h
* @version v1.11-r1.11.3
* @version v1.11-r1.11.4
*
*/
#ifndef _ZES_DDI_H
Expand Down
42 changes: 21 additions & 21 deletions include/zet.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
SPDX-License-Identifier: MIT
@file zet.py
@version v1.11-r1.11.3
@version v1.11-r1.11.4
"""
import platform
Expand Down Expand Up @@ -1229,6 +1229,13 @@ class _zet_metric_dditable_t(Structure):
("pfnGetProperties", c_void_p) ## _zetMetricGetProperties_t
]

###############################################################################
## @brief Function-pointer for zetMetricCreateFromProgrammableExp
if __use_win_types:
_zetMetricCreateFromProgrammableExp_t = WINFUNCTYPE( ze_result_t, zet_metric_programmable_exp_handle_t, POINTER(zet_metric_programmable_param_value_exp_t), c_ulong, c_char_p, c_char_p, POINTER(c_ulong), POINTER(zet_metric_handle_t) )
else:
_zetMetricCreateFromProgrammableExp_t = CFUNCTYPE( ze_result_t, zet_metric_programmable_exp_handle_t, POINTER(zet_metric_programmable_param_value_exp_t), c_ulong, c_char_p, c_char_p, POINTER(c_ulong), POINTER(zet_metric_handle_t) )

###############################################################################
## @brief Function-pointer for zetMetricDestroyExp
if __use_win_types:
Expand All @@ -1243,21 +1250,14 @@ class _zet_metric_dditable_t(Structure):
else:
_zetMetricCreateFromProgrammableExp2_t = CFUNCTYPE( ze_result_t, zet_metric_programmable_exp_handle_t, c_ulong, POINTER(zet_metric_programmable_param_value_exp_t), c_char_p, c_char_p, POINTER(c_ulong), POINTER(zet_metric_handle_t) )

###############################################################################
## @brief Function-pointer for zetMetricCreateFromProgrammableExp
if __use_win_types:
_zetMetricCreateFromProgrammableExp_t = WINFUNCTYPE( ze_result_t, zet_metric_programmable_exp_handle_t, POINTER(zet_metric_programmable_param_value_exp_t), c_ulong, c_char_p, c_char_p, POINTER(c_ulong), POINTER(zet_metric_handle_t) )
else:
_zetMetricCreateFromProgrammableExp_t = CFUNCTYPE( ze_result_t, zet_metric_programmable_exp_handle_t, POINTER(zet_metric_programmable_param_value_exp_t), c_ulong, c_char_p, c_char_p, POINTER(c_ulong), POINTER(zet_metric_handle_t) )


###############################################################################
## @brief Table of MetricExp functions pointers
class _zet_metric_exp_dditable_t(Structure):
_fields_ = [
("pfnCreateFromProgrammableExp", c_void_p), ## _zetMetricCreateFromProgrammableExp_t
("pfnDestroyExp", c_void_p), ## _zetMetricDestroyExp_t
("pfnCreateFromProgrammableExp2", c_void_p), ## _zetMetricCreateFromProgrammableExp2_t
("pfnCreateFromProgrammableExp", c_void_p) ## _zetMetricCreateFromProgrammableExp_t
("pfnCreateFromProgrammableExp2", c_void_p) ## _zetMetricCreateFromProgrammableExp2_t
]

###############################################################################
Expand Down Expand Up @@ -1319,6 +1319,13 @@ class _zet_metric_group_dditable_t(Structure):
else:
_zetMetricGroupCalculateMetricExportDataExp_t = CFUNCTYPE( ze_result_t, ze_driver_handle_t, zet_metric_group_calculation_type_t, c_size_t, POINTER(c_ubyte), POINTER(zet_metric_calculate_exp_desc_t), POINTER(c_ulong), POINTER(c_ulong), POINTER(c_ulong), POINTER(zet_typed_value_t) )

###############################################################################
## @brief Function-pointer for zetMetricGroupCreateExp
if __use_win_types:
_zetMetricGroupCreateExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t, c_char_p, c_char_p, zet_metric_group_sampling_type_flags_t, POINTER(zet_metric_group_handle_t) )
else:
_zetMetricGroupCreateExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t, c_char_p, c_char_p, zet_metric_group_sampling_type_flags_t, POINTER(zet_metric_group_handle_t) )

###############################################################################
## @brief Function-pointer for zetMetricGroupAddMetricExp
if __use_win_types:
Expand Down Expand Up @@ -1347,13 +1354,6 @@ class _zet_metric_group_dditable_t(Structure):
else:
_zetMetricGroupDestroyExp_t = CFUNCTYPE( ze_result_t, zet_metric_group_handle_t )

###############################################################################
## @brief Function-pointer for zetMetricGroupCreateExp
if __use_win_types:
_zetMetricGroupCreateExp_t = WINFUNCTYPE( ze_result_t, zet_device_handle_t, c_char_p, c_char_p, zet_metric_group_sampling_type_flags_t, POINTER(zet_metric_group_handle_t) )
else:
_zetMetricGroupCreateExp_t = CFUNCTYPE( ze_result_t, zet_device_handle_t, c_char_p, c_char_p, zet_metric_group_sampling_type_flags_t, POINTER(zet_metric_group_handle_t) )


###############################################################################
## @brief Table of MetricGroupExp functions pointers
Expand All @@ -1363,11 +1363,11 @@ class _zet_metric_group_exp_dditable_t(Structure):
("pfnGetGlobalTimestampsExp", c_void_p), ## _zetMetricGroupGetGlobalTimestampsExp_t
("pfnGetExportDataExp", c_void_p), ## _zetMetricGroupGetExportDataExp_t
("pfnCalculateMetricExportDataExp", c_void_p), ## _zetMetricGroupCalculateMetricExportDataExp_t
("pfnCreateExp", c_void_p), ## _zetMetricGroupCreateExp_t
("pfnAddMetricExp", c_void_p), ## _zetMetricGroupAddMetricExp_t
("pfnRemoveMetricExp", c_void_p), ## _zetMetricGroupRemoveMetricExp_t
("pfnCloseExp", c_void_p), ## _zetMetricGroupCloseExp_t
("pfnDestroyExp", c_void_p), ## _zetMetricGroupDestroyExp_t
("pfnCreateExp", c_void_p) ## _zetMetricGroupCreateExp_t
("pfnDestroyExp", c_void_p) ## _zetMetricGroupDestroyExp_t
]

###############################################################################
Expand Down Expand Up @@ -1772,9 +1772,9 @@ def __init__(self, version : ze_api_version_t):
self.__dditable.MetricExp = _MetricExp

# attach function interface to function address
self.zetMetricCreateFromProgrammableExp = _zetMetricCreateFromProgrammableExp_t(self.__dditable.MetricExp.pfnCreateFromProgrammableExp)
self.zetMetricDestroyExp = _zetMetricDestroyExp_t(self.__dditable.MetricExp.pfnDestroyExp)
self.zetMetricCreateFromProgrammableExp2 = _zetMetricCreateFromProgrammableExp2_t(self.__dditable.MetricExp.pfnCreateFromProgrammableExp2)
self.zetMetricCreateFromProgrammableExp = _zetMetricCreateFromProgrammableExp_t(self.__dditable.MetricExp.pfnCreateFromProgrammableExp)

# call driver to get function pointers
_MetricGroup = _zet_metric_group_dditable_t()
Expand All @@ -1800,11 +1800,11 @@ def __init__(self, version : ze_api_version_t):
self.zetMetricGroupGetGlobalTimestampsExp = _zetMetricGroupGetGlobalTimestampsExp_t(self.__dditable.MetricGroupExp.pfnGetGlobalTimestampsExp)
self.zetMetricGroupGetExportDataExp = _zetMetricGroupGetExportDataExp_t(self.__dditable.MetricGroupExp.pfnGetExportDataExp)
self.zetMetricGroupCalculateMetricExportDataExp = _zetMetricGroupCalculateMetricExportDataExp_t(self.__dditable.MetricGroupExp.pfnCalculateMetricExportDataExp)
self.zetMetricGroupCreateExp = _zetMetricGroupCreateExp_t(self.__dditable.MetricGroupExp.pfnCreateExp)
self.zetMetricGroupAddMetricExp = _zetMetricGroupAddMetricExp_t(self.__dditable.MetricGroupExp.pfnAddMetricExp)
self.zetMetricGroupRemoveMetricExp = _zetMetricGroupRemoveMetricExp_t(self.__dditable.MetricGroupExp.pfnRemoveMetricExp)
self.zetMetricGroupCloseExp = _zetMetricGroupCloseExp_t(self.__dditable.MetricGroupExp.pfnCloseExp)
self.zetMetricGroupDestroyExp = _zetMetricGroupDestroyExp_t(self.__dditable.MetricGroupExp.pfnDestroyExp)
self.zetMetricGroupCreateExp = _zetMetricGroupCreateExp_t(self.__dditable.MetricGroupExp.pfnCreateExp)

# call driver to get function pointers
_MetricStreamer = _zet_metric_streamer_dditable_t()
Expand Down
2 changes: 1 addition & 1 deletion include/zet_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-License-Identifier: MIT
*
* @file zet_api.h
* @version v1.11-r1.11.3
* @version v1.11-r1.11.4
*
*/
#ifndef _ZET_API_H
Expand Down
50 changes: 25 additions & 25 deletions include/zet_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* SPDX-License-Identifier: MIT
*
* @file zet_ddi.h
* @version v1.11-r1.11.3
* @version v1.11-r1.11.4
*
*/
#ifndef _ZET_DDI_H
Expand Down Expand Up @@ -532,29 +532,29 @@ typedef ze_result_t (ZE_APICALL *zet_pfnGetMetricProcAddrTable_t)(
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricDestroyExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricDestroyExp_t)(
zet_metric_handle_t
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricCreateFromProgrammableExp2
typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp2_t)(
/// @brief Function-pointer for zetMetricCreateFromProgrammableExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp_t)(
zet_metric_programmable_exp_handle_t,
uint32_t,
zet_metric_programmable_param_value_exp_t*,
uint32_t,
const char*,
const char*,
uint32_t*,
zet_metric_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricCreateFromProgrammableExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp_t)(
/// @brief Function-pointer for zetMetricDestroyExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricDestroyExp_t)(
zet_metric_handle_t
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricCreateFromProgrammableExp2
typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp2_t)(
zet_metric_programmable_exp_handle_t,
zet_metric_programmable_param_value_exp_t*,
uint32_t,
zet_metric_programmable_param_value_exp_t*,
const char*,
const char*,
uint32_t*,
Expand All @@ -565,9 +565,9 @@ typedef ze_result_t (ZE_APICALL *zet_pfnMetricCreateFromProgrammableExp_t)(
/// @brief Table of MetricExp functions pointers
typedef struct _zet_metric_exp_dditable_t
{
zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp;
zet_pfnMetricDestroyExp_t pfnDestroyExp;
zet_pfnMetricCreateFromProgrammableExp2_t pfnCreateFromProgrammableExp2;
zet_pfnMetricCreateFromProgrammableExp_t pfnCreateFromProgrammableExp;
} zet_metric_exp_dditable_t;

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -695,6 +695,16 @@ typedef ze_result_t (ZE_APICALL *zet_pfnMetricGroupCalculateMetricExportDataExp_
zet_typed_value_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricGroupCreateExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricGroupCreateExp_t)(
zet_device_handle_t,
const char*,
const char*,
zet_metric_group_sampling_type_flags_t,
zet_metric_group_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricGroupAddMetricExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricGroupAddMetricExp_t)(
Expand Down Expand Up @@ -723,16 +733,6 @@ typedef ze_result_t (ZE_APICALL *zet_pfnMetricGroupDestroyExp_t)(
zet_metric_group_handle_t
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for zetMetricGroupCreateExp
typedef ze_result_t (ZE_APICALL *zet_pfnMetricGroupCreateExp_t)(
zet_device_handle_t,
const char*,
const char*,
zet_metric_group_sampling_type_flags_t,
zet_metric_group_handle_t*
);

///////////////////////////////////////////////////////////////////////////////
/// @brief Table of MetricGroupExp functions pointers
typedef struct _zet_metric_group_exp_dditable_t
Expand All @@ -741,11 +741,11 @@ typedef struct _zet_metric_group_exp_dditable_t
zet_pfnMetricGroupGetGlobalTimestampsExp_t pfnGetGlobalTimestampsExp;
zet_pfnMetricGroupGetExportDataExp_t pfnGetExportDataExp;
zet_pfnMetricGroupCalculateMetricExportDataExp_t pfnCalculateMetricExportDataExp;
zet_pfnMetricGroupCreateExp_t pfnCreateExp;
zet_pfnMetricGroupAddMetricExp_t pfnAddMetricExp;
zet_pfnMetricGroupRemoveMetricExp_t pfnRemoveMetricExp;
zet_pfnMetricGroupCloseExp_t pfnCloseExp;
zet_pfnMetricGroupDestroyExp_t pfnDestroyExp;
zet_pfnMetricGroupCreateExp_t pfnCreateExp;
} zet_metric_group_exp_dditable_t;

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit a95298b

Please sign in to comment.