From af25b8907f9df4e40724055579671c8d1e83c869 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Wed, 27 May 2026 10:33:14 -0700 Subject: [PATCH] Fix null driver ddi from setting invalid functions Signed-off-by: Neil R. Spruit --- scripts/templates/nullddi.cpp.mako | 2 + source/drivers/null/ze_nullddi.cpp | 428 ++++++++++++++++++++++++++++ source/drivers/null/zer_nullddi.cpp | 8 + source/drivers/null/zes_nullddi.cpp | 300 +++++++++++++++++++ source/drivers/null/zet_nullddi.cpp | 138 +++++++++ 5 files changed, 876 insertions(+) diff --git a/scripts/templates/nullddi.cpp.mako b/scripts/templates/nullddi.cpp.mako index 8333aaa4..a0d105ee 100644 --- a/scripts/templates/nullddi.cpp.mako +++ b/scripts/templates/nullddi.cpp.mako @@ -176,6 +176,7 @@ ${tbl['export']['name']}( } %else: %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif @@ -185,6 +186,7 @@ ${tbl['export']['name']}( pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; #endif %endif + } %endfor %endif diff --git a/source/drivers/null/ze_nullddi.cpp b/source/drivers/null/ze_nullddi.cpp index dc6267c7..65e25834 100644 --- a/source/drivers/null/ze_nullddi.cpp +++ b/source/drivers/null/ze_nullddi.cpp @@ -6620,15 +6620,25 @@ zeGetRTASBuilderProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnCreateExt = driver::zeRTASBuilderCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnGetBuildPropertiesExt = driver::zeRTASBuilderGetBuildPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnBuildExt = driver::zeRTASBuilderBuildExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnCommandListAppendCopyExt = driver::zeRTASBuilderCommandListAppendCopyExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnDestroyExt = driver::zeRTASBuilderDestroyExt; + } return result; } @@ -6655,13 +6665,21 @@ zeGetRTASBuilderExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnCreateExp = driver::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetBuildPropertiesExp = driver::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnBuildExp = driver::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnDestroyExp = driver::zeRTASBuilderDestroyExp; + } return result; } @@ -6688,13 +6706,21 @@ zeGetRTASParallelOperationProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnCreateExt = driver::zeRTASParallelOperationCreateExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnGetPropertiesExt = driver::zeRTASParallelOperationGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnJoinExt = driver::zeRTASParallelOperationJoinExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnDestroyExt = driver::zeRTASParallelOperationDestroyExt; + } return result; } @@ -6721,13 +6747,21 @@ zeGetRTASParallelOperationExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnCreateExp = driver::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetPropertiesExp = driver::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnJoinExp = driver::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnDestroyExp = driver::zeRTASParallelOperationDestroyExp; + } return result; } @@ -6754,23 +6788,41 @@ zeGetDriverProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGet = driver::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetApiVersion = driver::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetIpcProperties = driver::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetExtensionProperties = driver::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnGetExtensionFunctionAddress = driver::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnRTASFormatCompatibilityCheckExt = driver::zeDriverRTASFormatCompatibilityCheckExt; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnGetDefaultContext = driver::zeDriverGetDefaultContext; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnGetLastErrorDescription = driver::zeDriverGetLastErrorDescription; + } return result; } @@ -6797,7 +6849,9 @@ zeGetDriverExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnRTASFormatCompatibilityCheckExp = driver::zeDriverRTASFormatCompatibilityCheckExp; + } return result; } @@ -6824,53 +6878,101 @@ zeGetDeviceProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGet = driver::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetSubDevices = driver::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetComputeProperties = driver::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetModuleProperties = driver::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetCommandQueueGroupProperties = driver::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetMemoryProperties = driver::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetMemoryAccessProperties = driver::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetCacheProperties = driver::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetImageProperties = driver::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetExternalMemoryProperties = driver::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetP2PProperties = driver::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCanAccessPeer = driver::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetStatus = driver::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnGetGlobalTimestamps = driver::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnImportExternalSemaphoreExt = driver::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnReleaseExternalSemaphoreExt = driver::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnGetVectorWidthPropertiesExt = driver::zeDeviceGetVectorWidthPropertiesExt; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnSynchronize = driver::zeDeviceSynchronize; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnGetAggregatedCopyOffloadIncrementValue = driver::zeDeviceGetAggregatedCopyOffloadIncrementValue; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnReserveCacheExt = driver::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnSetCacheAdviceExt = driver::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnPciGetPropertiesExt = driver::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetRootDevice = driver::zeDeviceGetRootDevice; + } return result; } @@ -6897,7 +6999,9 @@ zeGetDeviceExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetFabricVertexExp = driver::zeDeviceGetFabricVertexExp; + } return result; } @@ -6924,23 +7028,41 @@ zeGetContextProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetStatus = driver::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSystemBarrier = driver::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnMakeMemoryResident = driver::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEvictMemory = driver::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnMakeImageResident = driver::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEvictImage = driver::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnCreateEx = driver::zeContextCreateEx; + } return result; } @@ -6967,17 +7089,29 @@ zeGetCommandQueueProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnExecuteCommandLists = driver::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSynchronize = driver::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = driver::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetIndex = driver::zeCommandQueueGetIndex; + } return result; } @@ -7004,81 +7138,157 @@ zeGetCommandListProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreateImmediate = driver::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnClose = driver::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReset = driver::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendWriteGlobalTimestamp = driver::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendBarrier = driver::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryRangesBarrier = driver::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryCopy = driver::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryFill = driver::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryCopyRegion = driver::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryCopyFromContext = driver::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendImageCopy = driver::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendImageCopyRegion = driver::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendImageCopyToMemory = driver::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendImageCopyFromMemory = driver::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemoryPrefetch = driver::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMemAdvise = driver::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendSignalEvent = driver::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendWaitOnEvents = driver::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendEventReset = driver::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendQueryKernelTimestamps = driver::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendLaunchKernel = driver::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendLaunchCooperativeKernel = driver::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendLaunchKernelIndirect = driver::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = driver::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnAppendSignalExternalSemaphoreExt = driver::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnAppendWaitExternalSemaphoreExt = driver::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnAppendLaunchKernelWithParameters = driver::zeCommandListAppendLaunchKernelWithParameters; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnAppendLaunchKernelWithArguments = driver::zeCommandListAppendLaunchKernelWithArguments; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyToMemoryExt = driver::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnAppendImageCopyFromMemoryExt = driver::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnHostSynchronize = driver::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetDeviceHandle = driver::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetContextHandle = driver::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetOrdinal = driver::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnImmediateGetIndex = driver::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnIsImmediate = driver::zeCommandListIsImmediate; + } return result; } @@ -7105,21 +7315,37 @@ zeGetCommandListExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetNextCommandIdWithKernelsExp = driver::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnUpdateMutableCommandKernelsExp = driver::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCreateCloneExp = driver::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnImmediateAppendCommandListsExp = driver::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetNextCommandIdExp = driver::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnUpdateMutableCommandsExp = driver::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnUpdateMutableCommandSignalEventExp = driver::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnUpdateMutableCommandWaitEventsExp = driver::zeCommandListUpdateMutableCommandWaitEventsExp; + } return result; } @@ -7146,37 +7372,69 @@ zeGetEventProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnHostSignal = driver::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnHostSynchronize = driver::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnQueryStatus = driver::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnHostReset = driver::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnQueryKernelTimestamp = driver::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedCreate = driver::zeEventCounterBasedCreate; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedGetIpcHandle = driver::zeEventCounterBasedGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedOpenIpcHandle = driver::zeEventCounterBasedOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedCloseIpcHandle = driver::zeEventCounterBasedCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnCounterBasedGetDeviceAddress = driver::zeEventCounterBasedGetDeviceAddress; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnQueryKernelTimestampsExt = driver::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetEventPool = driver::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetSignalScope = driver::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetWaitScope = driver::zeEventGetWaitScope; + } return result; } @@ -7203,7 +7461,9 @@ zeGetEventExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnQueryTimestampsExp = driver::zeEventQueryTimestampsExp; + } return result; } @@ -7230,21 +7490,37 @@ zeGetEventPoolProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetIpcHandle = driver::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOpenIpcHandle = driver::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCloseIpcHandle = driver::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnPutIpcHandle = driver::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetContextHandle = driver::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetFlags = driver::zeEventPoolGetFlags; + } return result; } @@ -7271,15 +7547,25 @@ zeGetFenceProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnHostSynchronize = driver::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnQueryStatus = driver::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReset = driver::zeFenceReset; + } return result; } @@ -7306,15 +7592,25 @@ zeGetImageProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnGetAllocPropertiesExt = driver::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnViewCreateExt = driver::zeImageViewCreateExt; + } return result; } @@ -7341,11 +7637,17 @@ zeGetImageExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnGetMemoryPropertiesExp = driver::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnViewCreateExp = driver::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetDeviceOffsetExp = driver::zeImageGetDeviceOffsetExp; + } return result; } @@ -7372,29 +7674,53 @@ zeGetKernelProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetCacheConfig = driver::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetGroupSize = driver::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSuggestGroupSize = driver::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSuggestMaxCooperativeGroupCount = driver::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetArgumentValue = driver::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetIndirectAccess = driver::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetIndirectAccess = driver::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetSourceAttributes = driver::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetName = driver::zeKernelGetName; + } return result; } @@ -7421,13 +7747,21 @@ zeGetKernelExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnSetGlobalOffsetExp = driver::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { pDdiTable->pfnGetBinaryExp = driver::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnGetAllocationPropertiesExp = driver::zeKernelGetAllocationPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnSchedulingHintExp = driver::zeKernelSchedulingHintExp; + } return result; } @@ -7454,31 +7788,57 @@ zeGetMemProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAllocShared = driver::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAllocDevice = driver::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAllocHost = driver::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnFree = driver::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetAllocProperties = driver::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetAddressRange = driver::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetIpcHandle = driver::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOpenIpcHandle = driver::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCloseIpcHandle = driver::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnGetIpcHandleWithProperties = driver::zeMemGetIpcHandleWithProperties; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnFreeExt = driver::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnPutIpcHandle = driver::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetPitchFor2dImage = driver::zeMemGetPitchFor2dImage; + } return result; } @@ -7505,13 +7865,21 @@ zeGetMemExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = driver::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = driver::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnSetAtomicAccessAttributeExp = driver::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetAtomicAccessAttributeExp = driver::zeMemGetAtomicAccessAttributeExp; + } return result; } @@ -7538,23 +7906,41 @@ zeGetModuleProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDynamicLink = driver::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetNativeBinary = driver::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetGlobalPointer = driver::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetKernelNames = driver::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetFunctionPointer = driver::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { pDdiTable->pfnInspectLinkageExt = driver::zeModuleInspectLinkageExt; + } return result; } @@ -7581,9 +7967,13 @@ zeGetModuleBuildLogProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetString = driver::zeModuleBuildLogGetString; + } return result; } @@ -7610,11 +8000,17 @@ zeGetPhysicalMemProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zePhysicalMemDestroy; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnGetProperties = driver::zePhysicalMemGetProperties; + } return result; } @@ -7641,9 +8037,13 @@ zeGetSamplerProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zeSamplerDestroy; + } return result; } @@ -7670,19 +8070,33 @@ zeGetVirtualMemProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReserve = driver::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnFree = driver::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnQueryPageSize = driver::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnMap = driver::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnUnmap = driver::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetAccessAttribute = driver::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetAccessAttribute = driver::zeVirtualMemGetAccessAttribute; + } return result; } @@ -7709,11 +8123,17 @@ zeGetFabricEdgeExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetExp = driver::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetVerticesExp = driver::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetPropertiesExp = driver::zeFabricEdgeGetPropertiesExp; + } return result; } @@ -7740,13 +8160,21 @@ zeGetFabricVertexExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetExp = driver::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetSubVerticesExp = driver::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetPropertiesExp = driver::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetDeviceExp = driver::zeFabricVertexGetDeviceExp; + } return result; } diff --git a/source/drivers/null/zer_nullddi.cpp b/source/drivers/null/zer_nullddi.cpp index 08828a32..c8dbd737 100644 --- a/source/drivers/null/zer_nullddi.cpp +++ b/source/drivers/null/zer_nullddi.cpp @@ -154,13 +154,21 @@ zerGetGlobalProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnGetLastErrorDescription = driver::zerGetLastErrorDescription; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnTranslateDeviceHandleToIdentifier = driver::zerTranslateDeviceHandleToIdentifier; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnTranslateIdentifierToDeviceHandle = driver::zerTranslateIdentifierToDeviceHandle; + } + if (version >= ZE_API_VERSION_1_14) { pDdiTable->pfnGetDefaultContext = driver::zerGetDefaultContext; + } return result; } diff --git a/source/drivers/null/zes_nullddi.cpp b/source/drivers/null/zes_nullddi.cpp index 87876dfa..394f18b0 100644 --- a/source/drivers/null/zes_nullddi.cpp +++ b/source/drivers/null/zes_nullddi.cpp @@ -4614,7 +4614,9 @@ zesGetGlobalProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnInit = driver::zesInit; + } return result; } @@ -4641,81 +4643,157 @@ zesGetDeviceProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesDeviceGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReset = driver::zesDeviceReset; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnProcessesGetState = driver::zesDeviceProcessesGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnPciGetProperties = driver::zesDevicePciGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnPciGetState = driver::zesDevicePciGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnPciGetBars = driver::zesDevicePciGetBars; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnPciGetStats = driver::zesDevicePciGetStats; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumDiagnosticTestSuites = driver::zesDeviceEnumDiagnosticTestSuites; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumEngineGroups = driver::zesDeviceEnumEngineGroups; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEventRegister = driver::zesDeviceEventRegister; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumFabricPorts = driver::zesDeviceEnumFabricPorts; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumFans = driver::zesDeviceEnumFans; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumFirmwares = driver::zesDeviceEnumFirmwares; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumFrequencyDomains = driver::zesDeviceEnumFrequencyDomains; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumLeds = driver::zesDeviceEnumLeds; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumMemoryModules = driver::zesDeviceEnumMemoryModules; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumPerformanceFactorDomains = driver::zesDeviceEnumPerformanceFactorDomains; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumPowerDomains = driver::zesDeviceEnumPowerDomains; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetCardPowerDomain = driver::zesDeviceGetCardPowerDomain; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumPsus = driver::zesDeviceEnumPsus; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumRasErrorSets = driver::zesDeviceEnumRasErrorSets; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumSchedulers = driver::zesDeviceEnumSchedulers; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumStandbyDomains = driver::zesDeviceEnumStandbyDomains; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEnumTemperatureSensors = driver::zesDeviceEnumTemperatureSensors; + } + if (version >= ZE_API_VERSION_1_15) { pDdiTable->pfnPciLinkSpeedUpdateExt = driver::zesDevicePciLinkSpeedUpdateExt; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnEccAvailable = driver::zesDeviceEccAvailable; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnEccConfigurable = driver::zesDeviceEccConfigurable; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnGetEccState = driver::zesDeviceGetEccState; + } + if (version >= ZE_API_VERSION_1_4) { pDdiTable->pfnSetEccState = driver::zesDeviceSetEccState; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGet = driver::zesDeviceGet; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnSetOverclockWaiver = driver::zesDeviceSetOverclockWaiver; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetOverclockDomains = driver::zesDeviceGetOverclockDomains; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetOverclockControls = driver::zesDeviceGetOverclockControls; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnResetOverclockSettings = driver::zesDeviceResetOverclockSettings; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnReadOverclockState = driver::zesDeviceReadOverclockState; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnEnumOverclockDomains = driver::zesDeviceEnumOverclockDomains; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnResetExt = driver::zesDeviceResetExt; + } return result; } @@ -4742,11 +4820,17 @@ zesGetDeviceExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnEnumEnabledVFExp = driver::zesDeviceEnumEnabledVFExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetSubDevicePropertiesExp = driver::zesDeviceGetSubDevicePropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnEnumActiveVFExp = driver::zesDeviceEnumActiveVFExp; + } return result; } @@ -4773,15 +4857,25 @@ zesGetDriverProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnEventListen = driver::zesDriverEventListen; + } + if (version >= ZE_API_VERSION_1_1) { pDdiTable->pfnEventListenEx = driver::zesDriverEventListenEx; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGet = driver::zesDriverGet; + } + if (version >= ZE_API_VERSION_1_8) { pDdiTable->pfnGetExtensionProperties = driver::zesDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_8) { pDdiTable->pfnGetExtensionFunctionAddress = driver::zesDriverGetExtensionFunctionAddress; + } return result; } @@ -4808,7 +4902,9 @@ zesGetDriverExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetDeviceByUuidExp = driver::zesDriverGetDeviceByUuidExp; + } return result; } @@ -4835,11 +4931,17 @@ zesGetDiagnosticsProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesDiagnosticsGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetTests = driver::zesDiagnosticsGetTests; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnRunTests = driver::zesDiagnosticsRunTests; + } return result; } @@ -4866,11 +4968,17 @@ zesGetEngineProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesEngineGetProperties; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetActivity = driver::zesEngineGetActivity; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetActivityExt = driver::zesEngineGetActivityExt; + } return result; } @@ -4897,21 +5005,37 @@ zesGetFabricPortProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesFabricPortGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetLinkType = driver::zesFabricPortGetLinkType; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetConfig = driver::zesFabricPortGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetConfig = driver::zesFabricPortSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesFabricPortGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetThroughput = driver::zesFabricPortGetThroughput; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetFabricErrorCounters = driver::zesFabricPortGetFabricErrorCounters; + } + if (version >= ZE_API_VERSION_1_7) { pDdiTable->pfnGetMultiPortThroughput = driver::zesFabricPortGetMultiPortThroughput; + } return result; } @@ -4938,17 +5062,29 @@ zesGetFanProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesFanGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetConfig = driver::zesFanGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetDefaultMode = driver::zesFanSetDefaultMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetFixedSpeedMode = driver::zesFanSetFixedSpeedMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetSpeedTableMode = driver::zesFanSetSpeedTableMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesFanGetState; + } return result; } @@ -4975,13 +5111,21 @@ zesGetFirmwareProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesFirmwareGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnFlash = driver::zesFirmwareFlash; + } + if (version >= ZE_API_VERSION_1_8) { pDdiTable->pfnGetFlashProgress = driver::zesFirmwareGetFlashProgress; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetConsoleLogs = driver::zesFirmwareGetConsoleLogs; + } return result; } @@ -5008,9 +5152,13 @@ zesGetFirmwareExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetSecurityVersionExp = driver::zesFirmwareGetSecurityVersionExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnSetSecurityVersionExp = driver::zesFirmwareSetSecurityVersionExp; + } return result; } @@ -5037,39 +5185,73 @@ zesGetFrequencyProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesFrequencyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetAvailableClocks = driver::zesFrequencyGetAvailableClocks; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetRange = driver::zesFrequencyGetRange; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetRange = driver::zesFrequencySetRange; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesFrequencyGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetThrottleTime = driver::zesFrequencyGetThrottleTime; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetCapabilities = driver::zesFrequencyOcGetCapabilities; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetFrequencyTarget = driver::zesFrequencyOcGetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcSetFrequencyTarget = driver::zesFrequencyOcSetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetVoltageTarget = driver::zesFrequencyOcGetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcSetVoltageTarget = driver::zesFrequencyOcSetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcSetMode = driver::zesFrequencyOcSetMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetMode = driver::zesFrequencyOcGetMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetIccMax = driver::zesFrequencyOcGetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcSetIccMax = driver::zesFrequencyOcSetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcGetTjMax = driver::zesFrequencyOcGetTjMax; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOcSetTjMax = driver::zesFrequencyOcSetTjMax; + } return result; } @@ -5096,13 +5278,21 @@ zesGetLedProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesLedGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesLedGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetState = driver::zesLedSetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetColor = driver::zesLedSetColor; + } return result; } @@ -5129,11 +5319,17 @@ zesGetMemoryProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesMemoryGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesMemoryGetState; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetBandwidth = driver::zesMemoryGetBandwidth; + } return result; } @@ -5160,23 +5356,41 @@ zesGetOverclockProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetDomainProperties = driver::zesOverclockGetDomainProperties; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetDomainVFProperties = driver::zesOverclockGetDomainVFProperties; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetDomainControlProperties = driver::zesOverclockGetDomainControlProperties; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetControlCurrentValue = driver::zesOverclockGetControlCurrentValue; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetControlPendingValue = driver::zesOverclockGetControlPendingValue; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnSetControlUserValue = driver::zesOverclockSetControlUserValue; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetControlState = driver::zesOverclockGetControlState; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetVFPointValues = driver::zesOverclockGetVFPointValues; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnSetVFPointValues = driver::zesOverclockSetVFPointValues; + } return result; } @@ -5203,11 +5417,17 @@ zesGetPerformanceFactorProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesPerformanceFactorGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetConfig = driver::zesPerformanceFactorGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetConfig = driver::zesPerformanceFactorSetConfig; + } return result; } @@ -5234,21 +5454,37 @@ zesGetPowerProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesPowerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetEnergyCounter = driver::zesPowerGetEnergyCounter; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetLimits = driver::zesPowerGetLimits; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetLimits = driver::zesPowerSetLimits; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetEnergyThreshold = driver::zesPowerGetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetEnergyThreshold = driver::zesPowerSetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetLimitsExt = driver::zesPowerGetLimitsExt; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetLimitsExt = driver::zesPowerSetLimitsExt; + } return result; } @@ -5275,9 +5511,13 @@ zesGetPsuProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesPsuGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesPsuGetState; + } return result; } @@ -5304,13 +5544,21 @@ zesGetRasProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesRasGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetConfig = driver::zesRasGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetConfig = driver::zesRasSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesRasGetState; + } return result; } @@ -5337,9 +5585,13 @@ zesGetRasExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetStateExp = driver::zesRasGetStateExp; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnClearStateExp = driver::zesRasClearStateExp; + } return result; } @@ -5366,21 +5618,37 @@ zesGetSchedulerProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesSchedulerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetCurrentMode = driver::zesSchedulerGetCurrentMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetTimeoutModeProperties = driver::zesSchedulerGetTimeoutModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetTimesliceModeProperties = driver::zesSchedulerGetTimesliceModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetTimeoutMode = driver::zesSchedulerSetTimeoutMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetTimesliceMode = driver::zesSchedulerSetTimesliceMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetExclusiveMode = driver::zesSchedulerSetExclusiveMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetComputeUnitDebugMode = driver::zesSchedulerSetComputeUnitDebugMode; + } return result; } @@ -5407,11 +5675,17 @@ zesGetStandbyProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesStandbyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetMode = driver::zesStandbyGetMode; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetMode = driver::zesStandbySetMode; + } return result; } @@ -5438,13 +5712,21 @@ zesGetTemperatureProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zesTemperatureGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetConfig = driver::zesTemperatureGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetConfig = driver::zesTemperatureSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetState = driver::zesTemperatureGetState; + } return result; } @@ -5471,23 +5753,41 @@ zesGetVFManagementExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetVFCapabilitiesExp = driver::zesVFManagementGetVFCapabilitiesExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetVFMemoryUtilizationExp2 = driver::zesVFManagementGetVFMemoryUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetVFEngineUtilizationExp2 = driver::zesVFManagementGetVFEngineUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_12) { pDdiTable->pfnGetVFCapabilitiesExp2 = driver::zesVFManagementGetVFCapabilitiesExp2; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetVFPropertiesExp = driver::zesVFManagementGetVFPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetVFMemoryUtilizationExp = driver::zesVFManagementGetVFMemoryUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetVFEngineUtilizationExp = driver::zesVFManagementGetVFEngineUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnSetVFTelemetryModeExp = driver::zesVFManagementSetVFTelemetryModeExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = driver::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } return result; } diff --git a/source/drivers/null/zet_nullddi.cpp b/source/drivers/null/zet_nullddi.cpp index 1e579803..0525d4e3 100644 --- a/source/drivers/null/zet_nullddi.cpp +++ b/source/drivers/null/zet_nullddi.cpp @@ -2264,11 +2264,17 @@ zetGetMetricDecoderExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnCreateExp = driver::zetMetricDecoderCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnDestroyExp = driver::zetMetricDecoderDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetDecodableMetricsExp = driver::zetMetricDecoderGetDecodableMetricsExp; + } return result; } @@ -2295,13 +2301,21 @@ zetGetMetricProgrammableExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetExp = driver::zetMetricProgrammableGetExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetPropertiesExp = driver::zetMetricProgrammableGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetParamInfoExp = driver::zetMetricProgrammableGetParamInfoExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnGetParamValueInfoExp = driver::zetMetricProgrammableGetParamValueInfoExp; + } return result; } @@ -2328,17 +2342,29 @@ zetGetMetricTracerExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnCreateExp = driver::zetMetricTracerCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnDestroyExp = driver::zetMetricTracerDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnEnableExp = driver::zetMetricTracerEnableExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnDisableExp = driver::zetMetricTracerDisableExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnReadDataExp = driver::zetMetricTracerReadDataExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnDecodeExp = driver::zetMetricTracerDecodeExp; + } return result; } @@ -2365,7 +2391,9 @@ zetGetDeviceProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetDebugProperties = driver::zetDeviceGetDebugProperties; + } return result; } @@ -2392,13 +2420,21 @@ zetGetDeviceExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnGetConcurrentMetricGroupsExp = driver::zetDeviceGetConcurrentMetricGroupsExp; + } + if (version >= ZE_API_VERSION_1_10) { pDdiTable->pfnCreateMetricGroupsFromMetricsExp = driver::zetDeviceCreateMetricGroupsFromMetricsExp; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnEnableMetricsExp = driver::zetDeviceEnableMetricsExp; + } + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnDisableMetricsExp = driver::zetDeviceDisableMetricsExp; + } return result; } @@ -2425,7 +2461,9 @@ zetGetContextProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnActivateMetricGroups = driver::zetContextActivateMetricGroups; + } return result; } @@ -2452,13 +2490,21 @@ zetGetCommandListProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMetricStreamerMarker = driver::zetCommandListAppendMetricStreamerMarker; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMetricQueryBegin = driver::zetCommandListAppendMetricQueryBegin; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMetricQueryEnd = driver::zetCommandListAppendMetricQueryEnd; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAppendMetricMemoryBarrier = driver::zetCommandListAppendMetricMemoryBarrier; + } return result; } @@ -2485,7 +2531,9 @@ zetGetCommandListExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_13) { pDdiTable->pfnAppendMarkerExp = driver::zetCommandListAppendMarkerExp; + } return result; } @@ -2512,7 +2560,9 @@ zetGetKernelProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProfileInfo = driver::zetKernelGetProfileInfo; + } return result; } @@ -2539,7 +2589,9 @@ zetGetModuleProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetDebugInfo = driver::zetModuleGetDebugInfo; + } return result; } @@ -2566,29 +2618,53 @@ zetGetDebugProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAttach = driver::zetDebugAttach; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDetach = driver::zetDebugDetach; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReadEvent = driver::zetDebugReadEvent; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnAcknowledgeEvent = driver::zetDebugAcknowledgeEvent; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnInterrupt = driver::zetDebugInterrupt; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnResume = driver::zetDebugResume; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReadMemory = driver::zetDebugReadMemory; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnWriteMemory = driver::zetDebugWriteMemory; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetRegisterSetProperties = driver::zetDebugGetRegisterSetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReadRegisters = driver::zetDebugReadRegisters; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnWriteRegisters = driver::zetDebugWriteRegisters; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetThreadRegisterSetProperties = driver::zetDebugGetThreadRegisterSetProperties; + } return result; } @@ -2615,9 +2691,13 @@ zetGetMetricProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGet = driver::zetMetricGet; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zetMetricGetProperties; + } return result; } @@ -2644,11 +2724,17 @@ zetGetMetricExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_11) { pDdiTable->pfnCreateFromProgrammableExp2 = driver::zetMetricCreateFromProgrammableExp2; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCreateFromProgrammableExp = driver::zetMetricCreateFromProgrammableExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnDestroyExp = driver::zetMetricDestroyExp; + } return result; } @@ -2675,11 +2761,17 @@ zetGetMetricGroupProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGet = driver::zetMetricGroupGet; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetProperties = driver::zetMetricGroupGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCalculateMetricValues = driver::zetMetricGroupCalculateMetricValues; + } return result; } @@ -2706,23 +2798,41 @@ zetGetMetricGroupExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_2) { pDdiTable->pfnCalculateMultipleMetricValuesExp = driver::zetMetricGroupCalculateMultipleMetricValuesExp; + } + if (version >= ZE_API_VERSION_1_5) { pDdiTable->pfnGetGlobalTimestampsExp = driver::zetMetricGroupGetGlobalTimestampsExp; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnGetExportDataExp = driver::zetMetricGroupGetExportDataExp; + } + if (version >= ZE_API_VERSION_1_6) { pDdiTable->pfnCalculateMetricExportDataExp = driver::zetMetricGroupCalculateMetricExportDataExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCreateExp = driver::zetMetricGroupCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnAddMetricExp = driver::zetMetricGroupAddMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnRemoveMetricExp = driver::zetMetricGroupRemoveMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnCloseExp = driver::zetMetricGroupCloseExp; + } + if (version >= ZE_API_VERSION_1_9) { pDdiTable->pfnDestroyExp = driver::zetMetricGroupDestroyExp; + } return result; } @@ -2749,13 +2859,21 @@ zetGetMetricQueryProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zetMetricQueryCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zetMetricQueryDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReset = driver::zetMetricQueryReset; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnGetData = driver::zetMetricQueryGetData; + } return result; } @@ -2782,9 +2900,13 @@ zetGetMetricQueryPoolProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zetMetricQueryPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zetMetricQueryPoolDestroy; + } return result; } @@ -2811,11 +2933,17 @@ zetGetMetricStreamerProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnOpen = driver::zetMetricStreamerOpen; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnClose = driver::zetMetricStreamerClose; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnReadData = driver::zetMetricStreamerReadData; + } return result; } @@ -2842,15 +2970,25 @@ zetGetTracerExpProcAddrTable( ze_result_t result = ZE_RESULT_SUCCESS; + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnCreate = driver::zetTracerExpCreate; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnDestroy = driver::zetTracerExpDestroy; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetPrologues = driver::zetTracerExpSetPrologues; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetEpilogues = driver::zetTracerExpSetEpilogues; + } + if (version >= ZE_API_VERSION_1_0) { pDdiTable->pfnSetEnabled = driver::zetTracerExpSetEnabled; + } return result; }