diff --git a/scripts/templates/helper.py b/scripts/templates/helper.py index b75e8655..4cf99644 100644 --- a/scripts/templates/helper.py +++ b/scripts/templates/helper.py @@ -1726,6 +1726,46 @@ def get_class_function_objs_exp(specs, cname): return objects, exp_objects, optional +""" +Public: + returns the version of a function object +""" +def get_version(obj): + if obj_traits.is_function(obj): + ret_version = "ZE_API_VERSION_FORCE_UINT32" + version = obj.get('version') + if version == "1.0": + ret_version = "ZE_API_VERSION_1_0" + if version == "1.1": + ret_version = "ZE_API_VERSION_1_1" + if version == "1.2": + ret_version = "ZE_API_VERSION_1_2" + if version == "1.3": + ret_version = "ZE_API_VERSION_1_3" + if version == "1.4": + ret_version = "ZE_API_VERSION_1_4" + if version == "1.5": + ret_version = "ZE_API_VERSION_1_5" + if version == "1.6": + ret_version = "ZE_API_VERSION_1_6" + if version == "1.7": + ret_version = "ZE_API_VERSION_1_7" + if version == "1.8": + ret_version = "ZE_API_VERSION_1_8" + if version == "1.9": + ret_version = "ZE_API_VERSION_1_9" + if version == "1.10": + ret_version = "ZE_API_VERSION_1_10" + if version == "1.11": + ret_version = "ZE_API_VERSION_1_11" + if version == "1.12": + ret_version = "ZE_API_VERSION_1_12" + if version == "1.13": + ret_version = "ZE_API_VERSION_1_13" + if (ret_version == "ZE_API_VERSION_FORCE_UINT32"): + ret_version = "ZE_API_VERSION_1_0" + return ret_version + """ Public: returns string name of DDI table for function object diff --git a/scripts/templates/ldrddi.cpp.mako b/scripts/templates/ldrddi.cpp.mako index 9381c3c2..72e5c2ed 100644 --- a/scripts/templates/ldrddi.cpp.mako +++ b/scripts/templates/ldrddi.cpp.mako @@ -443,15 +443,17 @@ ${tbl['export']['name']}( { // return pointers to loader's DDIs %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = loader::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; #endif %endif + } %endfor } else diff --git a/scripts/templates/tracing/trcddi.cpp.mako b/scripts/templates/tracing/trcddi.cpp.mako index 29e6b5ac..235ed472 100644 --- a/scripts/templates/tracing/trcddi.cpp.mako +++ b/scripts/templates/tracing/trcddi.cpp.mako @@ -91,25 +91,25 @@ ${tbl['export']['name']}( if( nullptr == pDdiTable ) return ${X}_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; ${x}_result_t result = ${X}_RESULT_SUCCESS; %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = tracing_layer::${th.make_func_name(n, tags, obj)}; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = tracing_layer::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; #endif %endif - + } %endfor return result; } diff --git a/scripts/templates/validation/valddi.cpp.mako b/scripts/templates/validation/valddi.cpp.mako index 07c7b0a7..8e28d92f 100644 --- a/scripts/templates/validation/valddi.cpp.mako +++ b/scripts/templates/validation/valddi.cpp.mako @@ -154,25 +154,25 @@ ${tbl['export']['name']}( if( nullptr == pDdiTable ) return ${X}_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ${X}_RESULT_ERROR_UNSUPPORTED_VERSION; ${x}_result_t result = ${X}_RESULT_SUCCESS; %for obj in tbl['functions']: + if (version >= ${th.get_version(obj)}) { %if 'condition' in obj: #if ${th.subt(n, tags, obj['condition'])} %endif - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = validation_layer::${th.make_func_name(n, tags, obj)}; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = pDdiTable->${th.make_pfn_name(n, tags, obj)}; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = validation_layer::${th.make_func_name(n, tags, obj)}; %if 'condition' in obj: #else - dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; - pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; + dditable.${th.append_ws(th.make_pfn_name(n, tags, obj), 43)} = nullptr; + pDdiTable->${th.append_ws(th.make_pfn_name(n, tags, obj), 41)} = nullptr; #endif %endif - + } %endfor return result; } diff --git a/source/layers/tracing/ze_trcddi.cpp b/source/layers/tracing/ze_trcddi.cpp index 9df2671d..53447bc0 100644 --- a/source/layers/tracing/ze_trcddi.cpp +++ b/source/layers/tracing/ze_trcddi.cpp @@ -7751,18 +7751,19 @@ zeGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = tracing_layer::zeInit; - - dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; - pDdiTable->pfnInitDrivers = tracing_layer::zeInitDrivers; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = tracing_layer::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; + pDdiTable->pfnInitDrivers = tracing_layer::zeInitDrivers; + } return result; } @@ -7785,24 +7786,27 @@ zeGetRTASBuilderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = tracing_layer::zeRTASBuilderCreateExp; - - dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; - pDdiTable->pfnGetBuildPropertiesExp = tracing_layer::zeRTASBuilderGetBuildPropertiesExp; - - dditable.pfnBuildExp = pDdiTable->pfnBuildExp; - pDdiTable->pfnBuildExp = tracing_layer::zeRTASBuilderBuildExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = tracing_layer::zeRTASBuilderDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = tracing_layer::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; + pDdiTable->pfnGetBuildPropertiesExp = tracing_layer::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnBuildExp = pDdiTable->pfnBuildExp; + pDdiTable->pfnBuildExp = tracing_layer::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = tracing_layer::zeRTASBuilderDestroyExp; + } return result; } @@ -7825,24 +7829,27 @@ zeGetRTASParallelOperationExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = tracing_layer::zeRTASParallelOperationCreateExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeRTASParallelOperationGetPropertiesExp; - - dditable.pfnJoinExp = pDdiTable->pfnJoinExp; - pDdiTable->pfnJoinExp = tracing_layer::zeRTASParallelOperationJoinExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = tracing_layer::zeRTASParallelOperationDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = tracing_layer::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnJoinExp = pDdiTable->pfnJoinExp; + pDdiTable->pfnJoinExp = tracing_layer::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = tracing_layer::zeRTASParallelOperationDestroyExp; + } return result; } @@ -7865,33 +7872,39 @@ zeGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = tracing_layer::zeDriverGet; - - dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; - pDdiTable->pfnGetApiVersion = tracing_layer::zeDriverGetApiVersion; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeDriverGetProperties; - - dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; - pDdiTable->pfnGetIpcProperties = tracing_layer::zeDriverGetIpcProperties; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = tracing_layer::zeDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; - - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; - pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = tracing_layer::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; + pDdiTable->pfnGetApiVersion = tracing_layer::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; + pDdiTable->pfnGetIpcProperties = tracing_layer::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = tracing_layer::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = tracing_layer::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; + pDdiTable->pfnGetLastErrorDescription = tracing_layer::zeDriverGetLastErrorDescription; + } return result; } @@ -7914,15 +7927,15 @@ zeGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; - pDdiTable->pfnRTASFormatCompatibilityCheckExp = tracing_layer::zeDriverRTASFormatCompatibilityCheckExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; + pDdiTable->pfnRTASFormatCompatibilityCheckExp = tracing_layer::zeDriverRTASFormatCompatibilityCheckExp; + } return result; } @@ -7945,75 +7958,95 @@ zeGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = tracing_layer::zeDeviceGet; - - dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; - pDdiTable->pfnGetSubDevices = tracing_layer::zeDeviceGetSubDevices; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeDeviceGetProperties; - - dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; - pDdiTable->pfnGetComputeProperties = tracing_layer::zeDeviceGetComputeProperties; - - dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; - pDdiTable->pfnGetModuleProperties = tracing_layer::zeDeviceGetModuleProperties; - - dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = tracing_layer::zeDeviceGetCommandQueueGroupProperties; - - dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; - pDdiTable->pfnGetMemoryProperties = tracing_layer::zeDeviceGetMemoryProperties; - - dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; - pDdiTable->pfnGetMemoryAccessProperties = tracing_layer::zeDeviceGetMemoryAccessProperties; - - dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; - pDdiTable->pfnGetCacheProperties = tracing_layer::zeDeviceGetCacheProperties; - - dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; - pDdiTable->pfnGetImageProperties = tracing_layer::zeDeviceGetImageProperties; - - dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; - pDdiTable->pfnGetExternalMemoryProperties = tracing_layer::zeDeviceGetExternalMemoryProperties; - - dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; - pDdiTable->pfnGetP2PProperties = tracing_layer::zeDeviceGetP2PProperties; - - dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; - pDdiTable->pfnCanAccessPeer = tracing_layer::zeDeviceCanAccessPeer; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = tracing_layer::zeDeviceGetStatus; - - dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; - pDdiTable->pfnGetGlobalTimestamps = tracing_layer::zeDeviceGetGlobalTimestamps; - - dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; - pDdiTable->pfnImportExternalSemaphoreExt = tracing_layer::zeDeviceImportExternalSemaphoreExt; - - dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; - - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; - pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; - - dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; - pDdiTable->pfnSetCacheAdviceExt = tracing_layer::zeDeviceSetCacheAdviceExt; - - dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; - pDdiTable->pfnPciGetPropertiesExt = tracing_layer::zeDevicePciGetPropertiesExt; - - dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; - pDdiTable->pfnGetRootDevice = tracing_layer::zeDeviceGetRootDevice; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = tracing_layer::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; + pDdiTable->pfnGetSubDevices = tracing_layer::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; + pDdiTable->pfnGetComputeProperties = tracing_layer::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; + pDdiTable->pfnGetModuleProperties = tracing_layer::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; + pDdiTable->pfnGetCommandQueueGroupProperties = tracing_layer::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; + pDdiTable->pfnGetMemoryProperties = tracing_layer::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; + pDdiTable->pfnGetMemoryAccessProperties = tracing_layer::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; + pDdiTable->pfnGetCacheProperties = tracing_layer::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; + pDdiTable->pfnGetImageProperties = tracing_layer::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; + pDdiTable->pfnGetExternalMemoryProperties = tracing_layer::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; + pDdiTable->pfnGetP2PProperties = tracing_layer::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; + pDdiTable->pfnCanAccessPeer = tracing_layer::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = tracing_layer::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; + pDdiTable->pfnGetGlobalTimestamps = tracing_layer::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; + pDdiTable->pfnImportExternalSemaphoreExt = tracing_layer::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; + pDdiTable->pfnReleaseExternalSemaphoreExt = tracing_layer::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; + pDdiTable->pfnReserveCacheExt = tracing_layer::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; + pDdiTable->pfnSetCacheAdviceExt = tracing_layer::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; + pDdiTable->pfnPciGetPropertiesExt = tracing_layer::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; + pDdiTable->pfnGetRootDevice = tracing_layer::zeDeviceGetRootDevice; + } return result; } @@ -8036,15 +8069,15 @@ zeGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; - pDdiTable->pfnGetFabricVertexExp = tracing_layer::zeDeviceGetFabricVertexExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; + pDdiTable->pfnGetFabricVertexExp = tracing_layer::zeDeviceGetFabricVertexExp; + } return result; } @@ -8067,39 +8100,47 @@ zeGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeContextCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeContextDestroy; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = tracing_layer::zeContextGetStatus; - - dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; - pDdiTable->pfnSystemBarrier = tracing_layer::zeContextSystemBarrier; - - dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; - pDdiTable->pfnMakeMemoryResident = tracing_layer::zeContextMakeMemoryResident; - - dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; - pDdiTable->pfnEvictMemory = tracing_layer::zeContextEvictMemory; - - dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; - pDdiTable->pfnMakeImageResident = tracing_layer::zeContextMakeImageResident; - - dditable.pfnEvictImage = pDdiTable->pfnEvictImage; - pDdiTable->pfnEvictImage = tracing_layer::zeContextEvictImage; - - dditable.pfnCreateEx = pDdiTable->pfnCreateEx; - pDdiTable->pfnCreateEx = tracing_layer::zeContextCreateEx; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = tracing_layer::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; + pDdiTable->pfnSystemBarrier = tracing_layer::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; + pDdiTable->pfnMakeMemoryResident = tracing_layer::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; + pDdiTable->pfnEvictMemory = tracing_layer::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; + pDdiTable->pfnMakeImageResident = tracing_layer::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictImage = pDdiTable->pfnEvictImage; + pDdiTable->pfnEvictImage = tracing_layer::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnCreateEx = pDdiTable->pfnCreateEx; + pDdiTable->pfnCreateEx = tracing_layer::zeContextCreateEx; + } return result; } @@ -8122,30 +8163,35 @@ zeGetCommandQueueProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeCommandQueueCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeCommandQueueDestroy; - - dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; - pDdiTable->pfnExecuteCommandLists = tracing_layer::zeCommandQueueExecuteCommandLists; - - dditable.pfnSynchronize = pDdiTable->pfnSynchronize; - pDdiTable->pfnSynchronize = tracing_layer::zeCommandQueueSynchronize; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; - - dditable.pfnGetIndex = pDdiTable->pfnGetIndex; - pDdiTable->pfnGetIndex = tracing_layer::zeCommandQueueGetIndex; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; + pDdiTable->pfnExecuteCommandLists = tracing_layer::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSynchronize = pDdiTable->pfnSynchronize; + pDdiTable->pfnSynchronize = tracing_layer::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetIndex = pDdiTable->pfnGetIndex; + pDdiTable->pfnGetIndex = tracing_layer::zeCommandQueueGetIndex; + } return result; } @@ -8168,120 +8214,155 @@ zeGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeCommandListCreate; - - dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; - pDdiTable->pfnCreateImmediate = tracing_layer::zeCommandListCreateImmediate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeCommandListDestroy; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = tracing_layer::zeCommandListClose; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = tracing_layer::zeCommandListReset; - - dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendWriteGlobalTimestamp = tracing_layer::zeCommandListAppendWriteGlobalTimestamp; - - dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; - pDdiTable->pfnAppendBarrier = tracing_layer::zeCommandListAppendBarrier; - - dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = tracing_layer::zeCommandListAppendMemoryRangesBarrier; - - dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; - pDdiTable->pfnAppendMemoryCopy = tracing_layer::zeCommandListAppendMemoryCopy; - - dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; - pDdiTable->pfnAppendMemoryFill = tracing_layer::zeCommandListAppendMemoryFill; - - dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyRegion = tracing_layer::zeCommandListAppendMemoryCopyRegion; - - dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; - pDdiTable->pfnAppendMemoryCopyFromContext = tracing_layer::zeCommandListAppendMemoryCopyFromContext; - - dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; - pDdiTable->pfnAppendImageCopy = tracing_layer::zeCommandListAppendImageCopy; - - dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyRegion = tracing_layer::zeCommandListAppendImageCopyRegion; - - dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyToMemory = tracing_layer::zeCommandListAppendImageCopyToMemory; - - dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; - pDdiTable->pfnAppendImageCopyFromMemory = tracing_layer::zeCommandListAppendImageCopyFromMemory; - - dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; - pDdiTable->pfnAppendMemoryPrefetch = tracing_layer::zeCommandListAppendMemoryPrefetch; - - dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; - pDdiTable->pfnAppendMemAdvise = tracing_layer::zeCommandListAppendMemAdvise; - - dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; - pDdiTable->pfnAppendSignalEvent = tracing_layer::zeCommandListAppendSignalEvent; - - dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; - pDdiTable->pfnAppendWaitOnEvents = tracing_layer::zeCommandListAppendWaitOnEvents; - - dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; - pDdiTable->pfnAppendEventReset = tracing_layer::zeCommandListAppendEventReset; - - dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; - pDdiTable->pfnAppendQueryKernelTimestamps = tracing_layer::zeCommandListAppendQueryKernelTimestamps; - - dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; - pDdiTable->pfnAppendLaunchKernel = tracing_layer::zeCommandListAppendLaunchKernel; - - dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = tracing_layer::zeCommandListAppendLaunchCooperativeKernel; - - dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchKernelIndirect = tracing_layer::zeCommandListAppendLaunchKernelIndirect; - - dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = tracing_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; - - dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = tracing_layer::zeCommandListAppendSignalExternalSemaphoreExt; - - dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = tracing_layer::zeCommandListAppendWaitExternalSemaphoreExt; - - dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; - - dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = tracing_layer::zeCommandListAppendImageCopyFromMemoryExt; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeCommandListHostSynchronize; - - dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; - pDdiTable->pfnGetDeviceHandle = tracing_layer::zeCommandListGetDeviceHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = tracing_layer::zeCommandListGetContextHandle; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandListGetOrdinal; - - dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; - pDdiTable->pfnImmediateGetIndex = tracing_layer::zeCommandListImmediateGetIndex; - - dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; - pDdiTable->pfnIsImmediate = tracing_layer::zeCommandListIsImmediate; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; + pDdiTable->pfnCreateImmediate = tracing_layer::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = tracing_layer::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = tracing_layer::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; + pDdiTable->pfnAppendWriteGlobalTimestamp = tracing_layer::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; + pDdiTable->pfnAppendBarrier = tracing_layer::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; + pDdiTable->pfnAppendMemoryRangesBarrier = tracing_layer::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; + pDdiTable->pfnAppendMemoryCopy = tracing_layer::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; + pDdiTable->pfnAppendMemoryFill = tracing_layer::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; + pDdiTable->pfnAppendMemoryCopyRegion = tracing_layer::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; + pDdiTable->pfnAppendMemoryCopyFromContext = tracing_layer::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; + pDdiTable->pfnAppendImageCopy = tracing_layer::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; + pDdiTable->pfnAppendImageCopyRegion = tracing_layer::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; + pDdiTable->pfnAppendImageCopyToMemory = tracing_layer::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; + pDdiTable->pfnAppendImageCopyFromMemory = tracing_layer::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; + pDdiTable->pfnAppendMemoryPrefetch = tracing_layer::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; + pDdiTable->pfnAppendMemAdvise = tracing_layer::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; + pDdiTable->pfnAppendSignalEvent = tracing_layer::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; + pDdiTable->pfnAppendWaitOnEvents = tracing_layer::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; + pDdiTable->pfnAppendEventReset = tracing_layer::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; + pDdiTable->pfnAppendQueryKernelTimestamps = tracing_layer::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; + pDdiTable->pfnAppendLaunchKernel = tracing_layer::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; + pDdiTable->pfnAppendLaunchCooperativeKernel = tracing_layer::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; + pDdiTable->pfnAppendLaunchKernelIndirect = tracing_layer::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = tracing_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; + pDdiTable->pfnAppendSignalExternalSemaphoreExt = tracing_layer::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; + pDdiTable->pfnAppendWaitExternalSemaphoreExt = tracing_layer::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; + pDdiTable->pfnAppendImageCopyToMemoryExt = tracing_layer::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; + pDdiTable->pfnAppendImageCopyFromMemoryExt = tracing_layer::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = tracing_layer::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = tracing_layer::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = tracing_layer::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; + pDdiTable->pfnImmediateGetIndex = tracing_layer::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; + pDdiTable->pfnIsImmediate = tracing_layer::zeCommandListIsImmediate; + } return result; } @@ -8304,36 +8385,43 @@ zeGetCommandListExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; - pDdiTable->pfnGetNextCommandIdWithKernelsExp = tracing_layer::zeCommandListGetNextCommandIdWithKernelsExp; - - dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = tracing_layer::zeCommandListUpdateMutableCommandKernelsExp; - - dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; - pDdiTable->pfnCreateCloneExp = tracing_layer::zeCommandListCreateCloneExp; - - dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; - pDdiTable->pfnImmediateAppendCommandListsExp = tracing_layer::zeCommandListImmediateAppendCommandListsExp; - - dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; - pDdiTable->pfnGetNextCommandIdExp = tracing_layer::zeCommandListGetNextCommandIdExp; - - dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandsExp = tracing_layer::zeCommandListUpdateMutableCommandsExp; - - dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = tracing_layer::zeCommandListUpdateMutableCommandSignalEventExp; - - dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = tracing_layer::zeCommandListUpdateMutableCommandWaitEventsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; + pDdiTable->pfnGetNextCommandIdWithKernelsExp = tracing_layer::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; + pDdiTable->pfnUpdateMutableCommandKernelsExp = tracing_layer::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; + pDdiTable->pfnCreateCloneExp = tracing_layer::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; + pDdiTable->pfnImmediateAppendCommandListsExp = tracing_layer::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; + pDdiTable->pfnGetNextCommandIdExp = tracing_layer::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; + pDdiTable->pfnUpdateMutableCommandsExp = tracing_layer::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; + pDdiTable->pfnUpdateMutableCommandSignalEventExp = tracing_layer::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = tracing_layer::zeCommandListUpdateMutableCommandWaitEventsExp; + } return result; } @@ -8356,45 +8444,55 @@ zeGetEventProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeEventCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeEventDestroy; - - dditable.pfnHostSignal = pDdiTable->pfnHostSignal; - pDdiTable->pfnHostSignal = tracing_layer::zeEventHostSignal; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeEventHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = tracing_layer::zeEventQueryStatus; - - dditable.pfnHostReset = pDdiTable->pfnHostReset; - pDdiTable->pfnHostReset = tracing_layer::zeEventHostReset; - - dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestamp = tracing_layer::zeEventQueryKernelTimestamp; - - dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; - pDdiTable->pfnQueryKernelTimestampsExt = tracing_layer::zeEventQueryKernelTimestampsExt; - - dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; - pDdiTable->pfnGetEventPool = tracing_layer::zeEventGetEventPool; - - dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; - pDdiTable->pfnGetSignalScope = tracing_layer::zeEventGetSignalScope; - - dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; - pDdiTable->pfnGetWaitScope = tracing_layer::zeEventGetWaitScope; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSignal = pDdiTable->pfnHostSignal; + pDdiTable->pfnHostSignal = tracing_layer::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = tracing_layer::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostReset = pDdiTable->pfnHostReset; + pDdiTable->pfnHostReset = tracing_layer::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; + pDdiTable->pfnQueryKernelTimestamp = tracing_layer::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; + pDdiTable->pfnQueryKernelTimestampsExt = tracing_layer::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; + pDdiTable->pfnGetEventPool = tracing_layer::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; + pDdiTable->pfnGetSignalScope = tracing_layer::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; + pDdiTable->pfnGetWaitScope = tracing_layer::zeEventGetWaitScope; + } return result; } @@ -8417,15 +8515,15 @@ zeGetEventExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; - pDdiTable->pfnQueryTimestampsExp = tracing_layer::zeEventQueryTimestampsExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; + pDdiTable->pfnQueryTimestampsExp = tracing_layer::zeEventQueryTimestampsExp; + } return result; } @@ -8448,36 +8546,43 @@ zeGetEventPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeEventPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeEventPoolDestroy; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = tracing_layer::zeEventPoolGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = tracing_layer::zeEventPoolOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = tracing_layer::zeEventPoolCloseIpcHandle; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = tracing_layer::zeEventPoolPutIpcHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = tracing_layer::zeEventPoolGetContextHandle; - - dditable.pfnGetFlags = pDdiTable->pfnGetFlags; - pDdiTable->pfnGetFlags = tracing_layer::zeEventPoolGetFlags; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = tracing_layer::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = tracing_layer::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = tracing_layer::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = tracing_layer::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = tracing_layer::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = tracing_layer::zeEventPoolGetFlags; + } return result; } @@ -8500,27 +8605,31 @@ zeGetFenceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeFenceCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeFenceDestroy; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = tracing_layer::zeFenceHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = tracing_layer::zeFenceQueryStatus; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = tracing_layer::zeFenceReset; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = tracing_layer::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = tracing_layer::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = tracing_layer::zeFenceReset; + } return result; } @@ -8543,27 +8652,31 @@ zeGetImageProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeImageGetProperties; - - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeImageCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeImageDestroy; - - dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; - pDdiTable->pfnGetAllocPropertiesExt = tracing_layer::zeImageGetAllocPropertiesExt; - - dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; - pDdiTable->pfnViewCreateExt = tracing_layer::zeImageViewCreateExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; + pDdiTable->pfnGetAllocPropertiesExt = tracing_layer::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; + pDdiTable->pfnViewCreateExt = tracing_layer::zeImageViewCreateExt; + } return result; } @@ -8586,21 +8699,23 @@ zeGetImageExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; - pDdiTable->pfnGetMemoryPropertiesExp = tracing_layer::zeImageGetMemoryPropertiesExp; - - dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; - pDdiTable->pfnViewCreateExp = tracing_layer::zeImageViewCreateExp; - - dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; - pDdiTable->pfnGetDeviceOffsetExp = tracing_layer::zeImageGetDeviceOffsetExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; + pDdiTable->pfnGetMemoryPropertiesExp = tracing_layer::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; + pDdiTable->pfnViewCreateExp = tracing_layer::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; + pDdiTable->pfnGetDeviceOffsetExp = tracing_layer::zeImageGetDeviceOffsetExp; + } return result; } @@ -8623,48 +8738,59 @@ zeGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeKernelCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeKernelDestroy; - - dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; - pDdiTable->pfnSetCacheConfig = tracing_layer::zeKernelSetCacheConfig; - - dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; - pDdiTable->pfnSetGroupSize = tracing_layer::zeKernelSetGroupSize; - - dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; - pDdiTable->pfnSuggestGroupSize = tracing_layer::zeKernelSuggestGroupSize; - - dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = tracing_layer::zeKernelSuggestMaxCooperativeGroupCount; - - dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; - pDdiTable->pfnSetArgumentValue = tracing_layer::zeKernelSetArgumentValue; - - dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; - pDdiTable->pfnSetIndirectAccess = tracing_layer::zeKernelSetIndirectAccess; - - dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = tracing_layer::zeKernelGetIndirectAccess; - - dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; - pDdiTable->pfnGetSourceAttributes = tracing_layer::zeKernelGetSourceAttributes; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeKernelGetProperties; - - dditable.pfnGetName = pDdiTable->pfnGetName; - pDdiTable->pfnGetName = tracing_layer::zeKernelGetName; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; + pDdiTable->pfnSetCacheConfig = tracing_layer::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; + pDdiTable->pfnSetGroupSize = tracing_layer::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; + pDdiTable->pfnSuggestGroupSize = tracing_layer::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; + pDdiTable->pfnSuggestMaxCooperativeGroupCount = tracing_layer::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; + pDdiTable->pfnSetArgumentValue = tracing_layer::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; + pDdiTable->pfnSetIndirectAccess = tracing_layer::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; + pDdiTable->pfnGetIndirectAccess = tracing_layer::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; + pDdiTable->pfnGetSourceAttributes = tracing_layer::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetName = pDdiTable->pfnGetName; + pDdiTable->pfnGetName = tracing_layer::zeKernelGetName; + } return result; } @@ -8687,21 +8813,23 @@ zeGetKernelExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; - pDdiTable->pfnSetGlobalOffsetExp = tracing_layer::zeKernelSetGlobalOffsetExp; - - dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; - pDdiTable->pfnGetBinaryExp = tracing_layer::zeKernelGetBinaryExp; - - dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; - pDdiTable->pfnSchedulingHintExp = tracing_layer::zeKernelSchedulingHintExp; - + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; + pDdiTable->pfnSetGlobalOffsetExp = tracing_layer::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; + pDdiTable->pfnGetBinaryExp = tracing_layer::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; + pDdiTable->pfnSchedulingHintExp = tracing_layer::zeKernelSchedulingHintExp; + } return result; } @@ -8724,48 +8852,59 @@ zeGetMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAllocShared = pDdiTable->pfnAllocShared; - pDdiTable->pfnAllocShared = tracing_layer::zeMemAllocShared; - - dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; - pDdiTable->pfnAllocDevice = tracing_layer::zeMemAllocDevice; - - dditable.pfnAllocHost = pDdiTable->pfnAllocHost; - pDdiTable->pfnAllocHost = tracing_layer::zeMemAllocHost; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = tracing_layer::zeMemFree; - - dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; - pDdiTable->pfnGetAllocProperties = tracing_layer::zeMemGetAllocProperties; - - dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; - pDdiTable->pfnGetAddressRange = tracing_layer::zeMemGetAddressRange; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = tracing_layer::zeMemGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = tracing_layer::zeMemOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = tracing_layer::zeMemCloseIpcHandle; - - dditable.pfnFreeExt = pDdiTable->pfnFreeExt; - pDdiTable->pfnFreeExt = tracing_layer::zeMemFreeExt; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = tracing_layer::zeMemPutIpcHandle; - - dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; - pDdiTable->pfnGetPitchFor2dImage = tracing_layer::zeMemGetPitchFor2dImage; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocShared = pDdiTable->pfnAllocShared; + pDdiTable->pfnAllocShared = tracing_layer::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; + pDdiTable->pfnAllocDevice = tracing_layer::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocHost = pDdiTable->pfnAllocHost; + pDdiTable->pfnAllocHost = tracing_layer::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = tracing_layer::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; + pDdiTable->pfnGetAllocProperties = tracing_layer::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; + pDdiTable->pfnGetAddressRange = tracing_layer::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = tracing_layer::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = tracing_layer::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = tracing_layer::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnFreeExt = pDdiTable->pfnFreeExt; + pDdiTable->pfnFreeExt = tracing_layer::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = tracing_layer::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; + pDdiTable->pfnGetPitchFor2dImage = tracing_layer::zeMemGetPitchFor2dImage; + } return result; } @@ -8788,24 +8927,27 @@ zeGetMemExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = tracing_layer::zeMemGetIpcHandleFromFileDescriptorExp; - - dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = tracing_layer::zeMemGetFileDescriptorFromIpcHandleExp; - - dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = tracing_layer::zeMemSetAtomicAccessAttributeExp; - - dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = tracing_layer::zeMemGetAtomicAccessAttributeExp; - + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = tracing_layer::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = tracing_layer::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; + pDdiTable->pfnSetAtomicAccessAttributeExp = tracing_layer::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; + pDdiTable->pfnGetAtomicAccessAttributeExp = tracing_layer::zeMemGetAtomicAccessAttributeExp; + } return result; } @@ -8828,39 +8970,47 @@ zeGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeModuleCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeModuleDestroy; - - dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; - pDdiTable->pfnDynamicLink = tracing_layer::zeModuleDynamicLink; - - dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; - pDdiTable->pfnGetNativeBinary = tracing_layer::zeModuleGetNativeBinary; - - dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; - pDdiTable->pfnGetGlobalPointer = tracing_layer::zeModuleGetGlobalPointer; - - dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; - pDdiTable->pfnGetKernelNames = tracing_layer::zeModuleGetKernelNames; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = tracing_layer::zeModuleGetProperties; - - dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; - pDdiTable->pfnGetFunctionPointer = tracing_layer::zeModuleGetFunctionPointer; - - dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; - pDdiTable->pfnInspectLinkageExt = tracing_layer::zeModuleInspectLinkageExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; + pDdiTable->pfnDynamicLink = tracing_layer::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; + pDdiTable->pfnGetNativeBinary = tracing_layer::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; + pDdiTable->pfnGetGlobalPointer = tracing_layer::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; + pDdiTable->pfnGetKernelNames = tracing_layer::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = tracing_layer::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; + pDdiTable->pfnGetFunctionPointer = tracing_layer::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; + pDdiTable->pfnInspectLinkageExt = tracing_layer::zeModuleInspectLinkageExt; + } return result; } @@ -8883,18 +9033,19 @@ zeGetModuleBuildLogProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeModuleBuildLogDestroy; - - dditable.pfnGetString = pDdiTable->pfnGetString; - pDdiTable->pfnGetString = tracing_layer::zeModuleBuildLogGetString; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetString = pDdiTable->pfnGetString; + pDdiTable->pfnGetString = tracing_layer::zeModuleBuildLogGetString; + } return result; } @@ -8917,18 +9068,19 @@ zeGetPhysicalMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zePhysicalMemCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zePhysicalMemDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zePhysicalMemDestroy; + } return result; } @@ -8951,18 +9103,19 @@ zeGetSamplerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = tracing_layer::zeSamplerCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = tracing_layer::zeSamplerDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = tracing_layer::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = tracing_layer::zeSamplerDestroy; + } return result; } @@ -8985,33 +9138,39 @@ zeGetVirtualMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnReserve = pDdiTable->pfnReserve; - pDdiTable->pfnReserve = tracing_layer::zeVirtualMemReserve; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = tracing_layer::zeVirtualMemFree; - - dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; - pDdiTable->pfnQueryPageSize = tracing_layer::zeVirtualMemQueryPageSize; - - dditable.pfnMap = pDdiTable->pfnMap; - pDdiTable->pfnMap = tracing_layer::zeVirtualMemMap; - - dditable.pfnUnmap = pDdiTable->pfnUnmap; - pDdiTable->pfnUnmap = tracing_layer::zeVirtualMemUnmap; - - dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; - pDdiTable->pfnSetAccessAttribute = tracing_layer::zeVirtualMemSetAccessAttribute; - - dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = tracing_layer::zeVirtualMemGetAccessAttribute; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReserve = pDdiTable->pfnReserve; + pDdiTable->pfnReserve = tracing_layer::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = tracing_layer::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; + pDdiTable->pfnQueryPageSize = tracing_layer::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMap = pDdiTable->pfnMap; + pDdiTable->pfnMap = tracing_layer::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnUnmap = pDdiTable->pfnUnmap; + pDdiTable->pfnUnmap = tracing_layer::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; + pDdiTable->pfnSetAccessAttribute = tracing_layer::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; + pDdiTable->pfnGetAccessAttribute = tracing_layer::zeVirtualMemGetAccessAttribute; + } return result; } @@ -9034,21 +9193,23 @@ zeGetFabricEdgeExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = tracing_layer::zeFabricEdgeGetExp; - - dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; - pDdiTable->pfnGetVerticesExp = tracing_layer::zeFabricEdgeGetVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricEdgeGetPropertiesExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = tracing_layer::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; + pDdiTable->pfnGetVerticesExp = tracing_layer::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricEdgeGetPropertiesExp; + } return result; } @@ -9071,24 +9232,27 @@ zeGetFabricVertexExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(tracing_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(tracing_layer::context.version) > ZE_MINOR_VERSION(version)) + if (tracing_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = tracing_layer::zeFabricVertexGetExp; - - dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; - pDdiTable->pfnGetSubVerticesExp = tracing_layer::zeFabricVertexGetSubVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricVertexGetPropertiesExp; - - dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; - pDdiTable->pfnGetDeviceExp = tracing_layer::zeFabricVertexGetDeviceExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = tracing_layer::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; + pDdiTable->pfnGetSubVerticesExp = tracing_layer::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = tracing_layer::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; + pDdiTable->pfnGetDeviceExp = tracing_layer::zeFabricVertexGetDeviceExp; + } return result; } diff --git a/source/layers/validation/ze_valddi.cpp b/source/layers/validation/ze_valddi.cpp index 2a618cb8..6a36d69e 100644 --- a/source/layers/validation/ze_valddi.cpp +++ b/source/layers/validation/ze_valddi.cpp @@ -8925,18 +8925,19 @@ zeGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = validation_layer::zeInit; - - dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; - pDdiTable->pfnInitDrivers = validation_layer::zeInitDrivers; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = validation_layer::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnInitDrivers = pDdiTable->pfnInitDrivers; + pDdiTable->pfnInitDrivers = validation_layer::zeInitDrivers; + } return result; } @@ -8959,24 +8960,27 @@ zeGetRTASBuilderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zeRTASBuilderCreateExp; - - dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; - pDdiTable->pfnGetBuildPropertiesExp = validation_layer::zeRTASBuilderGetBuildPropertiesExp; - - dditable.pfnBuildExp = pDdiTable->pfnBuildExp; - pDdiTable->pfnBuildExp = validation_layer::zeRTASBuilderBuildExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zeRTASBuilderDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetBuildPropertiesExp = pDdiTable->pfnGetBuildPropertiesExp; + pDdiTable->pfnGetBuildPropertiesExp = validation_layer::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnBuildExp = pDdiTable->pfnBuildExp; + pDdiTable->pfnBuildExp = validation_layer::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zeRTASBuilderDestroyExp; + } return result; } @@ -8999,24 +9003,27 @@ zeGetRTASParallelOperationExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zeRTASParallelOperationCreateExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeRTASParallelOperationGetPropertiesExp; - - dditable.pfnJoinExp = pDdiTable->pfnJoinExp; - pDdiTable->pfnJoinExp = validation_layer::zeRTASParallelOperationJoinExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zeRTASParallelOperationDestroyExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnJoinExp = pDdiTable->pfnJoinExp; + pDdiTable->pfnJoinExp = validation_layer::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zeRTASParallelOperationDestroyExp; + } return result; } @@ -9039,33 +9046,39 @@ zeGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zeDriverGet; - - dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; - pDdiTable->pfnGetApiVersion = validation_layer::zeDriverGetApiVersion; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeDriverGetProperties; - - dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; - pDdiTable->pfnGetIpcProperties = validation_layer::zeDriverGetIpcProperties; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = validation_layer::zeDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; - - dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; - pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetApiVersion = pDdiTable->pfnGetApiVersion; + pDdiTable->pfnGetApiVersion = validation_layer::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcProperties = pDdiTable->pfnGetIpcProperties; + pDdiTable->pfnGetIpcProperties = validation_layer::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = validation_layer::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetLastErrorDescription = pDdiTable->pfnGetLastErrorDescription; + pDdiTable->pfnGetLastErrorDescription = validation_layer::zeDriverGetLastErrorDescription; + } return result; } @@ -9088,15 +9101,15 @@ zeGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; - pDdiTable->pfnRTASFormatCompatibilityCheckExp = validation_layer::zeDriverRTASFormatCompatibilityCheckExp; - + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnRTASFormatCompatibilityCheckExp = pDdiTable->pfnRTASFormatCompatibilityCheckExp; + pDdiTable->pfnRTASFormatCompatibilityCheckExp = validation_layer::zeDriverRTASFormatCompatibilityCheckExp; + } return result; } @@ -9119,75 +9132,95 @@ zeGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zeDeviceGet; - - dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; - pDdiTable->pfnGetSubDevices = validation_layer::zeDeviceGetSubDevices; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeDeviceGetProperties; - - dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; - pDdiTable->pfnGetComputeProperties = validation_layer::zeDeviceGetComputeProperties; - - dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; - pDdiTable->pfnGetModuleProperties = validation_layer::zeDeviceGetModuleProperties; - - dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = validation_layer::zeDeviceGetCommandQueueGroupProperties; - - dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; - pDdiTable->pfnGetMemoryProperties = validation_layer::zeDeviceGetMemoryProperties; - - dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; - pDdiTable->pfnGetMemoryAccessProperties = validation_layer::zeDeviceGetMemoryAccessProperties; - - dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; - pDdiTable->pfnGetCacheProperties = validation_layer::zeDeviceGetCacheProperties; - - dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; - pDdiTable->pfnGetImageProperties = validation_layer::zeDeviceGetImageProperties; - - dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; - pDdiTable->pfnGetExternalMemoryProperties = validation_layer::zeDeviceGetExternalMemoryProperties; - - dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; - pDdiTable->pfnGetP2PProperties = validation_layer::zeDeviceGetP2PProperties; - - dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; - pDdiTable->pfnCanAccessPeer = validation_layer::zeDeviceCanAccessPeer; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = validation_layer::zeDeviceGetStatus; - - dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; - pDdiTable->pfnGetGlobalTimestamps = validation_layer::zeDeviceGetGlobalTimestamps; - - dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; - pDdiTable->pfnImportExternalSemaphoreExt = validation_layer::zeDeviceImportExternalSemaphoreExt; - - dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; - - dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; - pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; - - dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; - pDdiTable->pfnSetCacheAdviceExt = validation_layer::zeDeviceSetCacheAdviceExt; - - dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; - pDdiTable->pfnPciGetPropertiesExt = validation_layer::zeDevicePciGetPropertiesExt; - - dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; - pDdiTable->pfnGetRootDevice = validation_layer::zeDeviceGetRootDevice; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSubDevices = pDdiTable->pfnGetSubDevices; + pDdiTable->pfnGetSubDevices = validation_layer::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetComputeProperties = pDdiTable->pfnGetComputeProperties; + pDdiTable->pfnGetComputeProperties = validation_layer::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetModuleProperties = pDdiTable->pfnGetModuleProperties; + pDdiTable->pfnGetModuleProperties = validation_layer::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCommandQueueGroupProperties = pDdiTable->pfnGetCommandQueueGroupProperties; + pDdiTable->pfnGetCommandQueueGroupProperties = validation_layer::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryProperties = pDdiTable->pfnGetMemoryProperties; + pDdiTable->pfnGetMemoryProperties = validation_layer::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMemoryAccessProperties = pDdiTable->pfnGetMemoryAccessProperties; + pDdiTable->pfnGetMemoryAccessProperties = validation_layer::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCacheProperties = pDdiTable->pfnGetCacheProperties; + pDdiTable->pfnGetCacheProperties = validation_layer::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetImageProperties = pDdiTable->pfnGetImageProperties; + pDdiTable->pfnGetImageProperties = validation_layer::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetExternalMemoryProperties = pDdiTable->pfnGetExternalMemoryProperties; + pDdiTable->pfnGetExternalMemoryProperties = validation_layer::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetP2PProperties = pDdiTable->pfnGetP2PProperties; + pDdiTable->pfnGetP2PProperties = validation_layer::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCanAccessPeer = pDdiTable->pfnCanAccessPeer; + pDdiTable->pfnCanAccessPeer = validation_layer::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = validation_layer::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnGetGlobalTimestamps = pDdiTable->pfnGetGlobalTimestamps; + pDdiTable->pfnGetGlobalTimestamps = validation_layer::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnImportExternalSemaphoreExt = pDdiTable->pfnImportExternalSemaphoreExt; + pDdiTable->pfnImportExternalSemaphoreExt = validation_layer::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnReleaseExternalSemaphoreExt = pDdiTable->pfnReleaseExternalSemaphoreExt; + pDdiTable->pfnReleaseExternalSemaphoreExt = validation_layer::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnReserveCacheExt = pDdiTable->pfnReserveCacheExt; + pDdiTable->pfnReserveCacheExt = validation_layer::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSetCacheAdviceExt = pDdiTable->pfnSetCacheAdviceExt; + pDdiTable->pfnSetCacheAdviceExt = validation_layer::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnPciGetPropertiesExt = pDdiTable->pfnPciGetPropertiesExt; + pDdiTable->pfnPciGetPropertiesExt = validation_layer::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetRootDevice = pDdiTable->pfnGetRootDevice; + pDdiTable->pfnGetRootDevice = validation_layer::zeDeviceGetRootDevice; + } return result; } @@ -9210,15 +9243,15 @@ zeGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; - pDdiTable->pfnGetFabricVertexExp = validation_layer::zeDeviceGetFabricVertexExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetFabricVertexExp = pDdiTable->pfnGetFabricVertexExp; + pDdiTable->pfnGetFabricVertexExp = validation_layer::zeDeviceGetFabricVertexExp; + } return result; } @@ -9241,39 +9274,47 @@ zeGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeContextCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeContextDestroy; - - dditable.pfnGetStatus = pDdiTable->pfnGetStatus; - pDdiTable->pfnGetStatus = validation_layer::zeContextGetStatus; - - dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; - pDdiTable->pfnSystemBarrier = validation_layer::zeContextSystemBarrier; - - dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; - pDdiTable->pfnMakeMemoryResident = validation_layer::zeContextMakeMemoryResident; - - dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; - pDdiTable->pfnEvictMemory = validation_layer::zeContextEvictMemory; - - dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; - pDdiTable->pfnMakeImageResident = validation_layer::zeContextMakeImageResident; - - dditable.pfnEvictImage = pDdiTable->pfnEvictImage; - pDdiTable->pfnEvictImage = validation_layer::zeContextEvictImage; - - dditable.pfnCreateEx = pDdiTable->pfnCreateEx; - pDdiTable->pfnCreateEx = validation_layer::zeContextCreateEx; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStatus = pDdiTable->pfnGetStatus; + pDdiTable->pfnGetStatus = validation_layer::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSystemBarrier = pDdiTable->pfnSystemBarrier; + pDdiTable->pfnSystemBarrier = validation_layer::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeMemoryResident = pDdiTable->pfnMakeMemoryResident; + pDdiTable->pfnMakeMemoryResident = validation_layer::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictMemory = pDdiTable->pfnEvictMemory; + pDdiTable->pfnEvictMemory = validation_layer::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMakeImageResident = pDdiTable->pfnMakeImageResident; + pDdiTable->pfnMakeImageResident = validation_layer::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEvictImage = pDdiTable->pfnEvictImage; + pDdiTable->pfnEvictImage = validation_layer::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnCreateEx = pDdiTable->pfnCreateEx; + pDdiTable->pfnCreateEx = validation_layer::zeContextCreateEx; + } return result; } @@ -9296,30 +9337,35 @@ zeGetCommandQueueProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeCommandQueueCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeCommandQueueDestroy; - - dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; - pDdiTable->pfnExecuteCommandLists = validation_layer::zeCommandQueueExecuteCommandLists; - - dditable.pfnSynchronize = pDdiTable->pfnSynchronize; - pDdiTable->pfnSynchronize = validation_layer::zeCommandQueueSynchronize; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; - - dditable.pfnGetIndex = pDdiTable->pfnGetIndex; - pDdiTable->pfnGetIndex = validation_layer::zeCommandQueueGetIndex; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnExecuteCommandLists = pDdiTable->pfnExecuteCommandLists; + pDdiTable->pfnExecuteCommandLists = validation_layer::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSynchronize = pDdiTable->pfnSynchronize; + pDdiTable->pfnSynchronize = validation_layer::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = validation_layer::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetIndex = pDdiTable->pfnGetIndex; + pDdiTable->pfnGetIndex = validation_layer::zeCommandQueueGetIndex; + } return result; } @@ -9342,120 +9388,155 @@ zeGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeCommandListCreate; - - dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; - pDdiTable->pfnCreateImmediate = validation_layer::zeCommandListCreateImmediate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeCommandListDestroy; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = validation_layer::zeCommandListClose; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zeCommandListReset; - - dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendWriteGlobalTimestamp = validation_layer::zeCommandListAppendWriteGlobalTimestamp; - - dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; - pDdiTable->pfnAppendBarrier = validation_layer::zeCommandListAppendBarrier; - - dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = validation_layer::zeCommandListAppendMemoryRangesBarrier; - - dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; - pDdiTable->pfnAppendMemoryCopy = validation_layer::zeCommandListAppendMemoryCopy; - - dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; - pDdiTable->pfnAppendMemoryFill = validation_layer::zeCommandListAppendMemoryFill; - - dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyRegion = validation_layer::zeCommandListAppendMemoryCopyRegion; - - dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; - pDdiTable->pfnAppendMemoryCopyFromContext = validation_layer::zeCommandListAppendMemoryCopyFromContext; - - dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; - pDdiTable->pfnAppendImageCopy = validation_layer::zeCommandListAppendImageCopy; - - dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyRegion = validation_layer::zeCommandListAppendImageCopyRegion; - - dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyToMemory = validation_layer::zeCommandListAppendImageCopyToMemory; - - dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; - pDdiTable->pfnAppendImageCopyFromMemory = validation_layer::zeCommandListAppendImageCopyFromMemory; - - dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; - pDdiTable->pfnAppendMemoryPrefetch = validation_layer::zeCommandListAppendMemoryPrefetch; - - dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; - pDdiTable->pfnAppendMemAdvise = validation_layer::zeCommandListAppendMemAdvise; - - dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; - pDdiTable->pfnAppendSignalEvent = validation_layer::zeCommandListAppendSignalEvent; - - dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; - pDdiTable->pfnAppendWaitOnEvents = validation_layer::zeCommandListAppendWaitOnEvents; - - dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; - pDdiTable->pfnAppendEventReset = validation_layer::zeCommandListAppendEventReset; - - dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; - pDdiTable->pfnAppendQueryKernelTimestamps = validation_layer::zeCommandListAppendQueryKernelTimestamps; - - dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; - pDdiTable->pfnAppendLaunchKernel = validation_layer::zeCommandListAppendLaunchKernel; - - dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = validation_layer::zeCommandListAppendLaunchCooperativeKernel; - - dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchKernelIndirect = validation_layer::zeCommandListAppendLaunchKernelIndirect; - - dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = validation_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; - - dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = validation_layer::zeCommandListAppendSignalExternalSemaphoreExt; - - dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = validation_layer::zeCommandListAppendWaitExternalSemaphoreExt; - - dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; - - dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = validation_layer::zeCommandListAppendImageCopyFromMemoryExt; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeCommandListHostSynchronize; - - dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; - pDdiTable->pfnGetDeviceHandle = validation_layer::zeCommandListGetDeviceHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = validation_layer::zeCommandListGetContextHandle; - - dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; - pDdiTable->pfnGetOrdinal = validation_layer::zeCommandListGetOrdinal; - - dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; - pDdiTable->pfnImmediateGetIndex = validation_layer::zeCommandListImmediateGetIndex; - - dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; - pDdiTable->pfnIsImmediate = validation_layer::zeCommandListIsImmediate; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreateImmediate = pDdiTable->pfnCreateImmediate; + pDdiTable->pfnCreateImmediate = validation_layer::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = validation_layer::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWriteGlobalTimestamp = pDdiTable->pfnAppendWriteGlobalTimestamp; + pDdiTable->pfnAppendWriteGlobalTimestamp = validation_layer::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendBarrier = pDdiTable->pfnAppendBarrier; + pDdiTable->pfnAppendBarrier = validation_layer::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryRangesBarrier = pDdiTable->pfnAppendMemoryRangesBarrier; + pDdiTable->pfnAppendMemoryRangesBarrier = validation_layer::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopy = pDdiTable->pfnAppendMemoryCopy; + pDdiTable->pfnAppendMemoryCopy = validation_layer::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryFill = pDdiTable->pfnAppendMemoryFill; + pDdiTable->pfnAppendMemoryFill = validation_layer::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyRegion = pDdiTable->pfnAppendMemoryCopyRegion; + pDdiTable->pfnAppendMemoryCopyRegion = validation_layer::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryCopyFromContext = pDdiTable->pfnAppendMemoryCopyFromContext; + pDdiTable->pfnAppendMemoryCopyFromContext = validation_layer::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopy = pDdiTable->pfnAppendImageCopy; + pDdiTable->pfnAppendImageCopy = validation_layer::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyRegion = pDdiTable->pfnAppendImageCopyRegion; + pDdiTable->pfnAppendImageCopyRegion = validation_layer::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyToMemory = pDdiTable->pfnAppendImageCopyToMemory; + pDdiTable->pfnAppendImageCopyToMemory = validation_layer::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendImageCopyFromMemory = pDdiTable->pfnAppendImageCopyFromMemory; + pDdiTable->pfnAppendImageCopyFromMemory = validation_layer::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemoryPrefetch = pDdiTable->pfnAppendMemoryPrefetch; + pDdiTable->pfnAppendMemoryPrefetch = validation_layer::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMemAdvise = pDdiTable->pfnAppendMemAdvise; + pDdiTable->pfnAppendMemAdvise = validation_layer::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendSignalEvent = pDdiTable->pfnAppendSignalEvent; + pDdiTable->pfnAppendSignalEvent = validation_layer::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendWaitOnEvents = pDdiTable->pfnAppendWaitOnEvents; + pDdiTable->pfnAppendWaitOnEvents = validation_layer::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendEventReset = pDdiTable->pfnAppendEventReset; + pDdiTable->pfnAppendEventReset = validation_layer::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendQueryKernelTimestamps = pDdiTable->pfnAppendQueryKernelTimestamps; + pDdiTable->pfnAppendQueryKernelTimestamps = validation_layer::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernel = pDdiTable->pfnAppendLaunchKernel; + pDdiTable->pfnAppendLaunchKernel = validation_layer::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchCooperativeKernel = pDdiTable->pfnAppendLaunchCooperativeKernel; + pDdiTable->pfnAppendLaunchCooperativeKernel = validation_layer::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchKernelIndirect = pDdiTable->pfnAppendLaunchKernelIndirect; + pDdiTable->pfnAppendLaunchKernelIndirect = validation_layer::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendLaunchMultipleKernelsIndirect = pDdiTable->pfnAppendLaunchMultipleKernelsIndirect; + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = validation_layer::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendSignalExternalSemaphoreExt = pDdiTable->pfnAppendSignalExternalSemaphoreExt; + pDdiTable->pfnAppendSignalExternalSemaphoreExt = validation_layer::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnAppendWaitExternalSemaphoreExt = pDdiTable->pfnAppendWaitExternalSemaphoreExt; + pDdiTable->pfnAppendWaitExternalSemaphoreExt = validation_layer::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyToMemoryExt = pDdiTable->pfnAppendImageCopyToMemoryExt; + pDdiTable->pfnAppendImageCopyToMemoryExt = validation_layer::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnAppendImageCopyFromMemoryExt = pDdiTable->pfnAppendImageCopyFromMemoryExt; + pDdiTable->pfnAppendImageCopyFromMemoryExt = validation_layer::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceHandle = pDdiTable->pfnGetDeviceHandle; + pDdiTable->pfnGetDeviceHandle = validation_layer::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = validation_layer::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetOrdinal = pDdiTable->pfnGetOrdinal; + pDdiTable->pfnGetOrdinal = validation_layer::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateGetIndex = pDdiTable->pfnImmediateGetIndex; + pDdiTable->pfnImmediateGetIndex = validation_layer::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnIsImmediate = pDdiTable->pfnIsImmediate; + pDdiTable->pfnIsImmediate = validation_layer::zeCommandListIsImmediate; + } return result; } @@ -9478,36 +9559,43 @@ zeGetCommandListExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; - pDdiTable->pfnGetNextCommandIdWithKernelsExp = validation_layer::zeCommandListGetNextCommandIdWithKernelsExp; - - dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = validation_layer::zeCommandListUpdateMutableCommandKernelsExp; - - dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; - pDdiTable->pfnCreateCloneExp = validation_layer::zeCommandListCreateCloneExp; - - dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; - pDdiTable->pfnImmediateAppendCommandListsExp = validation_layer::zeCommandListImmediateAppendCommandListsExp; - - dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; - pDdiTable->pfnGetNextCommandIdExp = validation_layer::zeCommandListGetNextCommandIdExp; - - dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandsExp = validation_layer::zeCommandListUpdateMutableCommandsExp; - - dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = validation_layer::zeCommandListUpdateMutableCommandSignalEventExp; - - dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = validation_layer::zeCommandListUpdateMutableCommandWaitEventsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetNextCommandIdWithKernelsExp = pDdiTable->pfnGetNextCommandIdWithKernelsExp; + pDdiTable->pfnGetNextCommandIdWithKernelsExp = validation_layer::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnUpdateMutableCommandKernelsExp = pDdiTable->pfnUpdateMutableCommandKernelsExp; + pDdiTable->pfnUpdateMutableCommandKernelsExp = validation_layer::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateCloneExp = pDdiTable->pfnCreateCloneExp; + pDdiTable->pfnCreateCloneExp = validation_layer::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnImmediateAppendCommandListsExp = pDdiTable->pfnImmediateAppendCommandListsExp; + pDdiTable->pfnImmediateAppendCommandListsExp = validation_layer::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetNextCommandIdExp = pDdiTable->pfnGetNextCommandIdExp; + pDdiTable->pfnGetNextCommandIdExp = validation_layer::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandsExp = pDdiTable->pfnUpdateMutableCommandsExp; + pDdiTable->pfnUpdateMutableCommandsExp = validation_layer::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandSignalEventExp = pDdiTable->pfnUpdateMutableCommandSignalEventExp; + pDdiTable->pfnUpdateMutableCommandSignalEventExp = validation_layer::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnUpdateMutableCommandWaitEventsExp = pDdiTable->pfnUpdateMutableCommandWaitEventsExp; + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = validation_layer::zeCommandListUpdateMutableCommandWaitEventsExp; + } return result; } @@ -9530,45 +9618,55 @@ zeGetEventProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeEventCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeEventDestroy; - - dditable.pfnHostSignal = pDdiTable->pfnHostSignal; - pDdiTable->pfnHostSignal = validation_layer::zeEventHostSignal; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeEventHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = validation_layer::zeEventQueryStatus; - - dditable.pfnHostReset = pDdiTable->pfnHostReset; - pDdiTable->pfnHostReset = validation_layer::zeEventHostReset; - - dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestamp = validation_layer::zeEventQueryKernelTimestamp; - - dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; - pDdiTable->pfnQueryKernelTimestampsExt = validation_layer::zeEventQueryKernelTimestampsExt; - - dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; - pDdiTable->pfnGetEventPool = validation_layer::zeEventGetEventPool; - - dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; - pDdiTable->pfnGetSignalScope = validation_layer::zeEventGetSignalScope; - - dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; - pDdiTable->pfnGetWaitScope = validation_layer::zeEventGetWaitScope; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSignal = pDdiTable->pfnHostSignal; + pDdiTable->pfnHostSignal = validation_layer::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = validation_layer::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostReset = pDdiTable->pfnHostReset; + pDdiTable->pfnHostReset = validation_layer::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryKernelTimestamp = pDdiTable->pfnQueryKernelTimestamp; + pDdiTable->pfnQueryKernelTimestamp = validation_layer::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnQueryKernelTimestampsExt = pDdiTable->pfnQueryKernelTimestampsExt; + pDdiTable->pfnQueryKernelTimestampsExt = validation_layer::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetEventPool = pDdiTable->pfnGetEventPool; + pDdiTable->pfnGetEventPool = validation_layer::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSignalScope = pDdiTable->pfnGetSignalScope; + pDdiTable->pfnGetSignalScope = validation_layer::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetWaitScope = pDdiTable->pfnGetWaitScope; + pDdiTable->pfnGetWaitScope = validation_layer::zeEventGetWaitScope; + } return result; } @@ -9591,15 +9689,15 @@ zeGetEventExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; - pDdiTable->pfnQueryTimestampsExp = validation_layer::zeEventQueryTimestampsExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnQueryTimestampsExp = pDdiTable->pfnQueryTimestampsExp; + pDdiTable->pfnQueryTimestampsExp = validation_layer::zeEventQueryTimestampsExp; + } return result; } @@ -9622,36 +9720,43 @@ zeGetEventPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeEventPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeEventPoolDestroy; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = validation_layer::zeEventPoolGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = validation_layer::zeEventPoolOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = validation_layer::zeEventPoolCloseIpcHandle; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = validation_layer::zeEventPoolPutIpcHandle; - - dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; - pDdiTable->pfnGetContextHandle = validation_layer::zeEventPoolGetContextHandle; - - dditable.pfnGetFlags = pDdiTable->pfnGetFlags; - pDdiTable->pfnGetFlags = validation_layer::zeEventPoolGetFlags; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = validation_layer::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = validation_layer::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = validation_layer::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = validation_layer::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetContextHandle = pDdiTable->pfnGetContextHandle; + pDdiTable->pfnGetContextHandle = validation_layer::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetFlags = pDdiTable->pfnGetFlags; + pDdiTable->pfnGetFlags = validation_layer::zeEventPoolGetFlags; + } return result; } @@ -9674,27 +9779,31 @@ zeGetFenceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeFenceCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeFenceDestroy; - - dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; - pDdiTable->pfnHostSynchronize = validation_layer::zeFenceHostSynchronize; - - dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; - pDdiTable->pfnQueryStatus = validation_layer::zeFenceQueryStatus; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zeFenceReset; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnHostSynchronize = pDdiTable->pfnHostSynchronize; + pDdiTable->pfnHostSynchronize = validation_layer::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryStatus = pDdiTable->pfnQueryStatus; + pDdiTable->pfnQueryStatus = validation_layer::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zeFenceReset; + } return result; } @@ -9717,27 +9826,31 @@ zeGetImageProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeImageGetProperties; - - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeImageCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeImageDestroy; - - dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; - pDdiTable->pfnGetAllocPropertiesExt = validation_layer::zeImageGetAllocPropertiesExt; - - dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; - pDdiTable->pfnViewCreateExt = validation_layer::zeImageViewCreateExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnGetAllocPropertiesExt = pDdiTable->pfnGetAllocPropertiesExt; + pDdiTable->pfnGetAllocPropertiesExt = validation_layer::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnViewCreateExt = pDdiTable->pfnViewCreateExt; + pDdiTable->pfnViewCreateExt = validation_layer::zeImageViewCreateExt; + } return result; } @@ -9760,21 +9873,23 @@ zeGetImageExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; - pDdiTable->pfnGetMemoryPropertiesExp = validation_layer::zeImageGetMemoryPropertiesExp; - - dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; - pDdiTable->pfnViewCreateExp = validation_layer::zeImageViewCreateExp; - - dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; - pDdiTable->pfnGetDeviceOffsetExp = validation_layer::zeImageGetDeviceOffsetExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnGetMemoryPropertiesExp = pDdiTable->pfnGetMemoryPropertiesExp; + pDdiTable->pfnGetMemoryPropertiesExp = validation_layer::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnViewCreateExp = pDdiTable->pfnViewCreateExp; + pDdiTable->pfnViewCreateExp = validation_layer::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceOffsetExp = pDdiTable->pfnGetDeviceOffsetExp; + pDdiTable->pfnGetDeviceOffsetExp = validation_layer::zeImageGetDeviceOffsetExp; + } return result; } @@ -9797,48 +9912,59 @@ zeGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeKernelCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeKernelDestroy; - - dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; - pDdiTable->pfnSetCacheConfig = validation_layer::zeKernelSetCacheConfig; - - dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; - pDdiTable->pfnSetGroupSize = validation_layer::zeKernelSetGroupSize; - - dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; - pDdiTable->pfnSuggestGroupSize = validation_layer::zeKernelSuggestGroupSize; - - dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = validation_layer::zeKernelSuggestMaxCooperativeGroupCount; - - dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; - pDdiTable->pfnSetArgumentValue = validation_layer::zeKernelSetArgumentValue; - - dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; - pDdiTable->pfnSetIndirectAccess = validation_layer::zeKernelSetIndirectAccess; - - dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = validation_layer::zeKernelGetIndirectAccess; - - dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; - pDdiTable->pfnGetSourceAttributes = validation_layer::zeKernelGetSourceAttributes; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeKernelGetProperties; - - dditable.pfnGetName = pDdiTable->pfnGetName; - pDdiTable->pfnGetName = validation_layer::zeKernelGetName; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetCacheConfig = pDdiTable->pfnSetCacheConfig; + pDdiTable->pfnSetCacheConfig = validation_layer::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetGroupSize = pDdiTable->pfnSetGroupSize; + pDdiTable->pfnSetGroupSize = validation_layer::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestGroupSize = pDdiTable->pfnSuggestGroupSize; + pDdiTable->pfnSuggestGroupSize = validation_layer::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSuggestMaxCooperativeGroupCount = pDdiTable->pfnSuggestMaxCooperativeGroupCount; + pDdiTable->pfnSuggestMaxCooperativeGroupCount = validation_layer::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetArgumentValue = pDdiTable->pfnSetArgumentValue; + pDdiTable->pfnSetArgumentValue = validation_layer::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetIndirectAccess = pDdiTable->pfnSetIndirectAccess; + pDdiTable->pfnSetIndirectAccess = validation_layer::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIndirectAccess = pDdiTable->pfnGetIndirectAccess; + pDdiTable->pfnGetIndirectAccess = validation_layer::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetSourceAttributes = pDdiTable->pfnGetSourceAttributes; + pDdiTable->pfnGetSourceAttributes = validation_layer::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetName = pDdiTable->pfnGetName; + pDdiTable->pfnGetName = validation_layer::zeKernelGetName; + } return result; } @@ -9861,21 +9987,23 @@ zeGetKernelExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; - pDdiTable->pfnSetGlobalOffsetExp = validation_layer::zeKernelSetGlobalOffsetExp; - - dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; - pDdiTable->pfnGetBinaryExp = validation_layer::zeKernelGetBinaryExp; - - dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; - pDdiTable->pfnSchedulingHintExp = validation_layer::zeKernelSchedulingHintExp; - + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnSetGlobalOffsetExp = pDdiTable->pfnSetGlobalOffsetExp; + pDdiTable->pfnSetGlobalOffsetExp = validation_layer::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnGetBinaryExp = pDdiTable->pfnGetBinaryExp; + pDdiTable->pfnGetBinaryExp = validation_layer::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnSchedulingHintExp = pDdiTable->pfnSchedulingHintExp; + pDdiTable->pfnSchedulingHintExp = validation_layer::zeKernelSchedulingHintExp; + } return result; } @@ -9898,48 +10026,59 @@ zeGetMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAllocShared = pDdiTable->pfnAllocShared; - pDdiTable->pfnAllocShared = validation_layer::zeMemAllocShared; - - dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; - pDdiTable->pfnAllocDevice = validation_layer::zeMemAllocDevice; - - dditable.pfnAllocHost = pDdiTable->pfnAllocHost; - pDdiTable->pfnAllocHost = validation_layer::zeMemAllocHost; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = validation_layer::zeMemFree; - - dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; - pDdiTable->pfnGetAllocProperties = validation_layer::zeMemGetAllocProperties; - - dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; - pDdiTable->pfnGetAddressRange = validation_layer::zeMemGetAddressRange; - - dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; - pDdiTable->pfnGetIpcHandle = validation_layer::zeMemGetIpcHandle; - - dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; - pDdiTable->pfnOpenIpcHandle = validation_layer::zeMemOpenIpcHandle; - - dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; - pDdiTable->pfnCloseIpcHandle = validation_layer::zeMemCloseIpcHandle; - - dditable.pfnFreeExt = pDdiTable->pfnFreeExt; - pDdiTable->pfnFreeExt = validation_layer::zeMemFreeExt; - - dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; - pDdiTable->pfnPutIpcHandle = validation_layer::zeMemPutIpcHandle; - - dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; - pDdiTable->pfnGetPitchFor2dImage = validation_layer::zeMemGetPitchFor2dImage; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocShared = pDdiTable->pfnAllocShared; + pDdiTable->pfnAllocShared = validation_layer::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocDevice = pDdiTable->pfnAllocDevice; + pDdiTable->pfnAllocDevice = validation_layer::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAllocHost = pDdiTable->pfnAllocHost; + pDdiTable->pfnAllocHost = validation_layer::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = validation_layer::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAllocProperties = pDdiTable->pfnGetAllocProperties; + pDdiTable->pfnGetAllocProperties = validation_layer::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAddressRange = pDdiTable->pfnGetAddressRange; + pDdiTable->pfnGetAddressRange = validation_layer::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetIpcHandle = pDdiTable->pfnGetIpcHandle; + pDdiTable->pfnGetIpcHandle = validation_layer::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpenIpcHandle = pDdiTable->pfnOpenIpcHandle; + pDdiTable->pfnOpenIpcHandle = validation_layer::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCloseIpcHandle = pDdiTable->pfnCloseIpcHandle; + pDdiTable->pfnCloseIpcHandle = validation_layer::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnFreeExt = pDdiTable->pfnFreeExt; + pDdiTable->pfnFreeExt = validation_layer::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnPutIpcHandle = pDdiTable->pfnPutIpcHandle; + pDdiTable->pfnPutIpcHandle = validation_layer::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPitchFor2dImage = pDdiTable->pfnGetPitchFor2dImage; + pDdiTable->pfnGetPitchFor2dImage = validation_layer::zeMemGetPitchFor2dImage; + } return result; } @@ -9962,24 +10101,27 @@ zeGetMemExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = validation_layer::zeMemGetIpcHandleFromFileDescriptorExp; - - dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = validation_layer::zeMemGetFileDescriptorFromIpcHandleExp; - - dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = validation_layer::zeMemSetAtomicAccessAttributeExp; - - dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = validation_layer::zeMemGetAtomicAccessAttributeExp; - + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetIpcHandleFromFileDescriptorExp = pDdiTable->pfnGetIpcHandleFromFileDescriptorExp; + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = validation_layer::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetFileDescriptorFromIpcHandleExp = pDdiTable->pfnGetFileDescriptorFromIpcHandleExp; + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = validation_layer::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnSetAtomicAccessAttributeExp = pDdiTable->pfnSetAtomicAccessAttributeExp; + pDdiTable->pfnSetAtomicAccessAttributeExp = validation_layer::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetAtomicAccessAttributeExp = pDdiTable->pfnGetAtomicAccessAttributeExp; + pDdiTable->pfnGetAtomicAccessAttributeExp = validation_layer::zeMemGetAtomicAccessAttributeExp; + } return result; } @@ -10002,39 +10144,47 @@ zeGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeModuleCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeModuleDestroy; - - dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; - pDdiTable->pfnDynamicLink = validation_layer::zeModuleDynamicLink; - - dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; - pDdiTable->pfnGetNativeBinary = validation_layer::zeModuleGetNativeBinary; - - dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; - pDdiTable->pfnGetGlobalPointer = validation_layer::zeModuleGetGlobalPointer; - - dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; - pDdiTable->pfnGetKernelNames = validation_layer::zeModuleGetKernelNames; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zeModuleGetProperties; - - dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; - pDdiTable->pfnGetFunctionPointer = validation_layer::zeModuleGetFunctionPointer; - - dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; - pDdiTable->pfnInspectLinkageExt = validation_layer::zeModuleInspectLinkageExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDynamicLink = pDdiTable->pfnDynamicLink; + pDdiTable->pfnDynamicLink = validation_layer::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetNativeBinary = pDdiTable->pfnGetNativeBinary; + pDdiTable->pfnGetNativeBinary = validation_layer::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetGlobalPointer = pDdiTable->pfnGetGlobalPointer; + pDdiTable->pfnGetGlobalPointer = validation_layer::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetKernelNames = pDdiTable->pfnGetKernelNames; + pDdiTable->pfnGetKernelNames = validation_layer::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetFunctionPointer = pDdiTable->pfnGetFunctionPointer; + pDdiTable->pfnGetFunctionPointer = validation_layer::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + dditable.pfnInspectLinkageExt = pDdiTable->pfnInspectLinkageExt; + pDdiTable->pfnInspectLinkageExt = validation_layer::zeModuleInspectLinkageExt; + } return result; } @@ -10057,18 +10207,19 @@ zeGetModuleBuildLogProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeModuleBuildLogDestroy; - - dditable.pfnGetString = pDdiTable->pfnGetString; - pDdiTable->pfnGetString = validation_layer::zeModuleBuildLogGetString; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetString = pDdiTable->pfnGetString; + pDdiTable->pfnGetString = validation_layer::zeModuleBuildLogGetString; + } return result; } @@ -10091,18 +10242,19 @@ zeGetPhysicalMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zePhysicalMemCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zePhysicalMemDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zePhysicalMemDestroy; + } return result; } @@ -10125,18 +10277,19 @@ zeGetSamplerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zeSamplerCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zeSamplerDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zeSamplerDestroy; + } return result; } @@ -10159,33 +10312,39 @@ zeGetVirtualMemProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnReserve = pDdiTable->pfnReserve; - pDdiTable->pfnReserve = validation_layer::zeVirtualMemReserve; - - dditable.pfnFree = pDdiTable->pfnFree; - pDdiTable->pfnFree = validation_layer::zeVirtualMemFree; - - dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; - pDdiTable->pfnQueryPageSize = validation_layer::zeVirtualMemQueryPageSize; - - dditable.pfnMap = pDdiTable->pfnMap; - pDdiTable->pfnMap = validation_layer::zeVirtualMemMap; - - dditable.pfnUnmap = pDdiTable->pfnUnmap; - pDdiTable->pfnUnmap = validation_layer::zeVirtualMemUnmap; - - dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; - pDdiTable->pfnSetAccessAttribute = validation_layer::zeVirtualMemSetAccessAttribute; - - dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = validation_layer::zeVirtualMemGetAccessAttribute; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReserve = pDdiTable->pfnReserve; + pDdiTable->pfnReserve = validation_layer::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFree = pDdiTable->pfnFree; + pDdiTable->pfnFree = validation_layer::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnQueryPageSize = pDdiTable->pfnQueryPageSize; + pDdiTable->pfnQueryPageSize = validation_layer::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnMap = pDdiTable->pfnMap; + pDdiTable->pfnMap = validation_layer::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnUnmap = pDdiTable->pfnUnmap; + pDdiTable->pfnUnmap = validation_layer::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetAccessAttribute = pDdiTable->pfnSetAccessAttribute; + pDdiTable->pfnSetAccessAttribute = validation_layer::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAccessAttribute = pDdiTable->pfnGetAccessAttribute; + pDdiTable->pfnGetAccessAttribute = validation_layer::zeVirtualMemGetAccessAttribute; + } return result; } @@ -10208,21 +10367,23 @@ zeGetFabricEdgeExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zeFabricEdgeGetExp; - - dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; - pDdiTable->pfnGetVerticesExp = validation_layer::zeFabricEdgeGetVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricEdgeGetPropertiesExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetVerticesExp = pDdiTable->pfnGetVerticesExp; + pDdiTable->pfnGetVerticesExp = validation_layer::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricEdgeGetPropertiesExp; + } return result; } @@ -10245,24 +10406,27 @@ zeGetFabricVertexExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zeFabricVertexGetExp; - - dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; - pDdiTable->pfnGetSubVerticesExp = validation_layer::zeFabricVertexGetSubVerticesExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricVertexGetPropertiesExp; - - dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; - pDdiTable->pfnGetDeviceExp = validation_layer::zeFabricVertexGetDeviceExp; - + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetSubVerticesExp = pDdiTable->pfnGetSubVerticesExp; + pDdiTable->pfnGetSubVerticesExp = validation_layer::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetDeviceExp = pDdiTable->pfnGetDeviceExp; + pDdiTable->pfnGetDeviceExp = validation_layer::zeFabricVertexGetDeviceExp; + } return result; } diff --git a/source/layers/validation/zes_valddi.cpp b/source/layers/validation/zes_valddi.cpp index 674515b3..f0afd03b 100644 --- a/source/layers/validation/zes_valddi.cpp +++ b/source/layers/validation/zes_valddi.cpp @@ -6813,15 +6813,15 @@ zesGetGlobalProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnInit = pDdiTable->pfnInit; - pDdiTable->pfnInit = validation_layer::zesInit; - + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnInit = pDdiTable->pfnInit; + pDdiTable->pfnInit = validation_layer::zesInit; + } return result; } @@ -6844,123 +6844,159 @@ zesGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesDeviceGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesDeviceGetState; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zesDeviceReset; - - dditable.pfnProcessesGetState = pDdiTable->pfnProcessesGetState; - pDdiTable->pfnProcessesGetState = validation_layer::zesDeviceProcessesGetState; - - dditable.pfnPciGetProperties = pDdiTable->pfnPciGetProperties; - pDdiTable->pfnPciGetProperties = validation_layer::zesDevicePciGetProperties; - - dditable.pfnPciGetState = pDdiTable->pfnPciGetState; - pDdiTable->pfnPciGetState = validation_layer::zesDevicePciGetState; - - dditable.pfnPciGetBars = pDdiTable->pfnPciGetBars; - pDdiTable->pfnPciGetBars = validation_layer::zesDevicePciGetBars; - - dditable.pfnPciGetStats = pDdiTable->pfnPciGetStats; - pDdiTable->pfnPciGetStats = validation_layer::zesDevicePciGetStats; - - dditable.pfnEnumDiagnosticTestSuites = pDdiTable->pfnEnumDiagnosticTestSuites; - pDdiTable->pfnEnumDiagnosticTestSuites = validation_layer::zesDeviceEnumDiagnosticTestSuites; - - dditable.pfnEnumEngineGroups = pDdiTable->pfnEnumEngineGroups; - pDdiTable->pfnEnumEngineGroups = validation_layer::zesDeviceEnumEngineGroups; - - dditable.pfnEventRegister = pDdiTable->pfnEventRegister; - pDdiTable->pfnEventRegister = validation_layer::zesDeviceEventRegister; - - dditable.pfnEnumFabricPorts = pDdiTable->pfnEnumFabricPorts; - pDdiTable->pfnEnumFabricPorts = validation_layer::zesDeviceEnumFabricPorts; - - dditable.pfnEnumFans = pDdiTable->pfnEnumFans; - pDdiTable->pfnEnumFans = validation_layer::zesDeviceEnumFans; - - dditable.pfnEnumFirmwares = pDdiTable->pfnEnumFirmwares; - pDdiTable->pfnEnumFirmwares = validation_layer::zesDeviceEnumFirmwares; - - dditable.pfnEnumFrequencyDomains = pDdiTable->pfnEnumFrequencyDomains; - pDdiTable->pfnEnumFrequencyDomains = validation_layer::zesDeviceEnumFrequencyDomains; - - dditable.pfnEnumLeds = pDdiTable->pfnEnumLeds; - pDdiTable->pfnEnumLeds = validation_layer::zesDeviceEnumLeds; - - dditable.pfnEnumMemoryModules = pDdiTable->pfnEnumMemoryModules; - pDdiTable->pfnEnumMemoryModules = validation_layer::zesDeviceEnumMemoryModules; - - dditable.pfnEnumPerformanceFactorDomains = pDdiTable->pfnEnumPerformanceFactorDomains; - pDdiTable->pfnEnumPerformanceFactorDomains = validation_layer::zesDeviceEnumPerformanceFactorDomains; - - dditable.pfnEnumPowerDomains = pDdiTable->pfnEnumPowerDomains; - pDdiTable->pfnEnumPowerDomains = validation_layer::zesDeviceEnumPowerDomains; - - dditable.pfnGetCardPowerDomain = pDdiTable->pfnGetCardPowerDomain; - pDdiTable->pfnGetCardPowerDomain = validation_layer::zesDeviceGetCardPowerDomain; - - dditable.pfnEnumPsus = pDdiTable->pfnEnumPsus; - pDdiTable->pfnEnumPsus = validation_layer::zesDeviceEnumPsus; - - dditable.pfnEnumRasErrorSets = pDdiTable->pfnEnumRasErrorSets; - pDdiTable->pfnEnumRasErrorSets = validation_layer::zesDeviceEnumRasErrorSets; - - dditable.pfnEnumSchedulers = pDdiTable->pfnEnumSchedulers; - pDdiTable->pfnEnumSchedulers = validation_layer::zesDeviceEnumSchedulers; - - dditable.pfnEnumStandbyDomains = pDdiTable->pfnEnumStandbyDomains; - pDdiTable->pfnEnumStandbyDomains = validation_layer::zesDeviceEnumStandbyDomains; - - dditable.pfnEnumTemperatureSensors = pDdiTable->pfnEnumTemperatureSensors; - pDdiTable->pfnEnumTemperatureSensors = validation_layer::zesDeviceEnumTemperatureSensors; - - dditable.pfnEccAvailable = pDdiTable->pfnEccAvailable; - pDdiTable->pfnEccAvailable = validation_layer::zesDeviceEccAvailable; - - dditable.pfnEccConfigurable = pDdiTable->pfnEccConfigurable; - pDdiTable->pfnEccConfigurable = validation_layer::zesDeviceEccConfigurable; - - dditable.pfnGetEccState = pDdiTable->pfnGetEccState; - pDdiTable->pfnGetEccState = validation_layer::zesDeviceGetEccState; - - dditable.pfnSetEccState = pDdiTable->pfnSetEccState; - pDdiTable->pfnSetEccState = validation_layer::zesDeviceSetEccState; - - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zesDeviceGet; - - dditable.pfnSetOverclockWaiver = pDdiTable->pfnSetOverclockWaiver; - pDdiTable->pfnSetOverclockWaiver = validation_layer::zesDeviceSetOverclockWaiver; - - dditable.pfnGetOverclockDomains = pDdiTable->pfnGetOverclockDomains; - pDdiTable->pfnGetOverclockDomains = validation_layer::zesDeviceGetOverclockDomains; - - dditable.pfnGetOverclockControls = pDdiTable->pfnGetOverclockControls; - pDdiTable->pfnGetOverclockControls = validation_layer::zesDeviceGetOverclockControls; - - dditable.pfnResetOverclockSettings = pDdiTable->pfnResetOverclockSettings; - pDdiTable->pfnResetOverclockSettings = validation_layer::zesDeviceResetOverclockSettings; - - dditable.pfnReadOverclockState = pDdiTable->pfnReadOverclockState; - pDdiTable->pfnReadOverclockState = validation_layer::zesDeviceReadOverclockState; - - dditable.pfnEnumOverclockDomains = pDdiTable->pfnEnumOverclockDomains; - pDdiTable->pfnEnumOverclockDomains = validation_layer::zesDeviceEnumOverclockDomains; - - dditable.pfnResetExt = pDdiTable->pfnResetExt; - pDdiTable->pfnResetExt = validation_layer::zesDeviceResetExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesDeviceGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zesDeviceReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnProcessesGetState = pDdiTable->pfnProcessesGetState; + pDdiTable->pfnProcessesGetState = validation_layer::zesDeviceProcessesGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetProperties = pDdiTable->pfnPciGetProperties; + pDdiTable->pfnPciGetProperties = validation_layer::zesDevicePciGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetState = pDdiTable->pfnPciGetState; + pDdiTable->pfnPciGetState = validation_layer::zesDevicePciGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetBars = pDdiTable->pfnPciGetBars; + pDdiTable->pfnPciGetBars = validation_layer::zesDevicePciGetBars; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnPciGetStats = pDdiTable->pfnPciGetStats; + pDdiTable->pfnPciGetStats = validation_layer::zesDevicePciGetStats; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumDiagnosticTestSuites = pDdiTable->pfnEnumDiagnosticTestSuites; + pDdiTable->pfnEnumDiagnosticTestSuites = validation_layer::zesDeviceEnumDiagnosticTestSuites; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumEngineGroups = pDdiTable->pfnEnumEngineGroups; + pDdiTable->pfnEnumEngineGroups = validation_layer::zesDeviceEnumEngineGroups; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEventRegister = pDdiTable->pfnEventRegister; + pDdiTable->pfnEventRegister = validation_layer::zesDeviceEventRegister; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFabricPorts = pDdiTable->pfnEnumFabricPorts; + pDdiTable->pfnEnumFabricPorts = validation_layer::zesDeviceEnumFabricPorts; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFans = pDdiTable->pfnEnumFans; + pDdiTable->pfnEnumFans = validation_layer::zesDeviceEnumFans; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFirmwares = pDdiTable->pfnEnumFirmwares; + pDdiTable->pfnEnumFirmwares = validation_layer::zesDeviceEnumFirmwares; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumFrequencyDomains = pDdiTable->pfnEnumFrequencyDomains; + pDdiTable->pfnEnumFrequencyDomains = validation_layer::zesDeviceEnumFrequencyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumLeds = pDdiTable->pfnEnumLeds; + pDdiTable->pfnEnumLeds = validation_layer::zesDeviceEnumLeds; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumMemoryModules = pDdiTable->pfnEnumMemoryModules; + pDdiTable->pfnEnumMemoryModules = validation_layer::zesDeviceEnumMemoryModules; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPerformanceFactorDomains = pDdiTable->pfnEnumPerformanceFactorDomains; + pDdiTable->pfnEnumPerformanceFactorDomains = validation_layer::zesDeviceEnumPerformanceFactorDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPowerDomains = pDdiTable->pfnEnumPowerDomains; + pDdiTable->pfnEnumPowerDomains = validation_layer::zesDeviceEnumPowerDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCardPowerDomain = pDdiTable->pfnGetCardPowerDomain; + pDdiTable->pfnGetCardPowerDomain = validation_layer::zesDeviceGetCardPowerDomain; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumPsus = pDdiTable->pfnEnumPsus; + pDdiTable->pfnEnumPsus = validation_layer::zesDeviceEnumPsus; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumRasErrorSets = pDdiTable->pfnEnumRasErrorSets; + pDdiTable->pfnEnumRasErrorSets = validation_layer::zesDeviceEnumRasErrorSets; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumSchedulers = pDdiTable->pfnEnumSchedulers; + pDdiTable->pfnEnumSchedulers = validation_layer::zesDeviceEnumSchedulers; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumStandbyDomains = pDdiTable->pfnEnumStandbyDomains; + pDdiTable->pfnEnumStandbyDomains = validation_layer::zesDeviceEnumStandbyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEnumTemperatureSensors = pDdiTable->pfnEnumTemperatureSensors; + pDdiTable->pfnEnumTemperatureSensors = validation_layer::zesDeviceEnumTemperatureSensors; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnEccAvailable = pDdiTable->pfnEccAvailable; + pDdiTable->pfnEccAvailable = validation_layer::zesDeviceEccAvailable; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnEccConfigurable = pDdiTable->pfnEccConfigurable; + pDdiTable->pfnEccConfigurable = validation_layer::zesDeviceEccConfigurable; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnGetEccState = pDdiTable->pfnGetEccState; + pDdiTable->pfnGetEccState = validation_layer::zesDeviceGetEccState; + } + if (version >= ZE_API_VERSION_1_4) { + dditable.pfnSetEccState = pDdiTable->pfnSetEccState; + pDdiTable->pfnSetEccState = validation_layer::zesDeviceSetEccState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zesDeviceGet; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetOverclockWaiver = pDdiTable->pfnSetOverclockWaiver; + pDdiTable->pfnSetOverclockWaiver = validation_layer::zesDeviceSetOverclockWaiver; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetOverclockDomains = pDdiTable->pfnGetOverclockDomains; + pDdiTable->pfnGetOverclockDomains = validation_layer::zesDeviceGetOverclockDomains; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetOverclockControls = pDdiTable->pfnGetOverclockControls; + pDdiTable->pfnGetOverclockControls = validation_layer::zesDeviceGetOverclockControls; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnResetOverclockSettings = pDdiTable->pfnResetOverclockSettings; + pDdiTable->pfnResetOverclockSettings = validation_layer::zesDeviceResetOverclockSettings; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnReadOverclockState = pDdiTable->pfnReadOverclockState; + pDdiTable->pfnReadOverclockState = validation_layer::zesDeviceReadOverclockState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnEnumOverclockDomains = pDdiTable->pfnEnumOverclockDomains; + pDdiTable->pfnEnumOverclockDomains = validation_layer::zesDeviceEnumOverclockDomains; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnResetExt = pDdiTable->pfnResetExt; + pDdiTable->pfnResetExt = validation_layer::zesDeviceResetExt; + } return result; } @@ -6983,21 +7019,23 @@ zesGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnEnumEnabledVFExp = pDdiTable->pfnEnumEnabledVFExp; - pDdiTable->pfnEnumEnabledVFExp = validation_layer::zesDeviceEnumEnabledVFExp; - - dditable.pfnGetSubDevicePropertiesExp = pDdiTable->pfnGetSubDevicePropertiesExp; - pDdiTable->pfnGetSubDevicePropertiesExp = validation_layer::zesDeviceGetSubDevicePropertiesExp; - - dditable.pfnEnumActiveVFExp = pDdiTable->pfnEnumActiveVFExp; - pDdiTable->pfnEnumActiveVFExp = validation_layer::zesDeviceEnumActiveVFExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnEnumEnabledVFExp = pDdiTable->pfnEnumEnabledVFExp; + pDdiTable->pfnEnumEnabledVFExp = validation_layer::zesDeviceEnumEnabledVFExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSubDevicePropertiesExp = pDdiTable->pfnGetSubDevicePropertiesExp; + pDdiTable->pfnGetSubDevicePropertiesExp = validation_layer::zesDeviceGetSubDevicePropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnEnumActiveVFExp = pDdiTable->pfnEnumActiveVFExp; + pDdiTable->pfnEnumActiveVFExp = validation_layer::zesDeviceEnumActiveVFExp; + } return result; } @@ -7020,27 +7058,31 @@ zesGetDriverProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnEventListen = pDdiTable->pfnEventListen; - pDdiTable->pfnEventListen = validation_layer::zesDriverEventListen; - - dditable.pfnEventListenEx = pDdiTable->pfnEventListenEx; - pDdiTable->pfnEventListenEx = validation_layer::zesDriverEventListenEx; - - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zesDriverGet; - - dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; - pDdiTable->pfnGetExtensionProperties = validation_layer::zesDriverGetExtensionProperties; - - dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; - pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zesDriverGetExtensionFunctionAddress; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnEventListen = pDdiTable->pfnEventListen; + pDdiTable->pfnEventListen = validation_layer::zesDriverEventListen; + } + if (version >= ZE_API_VERSION_1_1) { + dditable.pfnEventListenEx = pDdiTable->pfnEventListenEx; + pDdiTable->pfnEventListenEx = validation_layer::zesDriverEventListenEx; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zesDriverGet; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetExtensionProperties = pDdiTable->pfnGetExtensionProperties; + pDdiTable->pfnGetExtensionProperties = validation_layer::zesDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetExtensionFunctionAddress = pDdiTable->pfnGetExtensionFunctionAddress; + pDdiTable->pfnGetExtensionFunctionAddress = validation_layer::zesDriverGetExtensionFunctionAddress; + } return result; } @@ -7063,15 +7105,15 @@ zesGetDriverExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDeviceByUuidExp = pDdiTable->pfnGetDeviceByUuidExp; - pDdiTable->pfnGetDeviceByUuidExp = validation_layer::zesDriverGetDeviceByUuidExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetDeviceByUuidExp = pDdiTable->pfnGetDeviceByUuidExp; + pDdiTable->pfnGetDeviceByUuidExp = validation_layer::zesDriverGetDeviceByUuidExp; + } return result; } @@ -7094,21 +7136,23 @@ zesGetDiagnosticsProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesDiagnosticsGetProperties; - - dditable.pfnGetTests = pDdiTable->pfnGetTests; - pDdiTable->pfnGetTests = validation_layer::zesDiagnosticsGetTests; - - dditable.pfnRunTests = pDdiTable->pfnRunTests; - pDdiTable->pfnRunTests = validation_layer::zesDiagnosticsRunTests; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesDiagnosticsGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTests = pDdiTable->pfnGetTests; + pDdiTable->pfnGetTests = validation_layer::zesDiagnosticsGetTests; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnRunTests = pDdiTable->pfnRunTests; + pDdiTable->pfnRunTests = validation_layer::zesDiagnosticsRunTests; + } return result; } @@ -7131,21 +7175,23 @@ zesGetEngineProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesEngineGetProperties; - - dditable.pfnGetActivity = pDdiTable->pfnGetActivity; - pDdiTable->pfnGetActivity = validation_layer::zesEngineGetActivity; - - dditable.pfnGetActivityExt = pDdiTable->pfnGetActivityExt; - pDdiTable->pfnGetActivityExt = validation_layer::zesEngineGetActivityExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesEngineGetProperties; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetActivity = pDdiTable->pfnGetActivity; + pDdiTable->pfnGetActivity = validation_layer::zesEngineGetActivity; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetActivityExt = pDdiTable->pfnGetActivityExt; + pDdiTable->pfnGetActivityExt = validation_layer::zesEngineGetActivityExt; + } return result; } @@ -7168,36 +7214,43 @@ zesGetFabricPortProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFabricPortGetProperties; - - dditable.pfnGetLinkType = pDdiTable->pfnGetLinkType; - pDdiTable->pfnGetLinkType = validation_layer::zesFabricPortGetLinkType; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesFabricPortGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesFabricPortSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFabricPortGetState; - - dditable.pfnGetThroughput = pDdiTable->pfnGetThroughput; - pDdiTable->pfnGetThroughput = validation_layer::zesFabricPortGetThroughput; - - dditable.pfnGetFabricErrorCounters = pDdiTable->pfnGetFabricErrorCounters; - pDdiTable->pfnGetFabricErrorCounters = validation_layer::zesFabricPortGetFabricErrorCounters; - - dditable.pfnGetMultiPortThroughput = pDdiTable->pfnGetMultiPortThroughput; - pDdiTable->pfnGetMultiPortThroughput = validation_layer::zesFabricPortGetMultiPortThroughput; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFabricPortGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLinkType = pDdiTable->pfnGetLinkType; + pDdiTable->pfnGetLinkType = validation_layer::zesFabricPortGetLinkType; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesFabricPortGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesFabricPortSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFabricPortGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetThroughput = pDdiTable->pfnGetThroughput; + pDdiTable->pfnGetThroughput = validation_layer::zesFabricPortGetThroughput; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetFabricErrorCounters = pDdiTable->pfnGetFabricErrorCounters; + pDdiTable->pfnGetFabricErrorCounters = validation_layer::zesFabricPortGetFabricErrorCounters; + } + if (version >= ZE_API_VERSION_1_7) { + dditable.pfnGetMultiPortThroughput = pDdiTable->pfnGetMultiPortThroughput; + pDdiTable->pfnGetMultiPortThroughput = validation_layer::zesFabricPortGetMultiPortThroughput; + } return result; } @@ -7220,30 +7273,35 @@ zesGetFanProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFanGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesFanGetConfig; - - dditable.pfnSetDefaultMode = pDdiTable->pfnSetDefaultMode; - pDdiTable->pfnSetDefaultMode = validation_layer::zesFanSetDefaultMode; - - dditable.pfnSetFixedSpeedMode = pDdiTable->pfnSetFixedSpeedMode; - pDdiTable->pfnSetFixedSpeedMode = validation_layer::zesFanSetFixedSpeedMode; - - dditable.pfnSetSpeedTableMode = pDdiTable->pfnSetSpeedTableMode; - pDdiTable->pfnSetSpeedTableMode = validation_layer::zesFanSetSpeedTableMode; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFanGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFanGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesFanGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetDefaultMode = pDdiTable->pfnSetDefaultMode; + pDdiTable->pfnSetDefaultMode = validation_layer::zesFanSetDefaultMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetFixedSpeedMode = pDdiTable->pfnSetFixedSpeedMode; + pDdiTable->pfnSetFixedSpeedMode = validation_layer::zesFanSetFixedSpeedMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetSpeedTableMode = pDdiTable->pfnSetSpeedTableMode; + pDdiTable->pfnSetSpeedTableMode = validation_layer::zesFanSetSpeedTableMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFanGetState; + } return result; } @@ -7266,24 +7324,27 @@ zesGetFirmwareProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFirmwareGetProperties; - - dditable.pfnFlash = pDdiTable->pfnFlash; - pDdiTable->pfnFlash = validation_layer::zesFirmwareFlash; - - dditable.pfnGetFlashProgress = pDdiTable->pfnGetFlashProgress; - pDdiTable->pfnGetFlashProgress = validation_layer::zesFirmwareGetFlashProgress; - - dditable.pfnGetConsoleLogs = pDdiTable->pfnGetConsoleLogs; - pDdiTable->pfnGetConsoleLogs = validation_layer::zesFirmwareGetConsoleLogs; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFirmwareGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnFlash = pDdiTable->pfnFlash; + pDdiTable->pfnFlash = validation_layer::zesFirmwareFlash; + } + if (version >= ZE_API_VERSION_1_8) { + dditable.pfnGetFlashProgress = pDdiTable->pfnGetFlashProgress; + pDdiTable->pfnGetFlashProgress = validation_layer::zesFirmwareGetFlashProgress; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetConsoleLogs = pDdiTable->pfnGetConsoleLogs; + pDdiTable->pfnGetConsoleLogs = validation_layer::zesFirmwareGetConsoleLogs; + } return result; } @@ -7306,18 +7367,19 @@ zesGetFirmwareExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetSecurityVersionExp = pDdiTable->pfnGetSecurityVersionExp; - pDdiTable->pfnGetSecurityVersionExp = validation_layer::zesFirmwareGetSecurityVersionExp; - - dditable.pfnSetSecurityVersionExp = pDdiTable->pfnSetSecurityVersionExp; - pDdiTable->pfnSetSecurityVersionExp = validation_layer::zesFirmwareSetSecurityVersionExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetSecurityVersionExp = pDdiTable->pfnGetSecurityVersionExp; + pDdiTable->pfnGetSecurityVersionExp = validation_layer::zesFirmwareGetSecurityVersionExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetSecurityVersionExp = pDdiTable->pfnSetSecurityVersionExp; + pDdiTable->pfnSetSecurityVersionExp = validation_layer::zesFirmwareSetSecurityVersionExp; + } return result; } @@ -7340,63 +7402,79 @@ zesGetFrequencyProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesFrequencyGetProperties; - - dditable.pfnGetAvailableClocks = pDdiTable->pfnGetAvailableClocks; - pDdiTable->pfnGetAvailableClocks = validation_layer::zesFrequencyGetAvailableClocks; - - dditable.pfnGetRange = pDdiTable->pfnGetRange; - pDdiTable->pfnGetRange = validation_layer::zesFrequencyGetRange; - - dditable.pfnSetRange = pDdiTable->pfnSetRange; - pDdiTable->pfnSetRange = validation_layer::zesFrequencySetRange; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesFrequencyGetState; - - dditable.pfnGetThrottleTime = pDdiTable->pfnGetThrottleTime; - pDdiTable->pfnGetThrottleTime = validation_layer::zesFrequencyGetThrottleTime; - - dditable.pfnOcGetCapabilities = pDdiTable->pfnOcGetCapabilities; - pDdiTable->pfnOcGetCapabilities = validation_layer::zesFrequencyOcGetCapabilities; - - dditable.pfnOcGetFrequencyTarget = pDdiTable->pfnOcGetFrequencyTarget; - pDdiTable->pfnOcGetFrequencyTarget = validation_layer::zesFrequencyOcGetFrequencyTarget; - - dditable.pfnOcSetFrequencyTarget = pDdiTable->pfnOcSetFrequencyTarget; - pDdiTable->pfnOcSetFrequencyTarget = validation_layer::zesFrequencyOcSetFrequencyTarget; - - dditable.pfnOcGetVoltageTarget = pDdiTable->pfnOcGetVoltageTarget; - pDdiTable->pfnOcGetVoltageTarget = validation_layer::zesFrequencyOcGetVoltageTarget; - - dditable.pfnOcSetVoltageTarget = pDdiTable->pfnOcSetVoltageTarget; - pDdiTable->pfnOcSetVoltageTarget = validation_layer::zesFrequencyOcSetVoltageTarget; - - dditable.pfnOcSetMode = pDdiTable->pfnOcSetMode; - pDdiTable->pfnOcSetMode = validation_layer::zesFrequencyOcSetMode; - - dditable.pfnOcGetMode = pDdiTable->pfnOcGetMode; - pDdiTable->pfnOcGetMode = validation_layer::zesFrequencyOcGetMode; - - dditable.pfnOcGetIccMax = pDdiTable->pfnOcGetIccMax; - pDdiTable->pfnOcGetIccMax = validation_layer::zesFrequencyOcGetIccMax; - - dditable.pfnOcSetIccMax = pDdiTable->pfnOcSetIccMax; - pDdiTable->pfnOcSetIccMax = validation_layer::zesFrequencyOcSetIccMax; - - dditable.pfnOcGetTjMax = pDdiTable->pfnOcGetTjMax; - pDdiTable->pfnOcGetTjMax = validation_layer::zesFrequencyOcGetTjMax; - - dditable.pfnOcSetTjMax = pDdiTable->pfnOcSetTjMax; - pDdiTable->pfnOcSetTjMax = validation_layer::zesFrequencyOcSetTjMax; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesFrequencyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetAvailableClocks = pDdiTable->pfnGetAvailableClocks; + pDdiTable->pfnGetAvailableClocks = validation_layer::zesFrequencyGetAvailableClocks; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetRange = pDdiTable->pfnGetRange; + pDdiTable->pfnGetRange = validation_layer::zesFrequencyGetRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetRange = pDdiTable->pfnSetRange; + pDdiTable->pfnSetRange = validation_layer::zesFrequencySetRange; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesFrequencyGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetThrottleTime = pDdiTable->pfnGetThrottleTime; + pDdiTable->pfnGetThrottleTime = validation_layer::zesFrequencyGetThrottleTime; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetCapabilities = pDdiTable->pfnOcGetCapabilities; + pDdiTable->pfnOcGetCapabilities = validation_layer::zesFrequencyOcGetCapabilities; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetFrequencyTarget = pDdiTable->pfnOcGetFrequencyTarget; + pDdiTable->pfnOcGetFrequencyTarget = validation_layer::zesFrequencyOcGetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetFrequencyTarget = pDdiTable->pfnOcSetFrequencyTarget; + pDdiTable->pfnOcSetFrequencyTarget = validation_layer::zesFrequencyOcSetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetVoltageTarget = pDdiTable->pfnOcGetVoltageTarget; + pDdiTable->pfnOcGetVoltageTarget = validation_layer::zesFrequencyOcGetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetVoltageTarget = pDdiTable->pfnOcSetVoltageTarget; + pDdiTable->pfnOcSetVoltageTarget = validation_layer::zesFrequencyOcSetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetMode = pDdiTable->pfnOcSetMode; + pDdiTable->pfnOcSetMode = validation_layer::zesFrequencyOcSetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetMode = pDdiTable->pfnOcGetMode; + pDdiTable->pfnOcGetMode = validation_layer::zesFrequencyOcGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetIccMax = pDdiTable->pfnOcGetIccMax; + pDdiTable->pfnOcGetIccMax = validation_layer::zesFrequencyOcGetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetIccMax = pDdiTable->pfnOcSetIccMax; + pDdiTable->pfnOcSetIccMax = validation_layer::zesFrequencyOcSetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcGetTjMax = pDdiTable->pfnOcGetTjMax; + pDdiTable->pfnOcGetTjMax = validation_layer::zesFrequencyOcGetTjMax; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOcSetTjMax = pDdiTable->pfnOcSetTjMax; + pDdiTable->pfnOcSetTjMax = validation_layer::zesFrequencyOcSetTjMax; + } return result; } @@ -7419,24 +7497,27 @@ zesGetLedProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesLedGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesLedGetState; - - dditable.pfnSetState = pDdiTable->pfnSetState; - pDdiTable->pfnSetState = validation_layer::zesLedSetState; - - dditable.pfnSetColor = pDdiTable->pfnSetColor; - pDdiTable->pfnSetColor = validation_layer::zesLedSetColor; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesLedGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesLedGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetState = pDdiTable->pfnSetState; + pDdiTable->pfnSetState = validation_layer::zesLedSetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetColor = pDdiTable->pfnSetColor; + pDdiTable->pfnSetColor = validation_layer::zesLedSetColor; + } return result; } @@ -7459,21 +7540,23 @@ zesGetMemoryProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesMemoryGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesMemoryGetState; - - dditable.pfnGetBandwidth = pDdiTable->pfnGetBandwidth; - pDdiTable->pfnGetBandwidth = validation_layer::zesMemoryGetBandwidth; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesMemoryGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesMemoryGetState; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetBandwidth = pDdiTable->pfnGetBandwidth; + pDdiTable->pfnGetBandwidth = validation_layer::zesMemoryGetBandwidth; + } return result; } @@ -7496,39 +7579,47 @@ zesGetOverclockProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDomainProperties = pDdiTable->pfnGetDomainProperties; - pDdiTable->pfnGetDomainProperties = validation_layer::zesOverclockGetDomainProperties; - - dditable.pfnGetDomainVFProperties = pDdiTable->pfnGetDomainVFProperties; - pDdiTable->pfnGetDomainVFProperties = validation_layer::zesOverclockGetDomainVFProperties; - - dditable.pfnGetDomainControlProperties = pDdiTable->pfnGetDomainControlProperties; - pDdiTable->pfnGetDomainControlProperties = validation_layer::zesOverclockGetDomainControlProperties; - - dditable.pfnGetControlCurrentValue = pDdiTable->pfnGetControlCurrentValue; - pDdiTable->pfnGetControlCurrentValue = validation_layer::zesOverclockGetControlCurrentValue; - - dditable.pfnGetControlPendingValue = pDdiTable->pfnGetControlPendingValue; - pDdiTable->pfnGetControlPendingValue = validation_layer::zesOverclockGetControlPendingValue; - - dditable.pfnSetControlUserValue = pDdiTable->pfnSetControlUserValue; - pDdiTable->pfnSetControlUserValue = validation_layer::zesOverclockSetControlUserValue; - - dditable.pfnGetControlState = pDdiTable->pfnGetControlState; - pDdiTable->pfnGetControlState = validation_layer::zesOverclockGetControlState; - - dditable.pfnGetVFPointValues = pDdiTable->pfnGetVFPointValues; - pDdiTable->pfnGetVFPointValues = validation_layer::zesOverclockGetVFPointValues; - - dditable.pfnSetVFPointValues = pDdiTable->pfnSetVFPointValues; - pDdiTable->pfnSetVFPointValues = validation_layer::zesOverclockSetVFPointValues; - + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainProperties = pDdiTable->pfnGetDomainProperties; + pDdiTable->pfnGetDomainProperties = validation_layer::zesOverclockGetDomainProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainVFProperties = pDdiTable->pfnGetDomainVFProperties; + pDdiTable->pfnGetDomainVFProperties = validation_layer::zesOverclockGetDomainVFProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetDomainControlProperties = pDdiTable->pfnGetDomainControlProperties; + pDdiTable->pfnGetDomainControlProperties = validation_layer::zesOverclockGetDomainControlProperties; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlCurrentValue = pDdiTable->pfnGetControlCurrentValue; + pDdiTable->pfnGetControlCurrentValue = validation_layer::zesOverclockGetControlCurrentValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlPendingValue = pDdiTable->pfnGetControlPendingValue; + pDdiTable->pfnGetControlPendingValue = validation_layer::zesOverclockGetControlPendingValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetControlUserValue = pDdiTable->pfnSetControlUserValue; + pDdiTable->pfnSetControlUserValue = validation_layer::zesOverclockSetControlUserValue; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetControlState = pDdiTable->pfnGetControlState; + pDdiTable->pfnGetControlState = validation_layer::zesOverclockGetControlState; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetVFPointValues = pDdiTable->pfnGetVFPointValues; + pDdiTable->pfnGetVFPointValues = validation_layer::zesOverclockGetVFPointValues; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnSetVFPointValues = pDdiTable->pfnSetVFPointValues; + pDdiTable->pfnSetVFPointValues = validation_layer::zesOverclockSetVFPointValues; + } return result; } @@ -7551,21 +7642,23 @@ zesGetPerformanceFactorProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPerformanceFactorGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesPerformanceFactorGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesPerformanceFactorSetConfig; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPerformanceFactorGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesPerformanceFactorGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesPerformanceFactorSetConfig; + } return result; } @@ -7588,36 +7681,43 @@ zesGetPowerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPowerGetProperties; - - dditable.pfnGetEnergyCounter = pDdiTable->pfnGetEnergyCounter; - pDdiTable->pfnGetEnergyCounter = validation_layer::zesPowerGetEnergyCounter; - - dditable.pfnGetLimits = pDdiTable->pfnGetLimits; - pDdiTable->pfnGetLimits = validation_layer::zesPowerGetLimits; - - dditable.pfnSetLimits = pDdiTable->pfnSetLimits; - pDdiTable->pfnSetLimits = validation_layer::zesPowerSetLimits; - - dditable.pfnGetEnergyThreshold = pDdiTable->pfnGetEnergyThreshold; - pDdiTable->pfnGetEnergyThreshold = validation_layer::zesPowerGetEnergyThreshold; - - dditable.pfnSetEnergyThreshold = pDdiTable->pfnSetEnergyThreshold; - pDdiTable->pfnSetEnergyThreshold = validation_layer::zesPowerSetEnergyThreshold; - - dditable.pfnGetLimitsExt = pDdiTable->pfnGetLimitsExt; - pDdiTable->pfnGetLimitsExt = validation_layer::zesPowerGetLimitsExt; - - dditable.pfnSetLimitsExt = pDdiTable->pfnSetLimitsExt; - pDdiTable->pfnSetLimitsExt = validation_layer::zesPowerSetLimitsExt; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPowerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetEnergyCounter = pDdiTable->pfnGetEnergyCounter; + pDdiTable->pfnGetEnergyCounter = validation_layer::zesPowerGetEnergyCounter; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLimits = pDdiTable->pfnGetLimits; + pDdiTable->pfnGetLimits = validation_layer::zesPowerGetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetLimits = pDdiTable->pfnSetLimits; + pDdiTable->pfnSetLimits = validation_layer::zesPowerSetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetEnergyThreshold = pDdiTable->pfnGetEnergyThreshold; + pDdiTable->pfnGetEnergyThreshold = validation_layer::zesPowerGetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEnergyThreshold = pDdiTable->pfnSetEnergyThreshold; + pDdiTable->pfnSetEnergyThreshold = validation_layer::zesPowerSetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetLimitsExt = pDdiTable->pfnGetLimitsExt; + pDdiTable->pfnGetLimitsExt = validation_layer::zesPowerGetLimitsExt; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetLimitsExt = pDdiTable->pfnSetLimitsExt; + pDdiTable->pfnSetLimitsExt = validation_layer::zesPowerSetLimitsExt; + } return result; } @@ -7640,18 +7740,19 @@ zesGetPsuProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesPsuGetProperties; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesPsuGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesPsuGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesPsuGetState; + } return result; } @@ -7674,24 +7775,27 @@ zesGetRasProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesRasGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesRasGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesRasSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesRasGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesRasGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesRasGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesRasSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesRasGetState; + } return result; } @@ -7714,18 +7818,19 @@ zesGetRasExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetStateExp = pDdiTable->pfnGetStateExp; - pDdiTable->pfnGetStateExp = validation_layer::zesRasGetStateExp; - - dditable.pfnClearStateExp = pDdiTable->pfnClearStateExp; - pDdiTable->pfnClearStateExp = validation_layer::zesRasClearStateExp; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetStateExp = pDdiTable->pfnGetStateExp; + pDdiTable->pfnGetStateExp = validation_layer::zesRasGetStateExp; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClearStateExp = pDdiTable->pfnClearStateExp; + pDdiTable->pfnClearStateExp = validation_layer::zesRasClearStateExp; + } return result; } @@ -7748,36 +7853,43 @@ zesGetSchedulerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesSchedulerGetProperties; - - dditable.pfnGetCurrentMode = pDdiTable->pfnGetCurrentMode; - pDdiTable->pfnGetCurrentMode = validation_layer::zesSchedulerGetCurrentMode; - - dditable.pfnGetTimeoutModeProperties = pDdiTable->pfnGetTimeoutModeProperties; - pDdiTable->pfnGetTimeoutModeProperties = validation_layer::zesSchedulerGetTimeoutModeProperties; - - dditable.pfnGetTimesliceModeProperties = pDdiTable->pfnGetTimesliceModeProperties; - pDdiTable->pfnGetTimesliceModeProperties = validation_layer::zesSchedulerGetTimesliceModeProperties; - - dditable.pfnSetTimeoutMode = pDdiTable->pfnSetTimeoutMode; - pDdiTable->pfnSetTimeoutMode = validation_layer::zesSchedulerSetTimeoutMode; - - dditable.pfnSetTimesliceMode = pDdiTable->pfnSetTimesliceMode; - pDdiTable->pfnSetTimesliceMode = validation_layer::zesSchedulerSetTimesliceMode; - - dditable.pfnSetExclusiveMode = pDdiTable->pfnSetExclusiveMode; - pDdiTable->pfnSetExclusiveMode = validation_layer::zesSchedulerSetExclusiveMode; - - dditable.pfnSetComputeUnitDebugMode = pDdiTable->pfnSetComputeUnitDebugMode; - pDdiTable->pfnSetComputeUnitDebugMode = validation_layer::zesSchedulerSetComputeUnitDebugMode; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesSchedulerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetCurrentMode = pDdiTable->pfnGetCurrentMode; + pDdiTable->pfnGetCurrentMode = validation_layer::zesSchedulerGetCurrentMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTimeoutModeProperties = pDdiTable->pfnGetTimeoutModeProperties; + pDdiTable->pfnGetTimeoutModeProperties = validation_layer::zesSchedulerGetTimeoutModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetTimesliceModeProperties = pDdiTable->pfnGetTimesliceModeProperties; + pDdiTable->pfnGetTimesliceModeProperties = validation_layer::zesSchedulerGetTimesliceModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetTimeoutMode = pDdiTable->pfnSetTimeoutMode; + pDdiTable->pfnSetTimeoutMode = validation_layer::zesSchedulerSetTimeoutMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetTimesliceMode = pDdiTable->pfnSetTimesliceMode; + pDdiTable->pfnSetTimesliceMode = validation_layer::zesSchedulerSetTimesliceMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetExclusiveMode = pDdiTable->pfnSetExclusiveMode; + pDdiTable->pfnSetExclusiveMode = validation_layer::zesSchedulerSetExclusiveMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetComputeUnitDebugMode = pDdiTable->pfnSetComputeUnitDebugMode; + pDdiTable->pfnSetComputeUnitDebugMode = validation_layer::zesSchedulerSetComputeUnitDebugMode; + } return result; } @@ -7800,21 +7912,23 @@ zesGetStandbyProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesStandbyGetProperties; - - dditable.pfnGetMode = pDdiTable->pfnGetMode; - pDdiTable->pfnGetMode = validation_layer::zesStandbyGetMode; - - dditable.pfnSetMode = pDdiTable->pfnSetMode; - pDdiTable->pfnSetMode = validation_layer::zesStandbySetMode; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesStandbyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetMode = pDdiTable->pfnGetMode; + pDdiTable->pfnGetMode = validation_layer::zesStandbyGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetMode = pDdiTable->pfnSetMode; + pDdiTable->pfnSetMode = validation_layer::zesStandbySetMode; + } return result; } @@ -7837,24 +7951,27 @@ zesGetTemperatureProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zesTemperatureGetProperties; - - dditable.pfnGetConfig = pDdiTable->pfnGetConfig; - pDdiTable->pfnGetConfig = validation_layer::zesTemperatureGetConfig; - - dditable.pfnSetConfig = pDdiTable->pfnSetConfig; - pDdiTable->pfnSetConfig = validation_layer::zesTemperatureSetConfig; - - dditable.pfnGetState = pDdiTable->pfnGetState; - pDdiTable->pfnGetState = validation_layer::zesTemperatureGetState; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zesTemperatureGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetConfig = pDdiTable->pfnGetConfig; + pDdiTable->pfnGetConfig = validation_layer::zesTemperatureGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetConfig = pDdiTable->pfnSetConfig; + pDdiTable->pfnSetConfig = validation_layer::zesTemperatureSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetState = pDdiTable->pfnGetState; + pDdiTable->pfnGetState = validation_layer::zesTemperatureGetState; + } return result; } @@ -7877,39 +7994,47 @@ zesGetVFManagementExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetVFCapabilitiesExp = pDdiTable->pfnGetVFCapabilitiesExp; - pDdiTable->pfnGetVFCapabilitiesExp = validation_layer::zesVFManagementGetVFCapabilitiesExp; - - dditable.pfnGetVFMemoryUtilizationExp2 = pDdiTable->pfnGetVFMemoryUtilizationExp2; - pDdiTable->pfnGetVFMemoryUtilizationExp2 = validation_layer::zesVFManagementGetVFMemoryUtilizationExp2; - - dditable.pfnGetVFEngineUtilizationExp2 = pDdiTable->pfnGetVFEngineUtilizationExp2; - pDdiTable->pfnGetVFEngineUtilizationExp2 = validation_layer::zesVFManagementGetVFEngineUtilizationExp2; - - dditable.pfnGetVFCapabilitiesExp2 = pDdiTable->pfnGetVFCapabilitiesExp2; - pDdiTable->pfnGetVFCapabilitiesExp2 = validation_layer::zesVFManagementGetVFCapabilitiesExp2; - - dditable.pfnGetVFPropertiesExp = pDdiTable->pfnGetVFPropertiesExp; - pDdiTable->pfnGetVFPropertiesExp = validation_layer::zesVFManagementGetVFPropertiesExp; - - dditable.pfnGetVFMemoryUtilizationExp = pDdiTable->pfnGetVFMemoryUtilizationExp; - pDdiTable->pfnGetVFMemoryUtilizationExp = validation_layer::zesVFManagementGetVFMemoryUtilizationExp; - - dditable.pfnGetVFEngineUtilizationExp = pDdiTable->pfnGetVFEngineUtilizationExp; - pDdiTable->pfnGetVFEngineUtilizationExp = validation_layer::zesVFManagementGetVFEngineUtilizationExp; - - dditable.pfnSetVFTelemetryModeExp = pDdiTable->pfnSetVFTelemetryModeExp; - pDdiTable->pfnSetVFTelemetryModeExp = validation_layer::zesVFManagementSetVFTelemetryModeExp; - - dditable.pfnSetVFTelemetrySamplingIntervalExp = pDdiTable->pfnSetVFTelemetrySamplingIntervalExp; - pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = validation_layer::zesVFManagementSetVFTelemetrySamplingIntervalExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFCapabilitiesExp = pDdiTable->pfnGetVFCapabilitiesExp; + pDdiTable->pfnGetVFCapabilitiesExp = validation_layer::zesVFManagementGetVFCapabilitiesExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFMemoryUtilizationExp2 = pDdiTable->pfnGetVFMemoryUtilizationExp2; + pDdiTable->pfnGetVFMemoryUtilizationExp2 = validation_layer::zesVFManagementGetVFMemoryUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetVFEngineUtilizationExp2 = pDdiTable->pfnGetVFEngineUtilizationExp2; + pDdiTable->pfnGetVFEngineUtilizationExp2 = validation_layer::zesVFManagementGetVFEngineUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_12) { + dditable.pfnGetVFCapabilitiesExp2 = pDdiTable->pfnGetVFCapabilitiesExp2; + pDdiTable->pfnGetVFCapabilitiesExp2 = validation_layer::zesVFManagementGetVFCapabilitiesExp2; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFPropertiesExp = pDdiTable->pfnGetVFPropertiesExp; + pDdiTable->pfnGetVFPropertiesExp = validation_layer::zesVFManagementGetVFPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFMemoryUtilizationExp = pDdiTable->pfnGetVFMemoryUtilizationExp; + pDdiTable->pfnGetVFMemoryUtilizationExp = validation_layer::zesVFManagementGetVFMemoryUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetVFEngineUtilizationExp = pDdiTable->pfnGetVFEngineUtilizationExp; + pDdiTable->pfnGetVFEngineUtilizationExp = validation_layer::zesVFManagementGetVFEngineUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetVFTelemetryModeExp = pDdiTable->pfnSetVFTelemetryModeExp; + pDdiTable->pfnSetVFTelemetryModeExp = validation_layer::zesVFManagementSetVFTelemetryModeExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnSetVFTelemetrySamplingIntervalExp = pDdiTable->pfnSetVFTelemetrySamplingIntervalExp; + pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = validation_layer::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } return result; } diff --git a/source/layers/validation/zet_valddi.cpp b/source/layers/validation/zet_valddi.cpp index 0791d400..510b578f 100644 --- a/source/layers/validation/zet_valddi.cpp +++ b/source/layers/validation/zet_valddi.cpp @@ -3283,21 +3283,23 @@ zetGetMetricDecoderExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricDecoderCreateExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricDecoderDestroyExp; - - dditable.pfnGetDecodableMetricsExp = pDdiTable->pfnGetDecodableMetricsExp; - pDdiTable->pfnGetDecodableMetricsExp = validation_layer::zetMetricDecoderGetDecodableMetricsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricDecoderCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricDecoderDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetDecodableMetricsExp = pDdiTable->pfnGetDecodableMetricsExp; + pDdiTable->pfnGetDecodableMetricsExp = validation_layer::zetMetricDecoderGetDecodableMetricsExp; + } return result; } @@ -3320,24 +3322,27 @@ zetGetMetricProgrammableExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetExp = pDdiTable->pfnGetExp; - pDdiTable->pfnGetExp = validation_layer::zetMetricProgrammableGetExp; - - dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; - pDdiTable->pfnGetPropertiesExp = validation_layer::zetMetricProgrammableGetPropertiesExp; - - dditable.pfnGetParamInfoExp = pDdiTable->pfnGetParamInfoExp; - pDdiTable->pfnGetParamInfoExp = validation_layer::zetMetricProgrammableGetParamInfoExp; - - dditable.pfnGetParamValueInfoExp = pDdiTable->pfnGetParamValueInfoExp; - pDdiTable->pfnGetParamValueInfoExp = validation_layer::zetMetricProgrammableGetParamValueInfoExp; - + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetExp = pDdiTable->pfnGetExp; + pDdiTable->pfnGetExp = validation_layer::zetMetricProgrammableGetExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetPropertiesExp = pDdiTable->pfnGetPropertiesExp; + pDdiTable->pfnGetPropertiesExp = validation_layer::zetMetricProgrammableGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetParamInfoExp = pDdiTable->pfnGetParamInfoExp; + pDdiTable->pfnGetParamInfoExp = validation_layer::zetMetricProgrammableGetParamInfoExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnGetParamValueInfoExp = pDdiTable->pfnGetParamValueInfoExp; + pDdiTable->pfnGetParamValueInfoExp = validation_layer::zetMetricProgrammableGetParamValueInfoExp; + } return result; } @@ -3360,30 +3365,35 @@ zetGetMetricTracerExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricTracerCreateExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricTracerDestroyExp; - - dditable.pfnEnableExp = pDdiTable->pfnEnableExp; - pDdiTable->pfnEnableExp = validation_layer::zetMetricTracerEnableExp; - - dditable.pfnDisableExp = pDdiTable->pfnDisableExp; - pDdiTable->pfnDisableExp = validation_layer::zetMetricTracerDisableExp; - - dditable.pfnReadDataExp = pDdiTable->pfnReadDataExp; - pDdiTable->pfnReadDataExp = validation_layer::zetMetricTracerReadDataExp; - - dditable.pfnDecodeExp = pDdiTable->pfnDecodeExp; - pDdiTable->pfnDecodeExp = validation_layer::zetMetricTracerDecodeExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricTracerCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricTracerDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnEnableExp = pDdiTable->pfnEnableExp; + pDdiTable->pfnEnableExp = validation_layer::zetMetricTracerEnableExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDisableExp = pDdiTable->pfnDisableExp; + pDdiTable->pfnDisableExp = validation_layer::zetMetricTracerDisableExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnReadDataExp = pDdiTable->pfnReadDataExp; + pDdiTable->pfnReadDataExp = validation_layer::zetMetricTracerReadDataExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnDecodeExp = pDdiTable->pfnDecodeExp; + pDdiTable->pfnDecodeExp = validation_layer::zetMetricTracerDecodeExp; + } return result; } @@ -3406,15 +3416,15 @@ zetGetDeviceProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDebugProperties = pDdiTable->pfnGetDebugProperties; - pDdiTable->pfnGetDebugProperties = validation_layer::zetDeviceGetDebugProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetDebugProperties = pDdiTable->pfnGetDebugProperties; + pDdiTable->pfnGetDebugProperties = validation_layer::zetDeviceGetDebugProperties; + } return result; } @@ -3437,18 +3447,19 @@ zetGetDeviceExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetConcurrentMetricGroupsExp = pDdiTable->pfnGetConcurrentMetricGroupsExp; - pDdiTable->pfnGetConcurrentMetricGroupsExp = validation_layer::zetDeviceGetConcurrentMetricGroupsExp; - - dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; - pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; - + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnGetConcurrentMetricGroupsExp = pDdiTable->pfnGetConcurrentMetricGroupsExp; + pDdiTable->pfnGetConcurrentMetricGroupsExp = validation_layer::zetDeviceGetConcurrentMetricGroupsExp; + } + if (version >= ZE_API_VERSION_1_10) { + dditable.pfnCreateMetricGroupsFromMetricsExp = pDdiTable->pfnCreateMetricGroupsFromMetricsExp; + pDdiTable->pfnCreateMetricGroupsFromMetricsExp = validation_layer::zetDeviceCreateMetricGroupsFromMetricsExp; + } return result; } @@ -3471,15 +3482,15 @@ zetGetContextProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnActivateMetricGroups = pDdiTable->pfnActivateMetricGroups; - pDdiTable->pfnActivateMetricGroups = validation_layer::zetContextActivateMetricGroups; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnActivateMetricGroups = pDdiTable->pfnActivateMetricGroups; + pDdiTable->pfnActivateMetricGroups = validation_layer::zetContextActivateMetricGroups; + } return result; } @@ -3502,24 +3513,27 @@ zetGetCommandListProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAppendMetricStreamerMarker = pDdiTable->pfnAppendMetricStreamerMarker; - pDdiTable->pfnAppendMetricStreamerMarker = validation_layer::zetCommandListAppendMetricStreamerMarker; - - dditable.pfnAppendMetricQueryBegin = pDdiTable->pfnAppendMetricQueryBegin; - pDdiTable->pfnAppendMetricQueryBegin = validation_layer::zetCommandListAppendMetricQueryBegin; - - dditable.pfnAppendMetricQueryEnd = pDdiTable->pfnAppendMetricQueryEnd; - pDdiTable->pfnAppendMetricQueryEnd = validation_layer::zetCommandListAppendMetricQueryEnd; - - dditable.pfnAppendMetricMemoryBarrier = pDdiTable->pfnAppendMetricMemoryBarrier; - pDdiTable->pfnAppendMetricMemoryBarrier = validation_layer::zetCommandListAppendMetricMemoryBarrier; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricStreamerMarker = pDdiTable->pfnAppendMetricStreamerMarker; + pDdiTable->pfnAppendMetricStreamerMarker = validation_layer::zetCommandListAppendMetricStreamerMarker; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricQueryBegin = pDdiTable->pfnAppendMetricQueryBegin; + pDdiTable->pfnAppendMetricQueryBegin = validation_layer::zetCommandListAppendMetricQueryBegin; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricQueryEnd = pDdiTable->pfnAppendMetricQueryEnd; + pDdiTable->pfnAppendMetricQueryEnd = validation_layer::zetCommandListAppendMetricQueryEnd; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAppendMetricMemoryBarrier = pDdiTable->pfnAppendMetricMemoryBarrier; + pDdiTable->pfnAppendMetricMemoryBarrier = validation_layer::zetCommandListAppendMetricMemoryBarrier; + } return result; } @@ -3542,15 +3556,15 @@ zetGetKernelProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetProfileInfo = pDdiTable->pfnGetProfileInfo; - pDdiTable->pfnGetProfileInfo = validation_layer::zetKernelGetProfileInfo; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProfileInfo = pDdiTable->pfnGetProfileInfo; + pDdiTable->pfnGetProfileInfo = validation_layer::zetKernelGetProfileInfo; + } return result; } @@ -3573,15 +3587,15 @@ zetGetModuleProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGetDebugInfo = pDdiTable->pfnGetDebugInfo; - pDdiTable->pfnGetDebugInfo = validation_layer::zetModuleGetDebugInfo; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetDebugInfo = pDdiTable->pfnGetDebugInfo; + pDdiTable->pfnGetDebugInfo = validation_layer::zetModuleGetDebugInfo; + } return result; } @@ -3604,48 +3618,59 @@ zetGetDebugProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnAttach = pDdiTable->pfnAttach; - pDdiTable->pfnAttach = validation_layer::zetDebugAttach; - - dditable.pfnDetach = pDdiTable->pfnDetach; - pDdiTable->pfnDetach = validation_layer::zetDebugDetach; - - dditable.pfnReadEvent = pDdiTable->pfnReadEvent; - pDdiTable->pfnReadEvent = validation_layer::zetDebugReadEvent; - - dditable.pfnAcknowledgeEvent = pDdiTable->pfnAcknowledgeEvent; - pDdiTable->pfnAcknowledgeEvent = validation_layer::zetDebugAcknowledgeEvent; - - dditable.pfnInterrupt = pDdiTable->pfnInterrupt; - pDdiTable->pfnInterrupt = validation_layer::zetDebugInterrupt; - - dditable.pfnResume = pDdiTable->pfnResume; - pDdiTable->pfnResume = validation_layer::zetDebugResume; - - dditable.pfnReadMemory = pDdiTable->pfnReadMemory; - pDdiTable->pfnReadMemory = validation_layer::zetDebugReadMemory; - - dditable.pfnWriteMemory = pDdiTable->pfnWriteMemory; - pDdiTable->pfnWriteMemory = validation_layer::zetDebugWriteMemory; - - dditable.pfnGetRegisterSetProperties = pDdiTable->pfnGetRegisterSetProperties; - pDdiTable->pfnGetRegisterSetProperties = validation_layer::zetDebugGetRegisterSetProperties; - - dditable.pfnReadRegisters = pDdiTable->pfnReadRegisters; - pDdiTable->pfnReadRegisters = validation_layer::zetDebugReadRegisters; - - dditable.pfnWriteRegisters = pDdiTable->pfnWriteRegisters; - pDdiTable->pfnWriteRegisters = validation_layer::zetDebugWriteRegisters; - - dditable.pfnGetThreadRegisterSetProperties = pDdiTable->pfnGetThreadRegisterSetProperties; - pDdiTable->pfnGetThreadRegisterSetProperties = validation_layer::zetDebugGetThreadRegisterSetProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAttach = pDdiTable->pfnAttach; + pDdiTable->pfnAttach = validation_layer::zetDebugAttach; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDetach = pDdiTable->pfnDetach; + pDdiTable->pfnDetach = validation_layer::zetDebugDetach; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadEvent = pDdiTable->pfnReadEvent; + pDdiTable->pfnReadEvent = validation_layer::zetDebugReadEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnAcknowledgeEvent = pDdiTable->pfnAcknowledgeEvent; + pDdiTable->pfnAcknowledgeEvent = validation_layer::zetDebugAcknowledgeEvent; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnInterrupt = pDdiTable->pfnInterrupt; + pDdiTable->pfnInterrupt = validation_layer::zetDebugInterrupt; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnResume = pDdiTable->pfnResume; + pDdiTable->pfnResume = validation_layer::zetDebugResume; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadMemory = pDdiTable->pfnReadMemory; + pDdiTable->pfnReadMemory = validation_layer::zetDebugReadMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnWriteMemory = pDdiTable->pfnWriteMemory; + pDdiTable->pfnWriteMemory = validation_layer::zetDebugWriteMemory; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetRegisterSetProperties = pDdiTable->pfnGetRegisterSetProperties; + pDdiTable->pfnGetRegisterSetProperties = validation_layer::zetDebugGetRegisterSetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadRegisters = pDdiTable->pfnReadRegisters; + pDdiTable->pfnReadRegisters = validation_layer::zetDebugReadRegisters; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnWriteRegisters = pDdiTable->pfnWriteRegisters; + pDdiTable->pfnWriteRegisters = validation_layer::zetDebugWriteRegisters; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetThreadRegisterSetProperties = pDdiTable->pfnGetThreadRegisterSetProperties; + pDdiTable->pfnGetThreadRegisterSetProperties = validation_layer::zetDebugGetThreadRegisterSetProperties; + } return result; } @@ -3668,18 +3693,19 @@ zetGetMetricProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zetMetricGet; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zetMetricGetProperties; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zetMetricGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zetMetricGetProperties; + } return result; } @@ -3702,21 +3728,23 @@ zetGetMetricExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreateFromProgrammableExp2 = pDdiTable->pfnCreateFromProgrammableExp2; - pDdiTable->pfnCreateFromProgrammableExp2 = validation_layer::zetMetricCreateFromProgrammableExp2; - - dditable.pfnCreateFromProgrammableExp = pDdiTable->pfnCreateFromProgrammableExp; - pDdiTable->pfnCreateFromProgrammableExp = validation_layer::zetMetricCreateFromProgrammableExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricDestroyExp; - + if (version >= ZE_API_VERSION_1_11) { + dditable.pfnCreateFromProgrammableExp2 = pDdiTable->pfnCreateFromProgrammableExp2; + pDdiTable->pfnCreateFromProgrammableExp2 = validation_layer::zetMetricCreateFromProgrammableExp2; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateFromProgrammableExp = pDdiTable->pfnCreateFromProgrammableExp; + pDdiTable->pfnCreateFromProgrammableExp = validation_layer::zetMetricCreateFromProgrammableExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricDestroyExp; + } return result; } @@ -3739,21 +3767,23 @@ zetGetMetricGroupProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnGet = pDdiTable->pfnGet; - pDdiTable->pfnGet = validation_layer::zetMetricGroupGet; - - dditable.pfnGetProperties = pDdiTable->pfnGetProperties; - pDdiTable->pfnGetProperties = validation_layer::zetMetricGroupGetProperties; - - dditable.pfnCalculateMetricValues = pDdiTable->pfnCalculateMetricValues; - pDdiTable->pfnCalculateMetricValues = validation_layer::zetMetricGroupCalculateMetricValues; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGet = pDdiTable->pfnGet; + pDdiTable->pfnGet = validation_layer::zetMetricGroupGet; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetProperties = pDdiTable->pfnGetProperties; + pDdiTable->pfnGetProperties = validation_layer::zetMetricGroupGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCalculateMetricValues = pDdiTable->pfnCalculateMetricValues; + pDdiTable->pfnCalculateMetricValues = validation_layer::zetMetricGroupCalculateMetricValues; + } return result; } @@ -3776,39 +3806,47 @@ zetGetMetricGroupExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCalculateMultipleMetricValuesExp = pDdiTable->pfnCalculateMultipleMetricValuesExp; - pDdiTable->pfnCalculateMultipleMetricValuesExp = validation_layer::zetMetricGroupCalculateMultipleMetricValuesExp; - - dditable.pfnGetGlobalTimestampsExp = pDdiTable->pfnGetGlobalTimestampsExp; - pDdiTable->pfnGetGlobalTimestampsExp = validation_layer::zetMetricGroupGetGlobalTimestampsExp; - - dditable.pfnGetExportDataExp = pDdiTable->pfnGetExportDataExp; - pDdiTable->pfnGetExportDataExp = validation_layer::zetMetricGroupGetExportDataExp; - - dditable.pfnCalculateMetricExportDataExp = pDdiTable->pfnCalculateMetricExportDataExp; - pDdiTable->pfnCalculateMetricExportDataExp = validation_layer::zetMetricGroupCalculateMetricExportDataExp; - - dditable.pfnCreateExp = pDdiTable->pfnCreateExp; - pDdiTable->pfnCreateExp = validation_layer::zetMetricGroupCreateExp; - - dditable.pfnAddMetricExp = pDdiTable->pfnAddMetricExp; - pDdiTable->pfnAddMetricExp = validation_layer::zetMetricGroupAddMetricExp; - - dditable.pfnRemoveMetricExp = pDdiTable->pfnRemoveMetricExp; - pDdiTable->pfnRemoveMetricExp = validation_layer::zetMetricGroupRemoveMetricExp; - - dditable.pfnCloseExp = pDdiTable->pfnCloseExp; - pDdiTable->pfnCloseExp = validation_layer::zetMetricGroupCloseExp; - - dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; - pDdiTable->pfnDestroyExp = validation_layer::zetMetricGroupDestroyExp; - + if (version >= ZE_API_VERSION_1_2) { + dditable.pfnCalculateMultipleMetricValuesExp = pDdiTable->pfnCalculateMultipleMetricValuesExp; + pDdiTable->pfnCalculateMultipleMetricValuesExp = validation_layer::zetMetricGroupCalculateMultipleMetricValuesExp; + } + if (version >= ZE_API_VERSION_1_5) { + dditable.pfnGetGlobalTimestampsExp = pDdiTable->pfnGetGlobalTimestampsExp; + pDdiTable->pfnGetGlobalTimestampsExp = validation_layer::zetMetricGroupGetGlobalTimestampsExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnGetExportDataExp = pDdiTable->pfnGetExportDataExp; + pDdiTable->pfnGetExportDataExp = validation_layer::zetMetricGroupGetExportDataExp; + } + if (version >= ZE_API_VERSION_1_6) { + dditable.pfnCalculateMetricExportDataExp = pDdiTable->pfnCalculateMetricExportDataExp; + pDdiTable->pfnCalculateMetricExportDataExp = validation_layer::zetMetricGroupCalculateMetricExportDataExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCreateExp = pDdiTable->pfnCreateExp; + pDdiTable->pfnCreateExp = validation_layer::zetMetricGroupCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnAddMetricExp = pDdiTable->pfnAddMetricExp; + pDdiTable->pfnAddMetricExp = validation_layer::zetMetricGroupAddMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnRemoveMetricExp = pDdiTable->pfnRemoveMetricExp; + pDdiTable->pfnRemoveMetricExp = validation_layer::zetMetricGroupRemoveMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnCloseExp = pDdiTable->pfnCloseExp; + pDdiTable->pfnCloseExp = validation_layer::zetMetricGroupCloseExp; + } + if (version >= ZE_API_VERSION_1_9) { + dditable.pfnDestroyExp = pDdiTable->pfnDestroyExp; + pDdiTable->pfnDestroyExp = validation_layer::zetMetricGroupDestroyExp; + } return result; } @@ -3831,24 +3869,27 @@ zetGetMetricQueryProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetMetricQueryCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetMetricQueryDestroy; - - dditable.pfnReset = pDdiTable->pfnReset; - pDdiTable->pfnReset = validation_layer::zetMetricQueryReset; - - dditable.pfnGetData = pDdiTable->pfnGetData; - pDdiTable->pfnGetData = validation_layer::zetMetricQueryGetData; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetMetricQueryCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetMetricQueryDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReset = pDdiTable->pfnReset; + pDdiTable->pfnReset = validation_layer::zetMetricQueryReset; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnGetData = pDdiTable->pfnGetData; + pDdiTable->pfnGetData = validation_layer::zetMetricQueryGetData; + } return result; } @@ -3871,18 +3912,19 @@ zetGetMetricQueryPoolProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetMetricQueryPoolCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetMetricQueryPoolDestroy; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetMetricQueryPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetMetricQueryPoolDestroy; + } return result; } @@ -3905,21 +3947,23 @@ zetGetMetricStreamerProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnOpen = pDdiTable->pfnOpen; - pDdiTable->pfnOpen = validation_layer::zetMetricStreamerOpen; - - dditable.pfnClose = pDdiTable->pfnClose; - pDdiTable->pfnClose = validation_layer::zetMetricStreamerClose; - - dditable.pfnReadData = pDdiTable->pfnReadData; - pDdiTable->pfnReadData = validation_layer::zetMetricStreamerReadData; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnOpen = pDdiTable->pfnOpen; + pDdiTable->pfnOpen = validation_layer::zetMetricStreamerOpen; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnClose = pDdiTable->pfnClose; + pDdiTable->pfnClose = validation_layer::zetMetricStreamerClose; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnReadData = pDdiTable->pfnReadData; + pDdiTable->pfnReadData = validation_layer::zetMetricStreamerReadData; + } return result; } @@ -3942,27 +3986,31 @@ zetGetTracerExpProcAddrTable( if( nullptr == pDdiTable ) return ZE_RESULT_ERROR_INVALID_NULL_POINTER; - if (ZE_MAJOR_VERSION(validation_layer::context.version) != ZE_MAJOR_VERSION(version) || - ZE_MINOR_VERSION(validation_layer::context.version) > ZE_MINOR_VERSION(version)) + if (validation_layer::context.version < version) return ZE_RESULT_ERROR_UNSUPPORTED_VERSION; ze_result_t result = ZE_RESULT_SUCCESS; - dditable.pfnCreate = pDdiTable->pfnCreate; - pDdiTable->pfnCreate = validation_layer::zetTracerExpCreate; - - dditable.pfnDestroy = pDdiTable->pfnDestroy; - pDdiTable->pfnDestroy = validation_layer::zetTracerExpDestroy; - - dditable.pfnSetPrologues = pDdiTable->pfnSetPrologues; - pDdiTable->pfnSetPrologues = validation_layer::zetTracerExpSetPrologues; - - dditable.pfnSetEpilogues = pDdiTable->pfnSetEpilogues; - pDdiTable->pfnSetEpilogues = validation_layer::zetTracerExpSetEpilogues; - - dditable.pfnSetEnabled = pDdiTable->pfnSetEnabled; - pDdiTable->pfnSetEnabled = validation_layer::zetTracerExpSetEnabled; - + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnCreate = pDdiTable->pfnCreate; + pDdiTable->pfnCreate = validation_layer::zetTracerExpCreate; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnDestroy = pDdiTable->pfnDestroy; + pDdiTable->pfnDestroy = validation_layer::zetTracerExpDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetPrologues = pDdiTable->pfnSetPrologues; + pDdiTable->pfnSetPrologues = validation_layer::zetTracerExpSetPrologues; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEpilogues = pDdiTable->pfnSetEpilogues; + pDdiTable->pfnSetEpilogues = validation_layer::zetTracerExpSetEpilogues; + } + if (version >= ZE_API_VERSION_1_0) { + dditable.pfnSetEnabled = pDdiTable->pfnSetEnabled; + pDdiTable->pfnSetEnabled = validation_layer::zetTracerExpSetEnabled; + } return result; } diff --git a/source/loader/ze_ldrddi.cpp b/source/loader/ze_ldrddi.cpp index 8d080a5c..9890e2db 100644 --- a/source/loader/ze_ldrddi.cpp +++ b/source/loader/ze_ldrddi.cpp @@ -6569,8 +6569,12 @@ zeGetGlobalProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnInit = loader::zeInit; - pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInit = loader::zeInit; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnInitDrivers = loader::zeInitDrivers; + } } else { @@ -6653,10 +6657,18 @@ zeGetRTASBuilderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zeRTASBuilderCreateExp; - pDdiTable->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; - pDdiTable->pfnBuildExp = loader::zeRTASBuilderBuildExp; - pDdiTable->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnCreateExp = loader::zeRTASBuilderCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetBuildPropertiesExp = loader::zeRTASBuilderGetBuildPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnBuildExp = loader::zeRTASBuilderBuildExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnDestroyExp = loader::zeRTASBuilderDestroyExp; + } } else { @@ -6739,10 +6751,18 @@ zeGetRTASParallelOperationExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; - pDdiTable->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; - pDdiTable->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; - pDdiTable->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnCreateExp = loader::zeRTASParallelOperationCreateExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetPropertiesExp = loader::zeRTASParallelOperationGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnJoinExp = loader::zeRTASParallelOperationJoinExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnDestroyExp = loader::zeRTASParallelOperationDestroyExp; + } } else { @@ -6834,13 +6854,27 @@ zeGetDriverProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zeDriverGet; - pDdiTable->pfnGetApiVersion = loader::zeDriverGetApiVersion; - pDdiTable->pfnGetProperties = loader::zeDriverGetProperties; - pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; - pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; - pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; - pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zeDriverGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetApiVersion = loader::zeDriverGetApiVersion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeDriverGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcProperties = loader::zeDriverGetIpcProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription; + } } else { @@ -6923,7 +6957,9 @@ zeGetDriverExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnRTASFormatCompatibilityCheckExp = loader::zeDriverRTASFormatCompatibilityCheckExp; + } } else { @@ -7015,27 +7051,69 @@ zeGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zeDeviceGet; - pDdiTable->pfnGetSubDevices = loader::zeDeviceGetSubDevices; - pDdiTable->pfnGetProperties = loader::zeDeviceGetProperties; - pDdiTable->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; - pDdiTable->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; - pDdiTable->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; - pDdiTable->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; - pDdiTable->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; - pDdiTable->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; - pDdiTable->pfnGetImageProperties = loader::zeDeviceGetImageProperties; - pDdiTable->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; - pDdiTable->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; - pDdiTable->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; - pDdiTable->pfnGetStatus = loader::zeDeviceGetStatus; - pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; - pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; - pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; - pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; - pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; - pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; - pDdiTable->pfnGetRootDevice = loader::zeDeviceGetRootDevice; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zeDeviceGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetSubDevices = loader::zeDeviceGetSubDevices; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetComputeProperties = loader::zeDeviceGetComputeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetModuleProperties = loader::zeDeviceGetModuleProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCommandQueueGroupProperties = loader::zeDeviceGetCommandQueueGroupProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMemoryProperties = loader::zeDeviceGetMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMemoryAccessProperties = loader::zeDeviceGetMemoryAccessProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCacheProperties = loader::zeDeviceGetCacheProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetImageProperties = loader::zeDeviceGetImageProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetExternalMemoryProperties = loader::zeDeviceGetExternalMemoryProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetP2PProperties = loader::zeDeviceGetP2PProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCanAccessPeer = loader::zeDeviceCanAccessPeer; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStatus = loader::zeDeviceGetStatus; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetRootDevice = loader::zeDeviceGetRootDevice; + } } else { @@ -7118,7 +7196,9 @@ zeGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetFabricVertexExp = loader::zeDeviceGetFabricVertexExp; + } } else { @@ -7210,15 +7290,33 @@ zeGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeContextCreate; - pDdiTable->pfnDestroy = loader::zeContextDestroy; - pDdiTable->pfnGetStatus = loader::zeContextGetStatus; - pDdiTable->pfnSystemBarrier = loader::zeContextSystemBarrier; - pDdiTable->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; - pDdiTable->pfnEvictMemory = loader::zeContextEvictMemory; - pDdiTable->pfnMakeImageResident = loader::zeContextMakeImageResident; - pDdiTable->pfnEvictImage = loader::zeContextEvictImage; - pDdiTable->pfnCreateEx = loader::zeContextCreateEx; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeContextCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeContextDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStatus = loader::zeContextGetStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSystemBarrier = loader::zeContextSystemBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMakeMemoryResident = loader::zeContextMakeMemoryResident; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEvictMemory = loader::zeContextEvictMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMakeImageResident = loader::zeContextMakeImageResident; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEvictImage = loader::zeContextEvictImage; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnCreateEx = loader::zeContextCreateEx; + } } else { @@ -7310,12 +7408,24 @@ zeGetCommandQueueProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeCommandQueueCreate; - pDdiTable->pfnDestroy = loader::zeCommandQueueDestroy; - pDdiTable->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; - pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; - pDdiTable->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; - pDdiTable->pfnGetIndex = loader::zeCommandQueueGetIndex; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeCommandQueueCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeCommandQueueDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnExecuteCommandLists = loader::zeCommandQueueExecuteCommandLists; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSynchronize = loader::zeCommandQueueSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetOrdinal = loader::zeCommandQueueGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetIndex = loader::zeCommandQueueGetIndex; + } } else { @@ -7407,42 +7517,114 @@ zeGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeCommandListCreate; - pDdiTable->pfnCreateImmediate = loader::zeCommandListCreateImmediate; - pDdiTable->pfnDestroy = loader::zeCommandListDestroy; - pDdiTable->pfnClose = loader::zeCommandListClose; - pDdiTable->pfnReset = loader::zeCommandListReset; - pDdiTable->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; - pDdiTable->pfnAppendBarrier = loader::zeCommandListAppendBarrier; - pDdiTable->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; - pDdiTable->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; - pDdiTable->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; - pDdiTable->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; - pDdiTable->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; - pDdiTable->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; - pDdiTable->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; - pDdiTable->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; - pDdiTable->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; - pDdiTable->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; - pDdiTable->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; - pDdiTable->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; - pDdiTable->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; - pDdiTable->pfnAppendEventReset = loader::zeCommandListAppendEventReset; - pDdiTable->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; - pDdiTable->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; - pDdiTable->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; - pDdiTable->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; - pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; - pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; - pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; - pDdiTable->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; - pDdiTable->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; - pDdiTable->pfnHostSynchronize = loader::zeCommandListHostSynchronize; - pDdiTable->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; - pDdiTable->pfnGetContextHandle = loader::zeCommandListGetContextHandle; - pDdiTable->pfnGetOrdinal = loader::zeCommandListGetOrdinal; - pDdiTable->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; - pDdiTable->pfnIsImmediate = loader::zeCommandListIsImmediate; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeCommandListCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreateImmediate = loader::zeCommandListCreateImmediate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeCommandListDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClose = loader::zeCommandListClose; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zeCommandListReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendWriteGlobalTimestamp = loader::zeCommandListAppendWriteGlobalTimestamp; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendBarrier = loader::zeCommandListAppendBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryRangesBarrier = loader::zeCommandListAppendMemoryRangesBarrier; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopy = loader::zeCommandListAppendMemoryCopy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryFill = loader::zeCommandListAppendMemoryFill; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopyRegion = loader::zeCommandListAppendMemoryCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryCopyFromContext = loader::zeCommandListAppendMemoryCopyFromContext; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopy = loader::zeCommandListAppendImageCopy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyRegion = loader::zeCommandListAppendImageCopyRegion; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyToMemory = loader::zeCommandListAppendImageCopyToMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendImageCopyFromMemory = loader::zeCommandListAppendImageCopyFromMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemoryPrefetch = loader::zeCommandListAppendMemoryPrefetch; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMemAdvise = loader::zeCommandListAppendMemAdvise; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendSignalEvent = loader::zeCommandListAppendSignalEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendWaitOnEvents = loader::zeCommandListAppendWaitOnEvents; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendEventReset = loader::zeCommandListAppendEventReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendQueryKernelTimestamps = loader::zeCommandListAppendQueryKernelTimestamps; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchKernel = loader::zeCommandListAppendLaunchKernel; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchCooperativeKernel = loader::zeCommandListAppendLaunchCooperativeKernel; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchKernelIndirect = loader::zeCommandListAppendLaunchKernelIndirect; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendLaunchMultipleKernelsIndirect = loader::zeCommandListAppendLaunchMultipleKernelsIndirect; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnAppendSignalExternalSemaphoreExt = loader::zeCommandListAppendSignalExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnAppendWaitExternalSemaphoreExt = loader::zeCommandListAppendWaitExternalSemaphoreExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnAppendImageCopyToMemoryExt = loader::zeCommandListAppendImageCopyToMemoryExt; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnAppendImageCopyFromMemoryExt = loader::zeCommandListAppendImageCopyFromMemoryExt; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnHostSynchronize = loader::zeCommandListHostSynchronize; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceHandle = loader::zeCommandListGetDeviceHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetContextHandle = loader::zeCommandListGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetOrdinal = loader::zeCommandListGetOrdinal; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnImmediateGetIndex = loader::zeCommandListImmediateGetIndex; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnIsImmediate = loader::zeCommandListIsImmediate; + } } else { @@ -7525,14 +7707,30 @@ zeGetCommandListExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; - pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; - pDdiTable->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; - pDdiTable->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; - pDdiTable->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; - pDdiTable->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; - pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; - pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetNextCommandIdWithKernelsExp = loader::zeCommandListGetNextCommandIdWithKernelsExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnUpdateMutableCommandKernelsExp = loader::zeCommandListUpdateMutableCommandKernelsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateCloneExp = loader::zeCommandListCreateCloneExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnImmediateAppendCommandListsExp = loader::zeCommandListImmediateAppendCommandListsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetNextCommandIdExp = loader::zeCommandListGetNextCommandIdExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandsExp = loader::zeCommandListUpdateMutableCommandsExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandSignalEventExp = loader::zeCommandListUpdateMutableCommandSignalEventExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnUpdateMutableCommandWaitEventsExp = loader::zeCommandListUpdateMutableCommandWaitEventsExp; + } } else { @@ -7624,17 +7822,39 @@ zeGetEventProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeEventCreate; - pDdiTable->pfnDestroy = loader::zeEventDestroy; - pDdiTable->pfnHostSignal = loader::zeEventHostSignal; - pDdiTable->pfnHostSynchronize = loader::zeEventHostSynchronize; - pDdiTable->pfnQueryStatus = loader::zeEventQueryStatus; - pDdiTable->pfnHostReset = loader::zeEventHostReset; - pDdiTable->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; - pDdiTable->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; - pDdiTable->pfnGetEventPool = loader::zeEventGetEventPool; - pDdiTable->pfnGetSignalScope = loader::zeEventGetSignalScope; - pDdiTable->pfnGetWaitScope = loader::zeEventGetWaitScope; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeEventCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeEventDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSignal = loader::zeEventHostSignal; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSynchronize = loader::zeEventHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryStatus = loader::zeEventQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostReset = loader::zeEventHostReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryKernelTimestamp = loader::zeEventQueryKernelTimestamp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnQueryKernelTimestampsExt = loader::zeEventQueryKernelTimestampsExt; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetEventPool = loader::zeEventGetEventPool; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSignalScope = loader::zeEventGetSignalScope; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetWaitScope = loader::zeEventGetWaitScope; + } } else { @@ -7717,7 +7937,9 @@ zeGetEventExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnQueryTimestampsExp = loader::zeEventQueryTimestampsExp; + } } else { @@ -7809,14 +8031,30 @@ zeGetEventPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeEventPoolCreate; - pDdiTable->pfnDestroy = loader::zeEventPoolDestroy; - pDdiTable->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; - pDdiTable->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; - pDdiTable->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; - pDdiTable->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; - pDdiTable->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; - pDdiTable->pfnGetFlags = loader::zeEventPoolGetFlags; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeEventPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeEventPoolDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcHandle = loader::zeEventPoolGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpenIpcHandle = loader::zeEventPoolOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCloseIpcHandle = loader::zeEventPoolCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnPutIpcHandle = loader::zeEventPoolPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetContextHandle = loader::zeEventPoolGetContextHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetFlags = loader::zeEventPoolGetFlags; + } } else { @@ -7908,11 +8146,21 @@ zeGetFenceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeFenceCreate; - pDdiTable->pfnDestroy = loader::zeFenceDestroy; - pDdiTable->pfnHostSynchronize = loader::zeFenceHostSynchronize; - pDdiTable->pfnQueryStatus = loader::zeFenceQueryStatus; - pDdiTable->pfnReset = loader::zeFenceReset; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeFenceCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeFenceDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnHostSynchronize = loader::zeFenceHostSynchronize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryStatus = loader::zeFenceQueryStatus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zeFenceReset; + } } else { @@ -8004,11 +8252,21 @@ zeGetImageProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zeImageGetProperties; - pDdiTable->pfnCreate = loader::zeImageCreate; - pDdiTable->pfnDestroy = loader::zeImageDestroy; - pDdiTable->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; - pDdiTable->pfnViewCreateExt = loader::zeImageViewCreateExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeImageGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeImageCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeImageDestroy; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnGetAllocPropertiesExt = loader::zeImageGetAllocPropertiesExt; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnViewCreateExt = loader::zeImageViewCreateExt; + } } else { @@ -8091,9 +8349,15 @@ zeGetImageExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; - pDdiTable->pfnViewCreateExp = loader::zeImageViewCreateExp; - pDdiTable->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnGetMemoryPropertiesExp = loader::zeImageGetMemoryPropertiesExp; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnViewCreateExp = loader::zeImageViewCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceOffsetExp = loader::zeImageGetDeviceOffsetExp; + } } else { @@ -8185,18 +8449,42 @@ zeGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeKernelCreate; - pDdiTable->pfnDestroy = loader::zeKernelDestroy; - pDdiTable->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; - pDdiTable->pfnSetGroupSize = loader::zeKernelSetGroupSize; - pDdiTable->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; - pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; - pDdiTable->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; - pDdiTable->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; - pDdiTable->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; - pDdiTable->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; - pDdiTable->pfnGetProperties = loader::zeKernelGetProperties; - pDdiTable->pfnGetName = loader::zeKernelGetName; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeKernelCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeKernelDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetCacheConfig = loader::zeKernelSetCacheConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetGroupSize = loader::zeKernelSetGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSuggestGroupSize = loader::zeKernelSuggestGroupSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSuggestMaxCooperativeGroupCount = loader::zeKernelSuggestMaxCooperativeGroupCount; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetArgumentValue = loader::zeKernelSetArgumentValue; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetIndirectAccess = loader::zeKernelSetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIndirectAccess = loader::zeKernelGetIndirectAccess; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetSourceAttributes = loader::zeKernelGetSourceAttributes; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeKernelGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetName = loader::zeKernelGetName; + } } else { @@ -8279,9 +8567,15 @@ zeGetKernelExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; - pDdiTable->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; - pDdiTable->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnSetGlobalOffsetExp = loader::zeKernelSetGlobalOffsetExp; + } + if (version >= ZE_API_VERSION_1_11) { + pDdiTable->pfnGetBinaryExp = loader::zeKernelGetBinaryExp; + } + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnSchedulingHintExp = loader::zeKernelSchedulingHintExp; + } } else { @@ -8373,18 +8667,42 @@ zeGetMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAllocShared = loader::zeMemAllocShared; - pDdiTable->pfnAllocDevice = loader::zeMemAllocDevice; - pDdiTable->pfnAllocHost = loader::zeMemAllocHost; - pDdiTable->pfnFree = loader::zeMemFree; - pDdiTable->pfnGetAllocProperties = loader::zeMemGetAllocProperties; - pDdiTable->pfnGetAddressRange = loader::zeMemGetAddressRange; - pDdiTable->pfnGetIpcHandle = loader::zeMemGetIpcHandle; - pDdiTable->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; - pDdiTable->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; - pDdiTable->pfnFreeExt = loader::zeMemFreeExt; - pDdiTable->pfnPutIpcHandle = loader::zeMemPutIpcHandle; - pDdiTable->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocShared = loader::zeMemAllocShared; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocDevice = loader::zeMemAllocDevice; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAllocHost = loader::zeMemAllocHost; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFree = loader::zeMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAllocProperties = loader::zeMemGetAllocProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAddressRange = loader::zeMemGetAddressRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetIpcHandle = loader::zeMemGetIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpenIpcHandle = loader::zeMemOpenIpcHandle; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCloseIpcHandle = loader::zeMemCloseIpcHandle; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnFreeExt = loader::zeMemFreeExt; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnPutIpcHandle = loader::zeMemPutIpcHandle; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetPitchFor2dImage = loader::zeMemGetPitchFor2dImage; + } } else { @@ -8467,10 +8785,18 @@ zeGetMemExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; - pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; - pDdiTable->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; - pDdiTable->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetIpcHandleFromFileDescriptorExp = loader::zeMemGetIpcHandleFromFileDescriptorExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetFileDescriptorFromIpcHandleExp = loader::zeMemGetFileDescriptorFromIpcHandleExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnSetAtomicAccessAttributeExp = loader::zeMemSetAtomicAccessAttributeExp; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetAtomicAccessAttributeExp = loader::zeMemGetAtomicAccessAttributeExp; + } } else { @@ -8562,15 +8888,33 @@ zeGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeModuleCreate; - pDdiTable->pfnDestroy = loader::zeModuleDestroy; - pDdiTable->pfnDynamicLink = loader::zeModuleDynamicLink; - pDdiTable->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; - pDdiTable->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; - pDdiTable->pfnGetKernelNames = loader::zeModuleGetKernelNames; - pDdiTable->pfnGetProperties = loader::zeModuleGetProperties; - pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; - pDdiTable->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeModuleCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeModuleDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDynamicLink = loader::zeModuleDynamicLink; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetNativeBinary = loader::zeModuleGetNativeBinary; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetGlobalPointer = loader::zeModuleGetGlobalPointer; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetKernelNames = loader::zeModuleGetKernelNames; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zeModuleGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetFunctionPointer = loader::zeModuleGetFunctionPointer; + } + if (version >= ZE_API_VERSION_1_3) { + pDdiTable->pfnInspectLinkageExt = loader::zeModuleInspectLinkageExt; + } } else { @@ -8662,8 +9006,12 @@ zeGetModuleBuildLogProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnDestroy = loader::zeModuleBuildLogDestroy; - pDdiTable->pfnGetString = loader::zeModuleBuildLogGetString; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeModuleBuildLogDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetString = loader::zeModuleBuildLogGetString; + } } else { @@ -8755,8 +9103,12 @@ zeGetPhysicalMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zePhysicalMemCreate; - pDdiTable->pfnDestroy = loader::zePhysicalMemDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zePhysicalMemCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zePhysicalMemDestroy; + } } else { @@ -8848,8 +9200,12 @@ zeGetSamplerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zeSamplerCreate; - pDdiTable->pfnDestroy = loader::zeSamplerDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zeSamplerCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zeSamplerDestroy; + } } else { @@ -8941,13 +9297,27 @@ zeGetVirtualMemProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnReserve = loader::zeVirtualMemReserve; - pDdiTable->pfnFree = loader::zeVirtualMemFree; - pDdiTable->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; - pDdiTable->pfnMap = loader::zeVirtualMemMap; - pDdiTable->pfnUnmap = loader::zeVirtualMemUnmap; - pDdiTable->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; - pDdiTable->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReserve = loader::zeVirtualMemReserve; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFree = loader::zeVirtualMemFree; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnQueryPageSize = loader::zeVirtualMemQueryPageSize; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnMap = loader::zeVirtualMemMap; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnUnmap = loader::zeVirtualMemUnmap; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetAccessAttribute = loader::zeVirtualMemSetAccessAttribute; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAccessAttribute = loader::zeVirtualMemGetAccessAttribute; + } } else { @@ -9030,9 +9400,15 @@ zeGetFabricEdgeExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zeFabricEdgeGetExp; - pDdiTable->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; - pDdiTable->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetExp = loader::zeFabricEdgeGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetVerticesExp = loader::zeFabricEdgeGetVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetPropertiesExp = loader::zeFabricEdgeGetPropertiesExp; + } } else { @@ -9115,10 +9491,18 @@ zeGetFabricVertexExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zeFabricVertexGetExp; - pDdiTable->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; - pDdiTable->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; - pDdiTable->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetExp = loader::zeFabricVertexGetExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetSubVerticesExp = loader::zeFabricVertexGetSubVerticesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetPropertiesExp = loader::zeFabricVertexGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetDeviceExp = loader::zeFabricVertexGetDeviceExp; + } } else { diff --git a/source/loader/zes_ldrddi.cpp b/source/loader/zes_ldrddi.cpp index 0edb0846..de3a665a 100644 --- a/source/loader/zes_ldrddi.cpp +++ b/source/loader/zes_ldrddi.cpp @@ -4639,7 +4639,9 @@ zesGetGlobalProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnInit = loader::zesInit; + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnInit = loader::zesInit; + } } else { @@ -4715,43 +4717,117 @@ zesGetDeviceProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesDeviceGetProperties; - pDdiTable->pfnGetState = loader::zesDeviceGetState; - pDdiTable->pfnReset = loader::zesDeviceReset; - pDdiTable->pfnProcessesGetState = loader::zesDeviceProcessesGetState; - pDdiTable->pfnPciGetProperties = loader::zesDevicePciGetProperties; - pDdiTable->pfnPciGetState = loader::zesDevicePciGetState; - pDdiTable->pfnPciGetBars = loader::zesDevicePciGetBars; - pDdiTable->pfnPciGetStats = loader::zesDevicePciGetStats; - pDdiTable->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; - pDdiTable->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; - pDdiTable->pfnEventRegister = loader::zesDeviceEventRegister; - pDdiTable->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; - pDdiTable->pfnEnumFans = loader::zesDeviceEnumFans; - pDdiTable->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; - pDdiTable->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; - pDdiTable->pfnEnumLeds = loader::zesDeviceEnumLeds; - pDdiTable->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; - pDdiTable->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; - pDdiTable->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; - pDdiTable->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; - pDdiTable->pfnEnumPsus = loader::zesDeviceEnumPsus; - pDdiTable->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; - pDdiTable->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; - pDdiTable->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; - pDdiTable->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; - pDdiTable->pfnEccAvailable = loader::zesDeviceEccAvailable; - pDdiTable->pfnEccConfigurable = loader::zesDeviceEccConfigurable; - pDdiTable->pfnGetEccState = loader::zesDeviceGetEccState; - pDdiTable->pfnSetEccState = loader::zesDeviceSetEccState; - pDdiTable->pfnGet = loader::zesDeviceGet; - pDdiTable->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; - pDdiTable->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; - pDdiTable->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; - pDdiTable->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; - pDdiTable->pfnReadOverclockState = loader::zesDeviceReadOverclockState; - pDdiTable->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; - pDdiTable->pfnResetExt = loader::zesDeviceResetExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesDeviceGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesDeviceGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zesDeviceReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnProcessesGetState = loader::zesDeviceProcessesGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetProperties = loader::zesDevicePciGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetState = loader::zesDevicePciGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetBars = loader::zesDevicePciGetBars; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnPciGetStats = loader::zesDevicePciGetStats; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumDiagnosticTestSuites = loader::zesDeviceEnumDiagnosticTestSuites; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumEngineGroups = loader::zesDeviceEnumEngineGroups; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEventRegister = loader::zesDeviceEventRegister; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFabricPorts = loader::zesDeviceEnumFabricPorts; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFans = loader::zesDeviceEnumFans; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFirmwares = loader::zesDeviceEnumFirmwares; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumFrequencyDomains = loader::zesDeviceEnumFrequencyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumLeds = loader::zesDeviceEnumLeds; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumMemoryModules = loader::zesDeviceEnumMemoryModules; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPerformanceFactorDomains = loader::zesDeviceEnumPerformanceFactorDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPowerDomains = loader::zesDeviceEnumPowerDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCardPowerDomain = loader::zesDeviceGetCardPowerDomain; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumPsus = loader::zesDeviceEnumPsus; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumRasErrorSets = loader::zesDeviceEnumRasErrorSets; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumSchedulers = loader::zesDeviceEnumSchedulers; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumStandbyDomains = loader::zesDeviceEnumStandbyDomains; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEnumTemperatureSensors = loader::zesDeviceEnumTemperatureSensors; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnEccAvailable = loader::zesDeviceEccAvailable; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnEccConfigurable = loader::zesDeviceEccConfigurable; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnGetEccState = loader::zesDeviceGetEccState; + } + if (version >= ZE_API_VERSION_1_4) { + pDdiTable->pfnSetEccState = loader::zesDeviceSetEccState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGet = loader::zesDeviceGet; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetOverclockWaiver = loader::zesDeviceSetOverclockWaiver; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetOverclockDomains = loader::zesDeviceGetOverclockDomains; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetOverclockControls = loader::zesDeviceGetOverclockControls; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnResetOverclockSettings = loader::zesDeviceResetOverclockSettings; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnReadOverclockState = loader::zesDeviceReadOverclockState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnEnumOverclockDomains = loader::zesDeviceEnumOverclockDomains; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnResetExt = loader::zesDeviceResetExt; + } } else { @@ -4818,9 +4894,15 @@ zesGetDeviceExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; - pDdiTable->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; - pDdiTable->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnEnumEnabledVFExp = loader::zesDeviceEnumEnabledVFExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSubDevicePropertiesExp = loader::zesDeviceGetSubDevicePropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnEnumActiveVFExp = loader::zesDeviceEnumActiveVFExp; + } } else { @@ -4896,11 +4978,21 @@ zesGetDriverProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnEventListen = loader::zesDriverEventListen; - pDdiTable->pfnEventListenEx = loader::zesDriverEventListenEx; - pDdiTable->pfnGet = loader::zesDriverGet; - pDdiTable->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; - pDdiTable->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnEventListen = loader::zesDriverEventListen; + } + if (version >= ZE_API_VERSION_1_1) { + pDdiTable->pfnEventListenEx = loader::zesDriverEventListenEx; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGet = loader::zesDriverGet; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetExtensionProperties = loader::zesDriverGetExtensionProperties; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetExtensionFunctionAddress = loader::zesDriverGetExtensionFunctionAddress; + } } else { @@ -4967,7 +5059,9 @@ zesGetDriverExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetDeviceByUuidExp = loader::zesDriverGetDeviceByUuidExp; + } } else { @@ -5043,9 +5137,15 @@ zesGetDiagnosticsProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesDiagnosticsGetProperties; - pDdiTable->pfnGetTests = loader::zesDiagnosticsGetTests; - pDdiTable->pfnRunTests = loader::zesDiagnosticsRunTests; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesDiagnosticsGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTests = loader::zesDiagnosticsGetTests; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnRunTests = loader::zesDiagnosticsRunTests; + } } else { @@ -5121,9 +5221,15 @@ zesGetEngineProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesEngineGetProperties; - pDdiTable->pfnGetActivity = loader::zesEngineGetActivity; - pDdiTable->pfnGetActivityExt = loader::zesEngineGetActivityExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesEngineGetProperties; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetActivity = loader::zesEngineGetActivity; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetActivityExt = loader::zesEngineGetActivityExt; + } } else { @@ -5199,14 +5305,30 @@ zesGetFabricPortProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFabricPortGetProperties; - pDdiTable->pfnGetLinkType = loader::zesFabricPortGetLinkType; - pDdiTable->pfnGetConfig = loader::zesFabricPortGetConfig; - pDdiTable->pfnSetConfig = loader::zesFabricPortSetConfig; - pDdiTable->pfnGetState = loader::zesFabricPortGetState; - pDdiTable->pfnGetThroughput = loader::zesFabricPortGetThroughput; - pDdiTable->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; - pDdiTable->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFabricPortGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLinkType = loader::zesFabricPortGetLinkType; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesFabricPortGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesFabricPortSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFabricPortGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetThroughput = loader::zesFabricPortGetThroughput; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetFabricErrorCounters = loader::zesFabricPortGetFabricErrorCounters; + } + if (version >= ZE_API_VERSION_1_7) { + pDdiTable->pfnGetMultiPortThroughput = loader::zesFabricPortGetMultiPortThroughput; + } } else { @@ -5282,12 +5404,24 @@ zesGetFanProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFanGetProperties; - pDdiTable->pfnGetConfig = loader::zesFanGetConfig; - pDdiTable->pfnSetDefaultMode = loader::zesFanSetDefaultMode; - pDdiTable->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; - pDdiTable->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; - pDdiTable->pfnGetState = loader::zesFanGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFanGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesFanGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetDefaultMode = loader::zesFanSetDefaultMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetFixedSpeedMode = loader::zesFanSetFixedSpeedMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetSpeedTableMode = loader::zesFanSetSpeedTableMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFanGetState; + } } else { @@ -5363,10 +5497,18 @@ zesGetFirmwareProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFirmwareGetProperties; - pDdiTable->pfnFlash = loader::zesFirmwareFlash; - pDdiTable->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; - pDdiTable->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFirmwareGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnFlash = loader::zesFirmwareFlash; + } + if (version >= ZE_API_VERSION_1_8) { + pDdiTable->pfnGetFlashProgress = loader::zesFirmwareGetFlashProgress; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetConsoleLogs = loader::zesFirmwareGetConsoleLogs; + } } else { @@ -5433,8 +5575,12 @@ zesGetFirmwareExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; - pDdiTable->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetSecurityVersionExp = loader::zesFirmwareGetSecurityVersionExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetSecurityVersionExp = loader::zesFirmwareSetSecurityVersionExp; + } } else { @@ -5510,23 +5656,57 @@ zesGetFrequencyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesFrequencyGetProperties; - pDdiTable->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; - pDdiTable->pfnGetRange = loader::zesFrequencyGetRange; - pDdiTable->pfnSetRange = loader::zesFrequencySetRange; - pDdiTable->pfnGetState = loader::zesFrequencyGetState; - pDdiTable->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; - pDdiTable->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; - pDdiTable->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; - pDdiTable->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; - pDdiTable->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; - pDdiTable->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; - pDdiTable->pfnOcSetMode = loader::zesFrequencyOcSetMode; - pDdiTable->pfnOcGetMode = loader::zesFrequencyOcGetMode; - pDdiTable->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; - pDdiTable->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; - pDdiTable->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; - pDdiTable->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesFrequencyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetAvailableClocks = loader::zesFrequencyGetAvailableClocks; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetRange = loader::zesFrequencyGetRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetRange = loader::zesFrequencySetRange; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesFrequencyGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetThrottleTime = loader::zesFrequencyGetThrottleTime; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetCapabilities = loader::zesFrequencyOcGetCapabilities; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetFrequencyTarget = loader::zesFrequencyOcGetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetFrequencyTarget = loader::zesFrequencyOcSetFrequencyTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetVoltageTarget = loader::zesFrequencyOcGetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetVoltageTarget = loader::zesFrequencyOcSetVoltageTarget; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetMode = loader::zesFrequencyOcSetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetMode = loader::zesFrequencyOcGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetIccMax = loader::zesFrequencyOcGetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetIccMax = loader::zesFrequencyOcSetIccMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcGetTjMax = loader::zesFrequencyOcGetTjMax; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOcSetTjMax = loader::zesFrequencyOcSetTjMax; + } } else { @@ -5602,10 +5782,18 @@ zesGetLedProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesLedGetProperties; - pDdiTable->pfnGetState = loader::zesLedGetState; - pDdiTable->pfnSetState = loader::zesLedSetState; - pDdiTable->pfnSetColor = loader::zesLedSetColor; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesLedGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesLedGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetState = loader::zesLedSetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetColor = loader::zesLedSetColor; + } } else { @@ -5681,9 +5869,15 @@ zesGetMemoryProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesMemoryGetProperties; - pDdiTable->pfnGetState = loader::zesMemoryGetState; - pDdiTable->pfnGetBandwidth = loader::zesMemoryGetBandwidth; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesMemoryGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesMemoryGetState; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetBandwidth = loader::zesMemoryGetBandwidth; + } } else { @@ -5763,15 +5957,33 @@ zesGetOverclockProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; - pDdiTable->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; - pDdiTable->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; - pDdiTable->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; - pDdiTable->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; - pDdiTable->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; - pDdiTable->pfnGetControlState = loader::zesOverclockGetControlState; - pDdiTable->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; - pDdiTable->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainProperties = loader::zesOverclockGetDomainProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainVFProperties = loader::zesOverclockGetDomainVFProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetDomainControlProperties = loader::zesOverclockGetDomainControlProperties; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlCurrentValue = loader::zesOverclockGetControlCurrentValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlPendingValue = loader::zesOverclockGetControlPendingValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetControlUserValue = loader::zesOverclockSetControlUserValue; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetControlState = loader::zesOverclockGetControlState; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetVFPointValues = loader::zesOverclockGetVFPointValues; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnSetVFPointValues = loader::zesOverclockSetVFPointValues; + } } else { @@ -5847,9 +6059,15 @@ zesGetPerformanceFactorProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPerformanceFactorGetProperties; - pDdiTable->pfnGetConfig = loader::zesPerformanceFactorGetConfig; - pDdiTable->pfnSetConfig = loader::zesPerformanceFactorSetConfig; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPerformanceFactorGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesPerformanceFactorGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesPerformanceFactorSetConfig; + } } else { @@ -5925,14 +6143,30 @@ zesGetPowerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPowerGetProperties; - pDdiTable->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; - pDdiTable->pfnGetLimits = loader::zesPowerGetLimits; - pDdiTable->pfnSetLimits = loader::zesPowerSetLimits; - pDdiTable->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; - pDdiTable->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; - pDdiTable->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; - pDdiTable->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPowerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetEnergyCounter = loader::zesPowerGetEnergyCounter; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLimits = loader::zesPowerGetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetLimits = loader::zesPowerSetLimits; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetEnergyThreshold = loader::zesPowerGetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEnergyThreshold = loader::zesPowerSetEnergyThreshold; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetLimitsExt = loader::zesPowerGetLimitsExt; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetLimitsExt = loader::zesPowerSetLimitsExt; + } } else { @@ -6008,8 +6242,12 @@ zesGetPsuProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesPsuGetProperties; - pDdiTable->pfnGetState = loader::zesPsuGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesPsuGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesPsuGetState; + } } else { @@ -6085,10 +6323,18 @@ zesGetRasProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesRasGetProperties; - pDdiTable->pfnGetConfig = loader::zesRasGetConfig; - pDdiTable->pfnSetConfig = loader::zesRasSetConfig; - pDdiTable->pfnGetState = loader::zesRasGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesRasGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesRasGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesRasSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesRasGetState; + } } else { @@ -6155,8 +6401,12 @@ zesGetRasExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetStateExp = loader::zesRasGetStateExp; - pDdiTable->pfnClearStateExp = loader::zesRasClearStateExp; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetStateExp = loader::zesRasGetStateExp; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClearStateExp = loader::zesRasClearStateExp; + } } else { @@ -6232,14 +6482,30 @@ zesGetSchedulerProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesSchedulerGetProperties; - pDdiTable->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; - pDdiTable->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; - pDdiTable->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; - pDdiTable->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; - pDdiTable->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; - pDdiTable->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; - pDdiTable->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesSchedulerGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetCurrentMode = loader::zesSchedulerGetCurrentMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTimeoutModeProperties = loader::zesSchedulerGetTimeoutModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetTimesliceModeProperties = loader::zesSchedulerGetTimesliceModeProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetTimeoutMode = loader::zesSchedulerSetTimeoutMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetTimesliceMode = loader::zesSchedulerSetTimesliceMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetExclusiveMode = loader::zesSchedulerSetExclusiveMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetComputeUnitDebugMode = loader::zesSchedulerSetComputeUnitDebugMode; + } } else { @@ -6315,9 +6581,15 @@ zesGetStandbyProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesStandbyGetProperties; - pDdiTable->pfnGetMode = loader::zesStandbyGetMode; - pDdiTable->pfnSetMode = loader::zesStandbySetMode; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesStandbyGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetMode = loader::zesStandbyGetMode; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetMode = loader::zesStandbySetMode; + } } else { @@ -6393,10 +6665,18 @@ zesGetTemperatureProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProperties = loader::zesTemperatureGetProperties; - pDdiTable->pfnGetConfig = loader::zesTemperatureGetConfig; - pDdiTable->pfnSetConfig = loader::zesTemperatureSetConfig; - pDdiTable->pfnGetState = loader::zesTemperatureGetState; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zesTemperatureGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetConfig = loader::zesTemperatureGetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetConfig = loader::zesTemperatureSetConfig; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetState = loader::zesTemperatureGetState; + } } else { @@ -6463,15 +6743,33 @@ zesGetVFManagementExpProcAddrTable( if( ( loader::context->sysmanInstanceDrivers->size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; - pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; - pDdiTable->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; - pDdiTable->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; - pDdiTable->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; - pDdiTable->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; - pDdiTable->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; - pDdiTable->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; - pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFCapabilitiesExp = loader::zesVFManagementGetVFCapabilitiesExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFMemoryUtilizationExp2 = loader::zesVFManagementGetVFMemoryUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetVFEngineUtilizationExp2 = loader::zesVFManagementGetVFEngineUtilizationExp2; + } + if (version >= ZE_API_VERSION_1_12) { + pDdiTable->pfnGetVFCapabilitiesExp2 = loader::zesVFManagementGetVFCapabilitiesExp2; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFPropertiesExp = loader::zesVFManagementGetVFPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFMemoryUtilizationExp = loader::zesVFManagementGetVFMemoryUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetVFEngineUtilizationExp = loader::zesVFManagementGetVFEngineUtilizationExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetVFTelemetryModeExp = loader::zesVFManagementSetVFTelemetryModeExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnSetVFTelemetrySamplingIntervalExp = loader::zesVFManagementSetVFTelemetrySamplingIntervalExp; + } } else { diff --git a/source/loader/zet_ldrddi.cpp b/source/loader/zet_ldrddi.cpp index 68c211ee..572ae41b 100644 --- a/source/loader/zet_ldrddi.cpp +++ b/source/loader/zet_ldrddi.cpp @@ -2343,9 +2343,15 @@ zetGetMetricDecoderExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zetMetricDecoderCreateExp; - pDdiTable->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; - pDdiTable->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateExp = loader::zetMetricDecoderCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDestroyExp = loader::zetMetricDecoderDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetDecodableMetricsExp = loader::zetMetricDecoderGetDecodableMetricsExp; + } } else { @@ -2412,10 +2418,18 @@ zetGetMetricProgrammableExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetExp = loader::zetMetricProgrammableGetExp; - pDdiTable->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; - pDdiTable->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; - pDdiTable->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetExp = loader::zetMetricProgrammableGetExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetPropertiesExp = loader::zetMetricProgrammableGetPropertiesExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetParamInfoExp = loader::zetMetricProgrammableGetParamInfoExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnGetParamValueInfoExp = loader::zetMetricProgrammableGetParamValueInfoExp; + } } else { @@ -2482,12 +2496,24 @@ zetGetMetricTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateExp = loader::zetMetricTracerCreateExp; - pDdiTable->pfnDestroyExp = loader::zetMetricTracerDestroyExp; - pDdiTable->pfnEnableExp = loader::zetMetricTracerEnableExp; - pDdiTable->pfnDisableExp = loader::zetMetricTracerDisableExp; - pDdiTable->pfnReadDataExp = loader::zetMetricTracerReadDataExp; - pDdiTable->pfnDecodeExp = loader::zetMetricTracerDecodeExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateExp = loader::zetMetricTracerCreateExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDestroyExp = loader::zetMetricTracerDestroyExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnEnableExp = loader::zetMetricTracerEnableExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDisableExp = loader::zetMetricTracerDisableExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnReadDataExp = loader::zetMetricTracerReadDataExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnDecodeExp = loader::zetMetricTracerDecodeExp; + } } else { @@ -2563,7 +2589,9 @@ zetGetDeviceProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetDebugProperties = loader::zetDeviceGetDebugProperties; + } } else { @@ -2630,8 +2658,12 @@ zetGetDeviceExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; - pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnGetConcurrentMetricGroupsExp = loader::zetDeviceGetConcurrentMetricGroupsExp; + } + if (version >= ZE_API_VERSION_1_10) { + pDdiTable->pfnCreateMetricGroupsFromMetricsExp = loader::zetDeviceCreateMetricGroupsFromMetricsExp; + } } else { @@ -2707,7 +2739,9 @@ zetGetContextProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnActivateMetricGroups = loader::zetContextActivateMetricGroups; + } } else { @@ -2783,10 +2817,18 @@ zetGetCommandListProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; - pDdiTable->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; - pDdiTable->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; - pDdiTable->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricStreamerMarker = loader::zetCommandListAppendMetricStreamerMarker; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricQueryBegin = loader::zetCommandListAppendMetricQueryBegin; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricQueryEnd = loader::zetCommandListAppendMetricQueryEnd; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAppendMetricMemoryBarrier = loader::zetCommandListAppendMetricMemoryBarrier; + } } else { @@ -2862,7 +2904,9 @@ zetGetKernelProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProfileInfo = loader::zetKernelGetProfileInfo; + } } else { @@ -2938,7 +2982,9 @@ zetGetModuleProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetDebugInfo = loader::zetModuleGetDebugInfo; + } } else { @@ -3014,18 +3060,42 @@ zetGetDebugProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnAttach = loader::zetDebugAttach; - pDdiTable->pfnDetach = loader::zetDebugDetach; - pDdiTable->pfnReadEvent = loader::zetDebugReadEvent; - pDdiTable->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; - pDdiTable->pfnInterrupt = loader::zetDebugInterrupt; - pDdiTable->pfnResume = loader::zetDebugResume; - pDdiTable->pfnReadMemory = loader::zetDebugReadMemory; - pDdiTable->pfnWriteMemory = loader::zetDebugWriteMemory; - pDdiTable->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; - pDdiTable->pfnReadRegisters = loader::zetDebugReadRegisters; - pDdiTable->pfnWriteRegisters = loader::zetDebugWriteRegisters; - pDdiTable->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAttach = loader::zetDebugAttach; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDetach = loader::zetDebugDetach; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadEvent = loader::zetDebugReadEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnAcknowledgeEvent = loader::zetDebugAcknowledgeEvent; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnInterrupt = loader::zetDebugInterrupt; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnResume = loader::zetDebugResume; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadMemory = loader::zetDebugReadMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnWriteMemory = loader::zetDebugWriteMemory; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetRegisterSetProperties = loader::zetDebugGetRegisterSetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadRegisters = loader::zetDebugReadRegisters; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnWriteRegisters = loader::zetDebugWriteRegisters; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetThreadRegisterSetProperties = loader::zetDebugGetThreadRegisterSetProperties; + } } else { @@ -3101,8 +3171,12 @@ zetGetMetricProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zetMetricGet; - pDdiTable->pfnGetProperties = loader::zetMetricGetProperties; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zetMetricGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zetMetricGetProperties; + } } else { @@ -3169,9 +3243,15 @@ zetGetMetricExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; - pDdiTable->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; - pDdiTable->pfnDestroyExp = loader::zetMetricDestroyExp; + if (version >= ZE_API_VERSION_1_11) { + pDdiTable->pfnCreateFromProgrammableExp2 = loader::zetMetricCreateFromProgrammableExp2; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateFromProgrammableExp = loader::zetMetricCreateFromProgrammableExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnDestroyExp = loader::zetMetricDestroyExp; + } } else { @@ -3247,9 +3327,15 @@ zetGetMetricGroupProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnGet = loader::zetMetricGroupGet; - pDdiTable->pfnGetProperties = loader::zetMetricGroupGetProperties; - pDdiTable->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGet = loader::zetMetricGroupGet; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetProperties = loader::zetMetricGroupGetProperties; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCalculateMetricValues = loader::zetMetricGroupCalculateMetricValues; + } } else { @@ -3316,15 +3402,33 @@ zetGetMetricGroupExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; - pDdiTable->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; - pDdiTable->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; - pDdiTable->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; - pDdiTable->pfnCreateExp = loader::zetMetricGroupCreateExp; - pDdiTable->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; - pDdiTable->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; - pDdiTable->pfnCloseExp = loader::zetMetricGroupCloseExp; - pDdiTable->pfnDestroyExp = loader::zetMetricGroupDestroyExp; + if (version >= ZE_API_VERSION_1_2) { + pDdiTable->pfnCalculateMultipleMetricValuesExp = loader::zetMetricGroupCalculateMultipleMetricValuesExp; + } + if (version >= ZE_API_VERSION_1_5) { + pDdiTable->pfnGetGlobalTimestampsExp = loader::zetMetricGroupGetGlobalTimestampsExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnGetExportDataExp = loader::zetMetricGroupGetExportDataExp; + } + if (version >= ZE_API_VERSION_1_6) { + pDdiTable->pfnCalculateMetricExportDataExp = loader::zetMetricGroupCalculateMetricExportDataExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCreateExp = loader::zetMetricGroupCreateExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnAddMetricExp = loader::zetMetricGroupAddMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnRemoveMetricExp = loader::zetMetricGroupRemoveMetricExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnCloseExp = loader::zetMetricGroupCloseExp; + } + if (version >= ZE_API_VERSION_1_9) { + pDdiTable->pfnDestroyExp = loader::zetMetricGroupDestroyExp; + } } else { @@ -3400,10 +3504,18 @@ zetGetMetricQueryProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetMetricQueryCreate; - pDdiTable->pfnDestroy = loader::zetMetricQueryDestroy; - pDdiTable->pfnReset = loader::zetMetricQueryReset; - pDdiTable->pfnGetData = loader::zetMetricQueryGetData; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetMetricQueryCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetMetricQueryDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReset = loader::zetMetricQueryReset; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnGetData = loader::zetMetricQueryGetData; + } } else { @@ -3479,8 +3591,12 @@ zetGetMetricQueryPoolProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetMetricQueryPoolCreate; - pDdiTable->pfnDestroy = loader::zetMetricQueryPoolDestroy; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetMetricQueryPoolCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetMetricQueryPoolDestroy; + } } else { @@ -3556,9 +3672,15 @@ zetGetMetricStreamerProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnOpen = loader::zetMetricStreamerOpen; - pDdiTable->pfnClose = loader::zetMetricStreamerClose; - pDdiTable->pfnReadData = loader::zetMetricStreamerReadData; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnOpen = loader::zetMetricStreamerOpen; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnClose = loader::zetMetricStreamerClose; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnReadData = loader::zetMetricStreamerReadData; + } } else { @@ -3634,11 +3756,21 @@ zetGetTracerExpProcAddrTable( if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept ) { // return pointers to loader's DDIs - pDdiTable->pfnCreate = loader::zetTracerExpCreate; - pDdiTable->pfnDestroy = loader::zetTracerExpDestroy; - pDdiTable->pfnSetPrologues = loader::zetTracerExpSetPrologues; - pDdiTable->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; - pDdiTable->pfnSetEnabled = loader::zetTracerExpSetEnabled; + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnCreate = loader::zetTracerExpCreate; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnDestroy = loader::zetTracerExpDestroy; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetPrologues = loader::zetTracerExpSetPrologues; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEpilogues = loader::zetTracerExpSetEpilogues; + } + if (version >= ZE_API_VERSION_1_0) { + pDdiTable->pfnSetEnabled = loader::zetTracerExpSetEnabled; + } } else {