Skip to content

Commit 78941ef

Browse files
authored
Fix check for new ddi table in 1.11 and fix space in driver count check. (#210)
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 5b4317c commit 78941ef

File tree

5 files changed

+150
-146
lines changed

5 files changed

+150
-146
lines changed

scripts/templates/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,4 +1937,4 @@ def get_loader_epilogue(namespace, tags, obj, meta):
19371937
"""
19381938
def isNewProcTable(tableName):
19391939

1940-
return tableName in ["zesGetGlobalProcAddrTable","zesGetOverclockProcAddrTable"]
1940+
return tableName in ["zesGetGlobalProcAddrTable","zesGetOverclockProcAddrTable","zesGetVFManagementProcAddrTable"]

scripts/templates/ldrddi.cpp.mako

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ ${tbl['export']['name']}(
319319
)
320320
{
321321
%if namespace != "zes":
322-
if( loader::context->zeDrivers.size() < 1 )
322+
if( loader::context->zeDrivers.size() < 1 ) {
323323
%else:
324-
if( loader::context->sysmanInstanceDrivers->size() < 1 )
324+
if( loader::context->sysmanInstanceDrivers->size() < 1 ) {
325325
%endif
326-
327326
return ${X}_RESULT_ERROR_UNINITIALIZED;
327+
}
328328

329329
if( nullptr == pDdiTable )
330330
return ${X}_RESULT_ERROR_INVALID_NULL_POINTER;

source/loader/ze_ldrddi.cpp

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6326,9 +6326,9 @@ zeGetGlobalProcAddrTable(
63266326
ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
63276327
)
63286328
{
6329-
if( loader::context->zeDrivers.size() < 1 )
6330-
6329+
if( loader::context->zeDrivers.size() < 1 ) {
63316330
return ZE_RESULT_ERROR_UNINITIALIZED;
6331+
}
63326332

63336333
if( nullptr == pDdiTable )
63346334
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6422,9 +6422,9 @@ zeGetRTASBuilderExpProcAddrTable(
64226422
ze_rtas_builder_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
64236423
)
64246424
{
6425-
if( loader::context->zeDrivers.size() < 1 )
6426-
6425+
if( loader::context->zeDrivers.size() < 1 ) {
64276426
return ZE_RESULT_ERROR_UNINITIALIZED;
6427+
}
64286428

64296429
if( nullptr == pDdiTable )
64306430
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6508,9 +6508,9 @@ zeGetRTASParallelOperationExpProcAddrTable(
65086508
ze_rtas_parallel_operation_exp_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers
65096509
)
65106510
{
6511-
if( loader::context->zeDrivers.size() < 1 )
6512-
6511+
if( loader::context->zeDrivers.size() < 1 ) {
65136512
return ZE_RESULT_ERROR_UNINITIALIZED;
6513+
}
65146514

65156515
if( nullptr == pDdiTable )
65166516
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6594,9 +6594,9 @@ zeGetDriverProcAddrTable(
65946594
ze_driver_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
65956595
)
65966596
{
6597-
if( loader::context->zeDrivers.size() < 1 )
6598-
6597+
if( loader::context->zeDrivers.size() < 1 ) {
65996598
return ZE_RESULT_ERROR_UNINITIALIZED;
6599+
}
66006600

66016601
if( nullptr == pDdiTable )
66026602
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6692,9 +6692,9 @@ zeGetDriverExpProcAddrTable(
66926692
ze_driver_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
66936693
)
66946694
{
6695-
if( loader::context->zeDrivers.size() < 1 )
6696-
6695+
if( loader::context->zeDrivers.size() < 1 ) {
66976696
return ZE_RESULT_ERROR_UNINITIALIZED;
6697+
}
66986698

66996699
if( nullptr == pDdiTable )
67006700
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6775,9 +6775,9 @@ zeGetDeviceProcAddrTable(
67756775
ze_device_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
67766776
)
67776777
{
6778-
if( loader::context->zeDrivers.size() < 1 )
6779-
6778+
if( loader::context->zeDrivers.size() < 1 ) {
67806779
return ZE_RESULT_ERROR_UNINITIALIZED;
6780+
}
67816781

67826782
if( nullptr == pDdiTable )
67836783
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6885,9 +6885,9 @@ zeGetDeviceExpProcAddrTable(
68856885
ze_device_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
68866886
)
68876887
{
6888-
if( loader::context->zeDrivers.size() < 1 )
6889-
6888+
if( loader::context->zeDrivers.size() < 1 ) {
68906889
return ZE_RESULT_ERROR_UNINITIALIZED;
6890+
}
68916891

68926892
if( nullptr == pDdiTable )
68936893
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -6968,9 +6968,9 @@ zeGetContextProcAddrTable(
69686968
ze_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
69696969
)
69706970
{
6971-
if( loader::context->zeDrivers.size() < 1 )
6972-
6971+
if( loader::context->zeDrivers.size() < 1 ) {
69736972
return ZE_RESULT_ERROR_UNINITIALIZED;
6973+
}
69746974

69756975
if( nullptr == pDdiTable )
69766976
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7068,9 +7068,9 @@ zeGetCommandQueueProcAddrTable(
70687068
ze_command_queue_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
70697069
)
70707070
{
7071-
if( loader::context->zeDrivers.size() < 1 )
7072-
7071+
if( loader::context->zeDrivers.size() < 1 ) {
70737072
return ZE_RESULT_ERROR_UNINITIALIZED;
7073+
}
70747074

70757075
if( nullptr == pDdiTable )
70767076
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7165,9 +7165,9 @@ zeGetCommandListProcAddrTable(
71657165
ze_command_list_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
71667166
)
71677167
{
7168-
if( loader::context->zeDrivers.size() < 1 )
7169-
7168+
if( loader::context->zeDrivers.size() < 1 ) {
71707169
return ZE_RESULT_ERROR_UNINITIALIZED;
7170+
}
71717171

71727172
if( nullptr == pDdiTable )
71737173
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7290,9 +7290,9 @@ zeGetCommandListExpProcAddrTable(
72907290
ze_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
72917291
)
72927292
{
7293-
if( loader::context->zeDrivers.size() < 1 )
7294-
7293+
if( loader::context->zeDrivers.size() < 1 ) {
72957294
return ZE_RESULT_ERROR_UNINITIALIZED;
7295+
}
72967296

72977297
if( nullptr == pDdiTable )
72987298
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7380,9 +7380,9 @@ zeGetEventProcAddrTable(
73807380
ze_event_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
73817381
)
73827382
{
7383-
if( loader::context->zeDrivers.size() < 1 )
7384-
7383+
if( loader::context->zeDrivers.size() < 1 ) {
73857384
return ZE_RESULT_ERROR_UNINITIALIZED;
7385+
}
73867386

73877387
if( nullptr == pDdiTable )
73887388
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7482,9 +7482,9 @@ zeGetEventExpProcAddrTable(
74827482
ze_event_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
74837483
)
74847484
{
7485-
if( loader::context->zeDrivers.size() < 1 )
7486-
7485+
if( loader::context->zeDrivers.size() < 1 ) {
74877486
return ZE_RESULT_ERROR_UNINITIALIZED;
7487+
}
74887488

74897489
if( nullptr == pDdiTable )
74907490
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7565,9 +7565,9 @@ zeGetEventPoolProcAddrTable(
75657565
ze_event_pool_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
75667566
)
75677567
{
7568-
if( loader::context->zeDrivers.size() < 1 )
7569-
7568+
if( loader::context->zeDrivers.size() < 1 ) {
75707569
return ZE_RESULT_ERROR_UNINITIALIZED;
7570+
}
75717571

75727572
if( nullptr == pDdiTable )
75737573
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7664,9 +7664,9 @@ zeGetFenceProcAddrTable(
76647664
ze_fence_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
76657665
)
76667666
{
7667-
if( loader::context->zeDrivers.size() < 1 )
7668-
7667+
if( loader::context->zeDrivers.size() < 1 ) {
76697668
return ZE_RESULT_ERROR_UNINITIALIZED;
7669+
}
76707670

76717671
if( nullptr == pDdiTable )
76727672
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7760,9 +7760,9 @@ zeGetImageProcAddrTable(
77607760
ze_image_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
77617761
)
77627762
{
7763-
if( loader::context->zeDrivers.size() < 1 )
7764-
7763+
if( loader::context->zeDrivers.size() < 1 ) {
77657764
return ZE_RESULT_ERROR_UNINITIALIZED;
7765+
}
77667766

77677767
if( nullptr == pDdiTable )
77687768
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7856,9 +7856,9 @@ zeGetImageExpProcAddrTable(
78567856
ze_image_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
78577857
)
78587858
{
7859-
if( loader::context->zeDrivers.size() < 1 )
7860-
7859+
if( loader::context->zeDrivers.size() < 1 ) {
78617860
return ZE_RESULT_ERROR_UNINITIALIZED;
7861+
}
78627862

78637863
if( nullptr == pDdiTable )
78647864
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -7941,9 +7941,9 @@ zeGetKernelProcAddrTable(
79417941
ze_kernel_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
79427942
)
79437943
{
7944-
if( loader::context->zeDrivers.size() < 1 )
7945-
7944+
if( loader::context->zeDrivers.size() < 1 ) {
79467945
return ZE_RESULT_ERROR_UNINITIALIZED;
7946+
}
79477947

79487948
if( nullptr == pDdiTable )
79497949
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8044,9 +8044,9 @@ zeGetKernelExpProcAddrTable(
80448044
ze_kernel_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
80458045
)
80468046
{
8047-
if( loader::context->zeDrivers.size() < 1 )
8048-
8047+
if( loader::context->zeDrivers.size() < 1 ) {
80498048
return ZE_RESULT_ERROR_UNINITIALIZED;
8049+
}
80508050

80518051
if( nullptr == pDdiTable )
80528052
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8128,9 +8128,9 @@ zeGetMemProcAddrTable(
81288128
ze_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
81298129
)
81308130
{
8131-
if( loader::context->zeDrivers.size() < 1 )
8132-
8131+
if( loader::context->zeDrivers.size() < 1 ) {
81338132
return ZE_RESULT_ERROR_UNINITIALIZED;
8133+
}
81348134

81358135
if( nullptr == pDdiTable )
81368136
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8231,9 +8231,9 @@ zeGetMemExpProcAddrTable(
82318231
ze_mem_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
82328232
)
82338233
{
8234-
if( loader::context->zeDrivers.size() < 1 )
8235-
8234+
if( loader::context->zeDrivers.size() < 1 ) {
82368235
return ZE_RESULT_ERROR_UNINITIALIZED;
8236+
}
82378237

82388238
if( nullptr == pDdiTable )
82398239
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8317,9 +8317,9 @@ zeGetModuleProcAddrTable(
83178317
ze_module_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
83188318
)
83198319
{
8320-
if( loader::context->zeDrivers.size() < 1 )
8321-
8320+
if( loader::context->zeDrivers.size() < 1 ) {
83228321
return ZE_RESULT_ERROR_UNINITIALIZED;
8322+
}
83238323

83248324
if( nullptr == pDdiTable )
83258325
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8417,9 +8417,9 @@ zeGetModuleBuildLogProcAddrTable(
84178417
ze_module_build_log_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
84188418
)
84198419
{
8420-
if( loader::context->zeDrivers.size() < 1 )
8421-
8420+
if( loader::context->zeDrivers.size() < 1 ) {
84228421
return ZE_RESULT_ERROR_UNINITIALIZED;
8422+
}
84238423

84248424
if( nullptr == pDdiTable )
84258425
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8510,9 +8510,9 @@ zeGetPhysicalMemProcAddrTable(
85108510
ze_physical_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
85118511
)
85128512
{
8513-
if( loader::context->zeDrivers.size() < 1 )
8514-
8513+
if( loader::context->zeDrivers.size() < 1 ) {
85158514
return ZE_RESULT_ERROR_UNINITIALIZED;
8515+
}
85168516

85178517
if( nullptr == pDdiTable )
85188518
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8603,9 +8603,9 @@ zeGetSamplerProcAddrTable(
86038603
ze_sampler_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
86048604
)
86058605
{
8606-
if( loader::context->zeDrivers.size() < 1 )
8607-
8606+
if( loader::context->zeDrivers.size() < 1 ) {
86088607
return ZE_RESULT_ERROR_UNINITIALIZED;
8608+
}
86098609

86108610
if( nullptr == pDdiTable )
86118611
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8696,9 +8696,9 @@ zeGetVirtualMemProcAddrTable(
86968696
ze_virtual_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
86978697
)
86988698
{
8699-
if( loader::context->zeDrivers.size() < 1 )
8700-
8699+
if( loader::context->zeDrivers.size() < 1 ) {
87018700
return ZE_RESULT_ERROR_UNINITIALIZED;
8701+
}
87028702

87038703
if( nullptr == pDdiTable )
87048704
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8794,9 +8794,9 @@ zeGetFabricEdgeExpProcAddrTable(
87948794
ze_fabric_edge_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
87958795
)
87968796
{
8797-
if( loader::context->zeDrivers.size() < 1 )
8798-
8797+
if( loader::context->zeDrivers.size() < 1 ) {
87998798
return ZE_RESULT_ERROR_UNINITIALIZED;
8799+
}
88008800

88018801
if( nullptr == pDdiTable )
88028802
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
@@ -8879,9 +8879,9 @@ zeGetFabricVertexExpProcAddrTable(
88798879
ze_fabric_vertex_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
88808880
)
88818881
{
8882-
if( loader::context->zeDrivers.size() < 1 )
8883-
8882+
if( loader::context->zeDrivers.size() < 1 ) {
88848883
return ZE_RESULT_ERROR_UNINITIALIZED;
8884+
}
88858885

88868886
if( nullptr == pDdiTable )
88878887
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;

0 commit comments

Comments
 (0)