Skip to content

Commit

Permalink
Fix check for new ddi table in 1.11 and fix space in driver count che…
Browse files Browse the repository at this point in the history
…ck. (#210)

Signed-off-by: Neil R. Spruit <[email protected]>
  • Loading branch information
nrspruit authored Oct 7, 2024
1 parent 5b4317c commit 78941ef
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 146 deletions.
2 changes: 1 addition & 1 deletion scripts/templates/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1937,4 +1937,4 @@ def get_loader_epilogue(namespace, tags, obj, meta):
"""
def isNewProcTable(tableName):

return tableName in ["zesGetGlobalProcAddrTable","zesGetOverclockProcAddrTable"]
return tableName in ["zesGetGlobalProcAddrTable","zesGetOverclockProcAddrTable","zesGetVFManagementProcAddrTable"]
6 changes: 3 additions & 3 deletions scripts/templates/ldrddi.cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ ${tbl['export']['name']}(
)
{
%if namespace != "zes":
if( loader::context->zeDrivers.size() < 1 )
if( loader::context->zeDrivers.size() < 1 ) {
%else:
if( loader::context->sysmanInstanceDrivers->size() < 1 )
if( loader::context->sysmanInstanceDrivers->size() < 1 ) {
%endif

return ${X}_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ${X}_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down
112 changes: 56 additions & 56 deletions source/loader/ze_ldrddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6326,9 +6326,9 @@ zeGetGlobalProcAddrTable(
ze_global_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6422,9 +6422,9 @@ zeGetRTASBuilderExpProcAddrTable(
ze_rtas_builder_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6508,9 +6508,9 @@ zeGetRTASParallelOperationExpProcAddrTable(
ze_rtas_parallel_operation_exp_dditable_t* pDdiTable///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6594,9 +6594,9 @@ zeGetDriverProcAddrTable(
ze_driver_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6692,9 +6692,9 @@ zeGetDriverExpProcAddrTable(
ze_driver_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6775,9 +6775,9 @@ zeGetDeviceProcAddrTable(
ze_device_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6885,9 +6885,9 @@ zeGetDeviceExpProcAddrTable(
ze_device_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -6968,9 +6968,9 @@ zeGetContextProcAddrTable(
ze_context_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7068,9 +7068,9 @@ zeGetCommandQueueProcAddrTable(
ze_command_queue_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7165,9 +7165,9 @@ zeGetCommandListProcAddrTable(
ze_command_list_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7290,9 +7290,9 @@ zeGetCommandListExpProcAddrTable(
ze_command_list_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7380,9 +7380,9 @@ zeGetEventProcAddrTable(
ze_event_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7482,9 +7482,9 @@ zeGetEventExpProcAddrTable(
ze_event_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7565,9 +7565,9 @@ zeGetEventPoolProcAddrTable(
ze_event_pool_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7664,9 +7664,9 @@ zeGetFenceProcAddrTable(
ze_fence_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7760,9 +7760,9 @@ zeGetImageProcAddrTable(
ze_image_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7856,9 +7856,9 @@ zeGetImageExpProcAddrTable(
ze_image_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -7941,9 +7941,9 @@ zeGetKernelProcAddrTable(
ze_kernel_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8044,9 +8044,9 @@ zeGetKernelExpProcAddrTable(
ze_kernel_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8128,9 +8128,9 @@ zeGetMemProcAddrTable(
ze_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8231,9 +8231,9 @@ zeGetMemExpProcAddrTable(
ze_mem_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8317,9 +8317,9 @@ zeGetModuleProcAddrTable(
ze_module_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8417,9 +8417,9 @@ zeGetModuleBuildLogProcAddrTable(
ze_module_build_log_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8510,9 +8510,9 @@ zeGetPhysicalMemProcAddrTable(
ze_physical_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8603,9 +8603,9 @@ zeGetSamplerProcAddrTable(
ze_sampler_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8696,9 +8696,9 @@ zeGetVirtualMemProcAddrTable(
ze_virtual_mem_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8794,9 +8794,9 @@ zeGetFabricEdgeExpProcAddrTable(
ze_fabric_edge_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down Expand Up @@ -8879,9 +8879,9 @@ zeGetFabricVertexExpProcAddrTable(
ze_fabric_vertex_exp_dditable_t* pDdiTable ///< [in,out] pointer to table of DDI function pointers
)
{
if( loader::context->zeDrivers.size() < 1 )

if( loader::context->zeDrivers.size() < 1 ) {
return ZE_RESULT_ERROR_UNINITIALIZED;
}

if( nullptr == pDdiTable )
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;
Expand Down
Loading

0 comments on commit 78941ef

Please sign in to comment.