Skip to content

Commit b14485b

Browse files
committed
1.13 support
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent d2542ca commit b14485b

File tree

9 files changed

+647
-31
lines changed

9 files changed

+647
-31
lines changed

scripts/templates/helper.py

+2
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,8 @@ def get_version(obj):
17361736
ret_version = "ZE_API_VERSION_1_11"
17371737
if version == "1.12":
17381738
ret_version = "ZE_API_VERSION_1_12"
1739+
if version == "1.13":
1740+
ret_version = "ZE_API_VERSION_1_13"
17391741
assert(ret_version != "ZE_API_VERSION_FORCE_UINT32")
17401742
return ret_version
17411743

source/lib/ze_libapi.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ zeDriverGet(
170170
/// other function. (zeInit is [Deprecated] and is replaced by
171171
/// zeInitDrivers)
172172
/// - Calls to zeInit[Deprecated] or InitDrivers will not alter the drivers
173-
/// retrieved thru either api.
174-
/// - Drivers init thru zeInit[Deprecated] or InitDrivers will not be
173+
/// retrieved through either api.
174+
/// - Drivers init through zeInit[Deprecated] or InitDrivers will not be
175175
/// reInitialized once init in an application. The Loader will determine
176-
/// if the already init driver needs to be delivered to the user thru the
177-
/// init type flags.
176+
/// if the already init driver needs to be delivered to the user through
177+
/// the init type flags.
178178
/// - Already init Drivers will not be uninitialized if the call to
179179
/// InitDrivers does not include that driver's type. Those init drivers
180180
/// which don't match the init flags will not have their driver handles

source/lib/zet_libapi.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -4269,6 +4269,8 @@ zetMetricGroupCloseExp(
42694269
/// - It is necessary to call ::zetMetricDestroyExp for each of the metric
42704270
/// handles (created from ::zetMetricCreateFromProgrammableExp2) to
42714271
/// destroy them.
4272+
/// - It is not necessary to remove the metrics in the metricGroup before
4273+
/// destroying it.
42724274
///
42734275
/// @returns
42744276
/// - ::ZE_RESULT_SUCCESS

source/loader/ze_ldrddi.cpp

+86-9
Original file line numberDiff line numberDiff line change
@@ -6923,6 +6923,19 @@ zeGetGlobalProcAddrTableLegacy()
69236923
loader::loaderDispatch->pCore->Global->pfnInitDrivers = loader::zeInitDrivers;
69246924
}
69256925

6926+
///////////////////////////////////////////////////////////////////////////////
6927+
/// @brief function for filling the legacy api pointers for RTASBuilder table
6928+
__zedlllocal void ZE_APICALL
6929+
zeGetRTASBuilderProcAddrTableLegacy()
6930+
{
6931+
// return pointers to the Loader's Functions.
6932+
loader::loaderDispatch->pCore->RTASBuilder->pfnCreateExt = loader::zeRTASBuilderCreateExt;
6933+
loader::loaderDispatch->pCore->RTASBuilder->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt;
6934+
loader::loaderDispatch->pCore->RTASBuilder->pfnBuildExt = loader::zeRTASBuilderBuildExt;
6935+
loader::loaderDispatch->pCore->RTASBuilder->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt;
6936+
loader::loaderDispatch->pCore->RTASBuilder->pfnDestroyExt = loader::zeRTASBuilderDestroyExt;
6937+
}
6938+
69266939
///////////////////////////////////////////////////////////////////////////////
69276940
/// @brief function for filling the legacy api pointers for RTASBuilderExp table
69286941
__zedlllocal void ZE_APICALL
@@ -6935,6 +6948,18 @@ zeGetRTASBuilderExpProcAddrTableLegacy()
69356948
loader::loaderDispatch->pCore->RTASBuilderExp->pfnDestroyExp = loader::zeRTASBuilderDestroyExp;
69366949
}
69376950

6951+
///////////////////////////////////////////////////////////////////////////////
6952+
/// @brief function for filling the legacy api pointers for RTASParallelOperation table
6953+
__zedlllocal void ZE_APICALL
6954+
zeGetRTASParallelOperationProcAddrTableLegacy()
6955+
{
6956+
// return pointers to the Loader's Functions.
6957+
loader::loaderDispatch->pCore->RTASParallelOperation->pfnCreateExt = loader::zeRTASParallelOperationCreateExt;
6958+
loader::loaderDispatch->pCore->RTASParallelOperation->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt;
6959+
loader::loaderDispatch->pCore->RTASParallelOperation->pfnJoinExt = loader::zeRTASParallelOperationJoinExt;
6960+
loader::loaderDispatch->pCore->RTASParallelOperation->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt;
6961+
}
6962+
69386963
///////////////////////////////////////////////////////////////////////////////
69396964
/// @brief function for filling the legacy api pointers for RTASParallelOperationExp table
69406965
__zedlllocal void ZE_APICALL
@@ -6959,6 +6984,7 @@ zeGetDriverProcAddrTableLegacy()
69596984
loader::loaderDispatch->pCore->Driver->pfnGetIpcProperties = loader::zeDriverGetIpcProperties;
69606985
loader::loaderDispatch->pCore->Driver->pfnGetExtensionProperties = loader::zeDriverGetExtensionProperties;
69616986
loader::loaderDispatch->pCore->Driver->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress;
6987+
loader::loaderDispatch->pCore->Driver->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt;
69626988
loader::loaderDispatch->pCore->Driver->pfnGetLastErrorDescription = loader::zeDriverGetLastErrorDescription;
69636989
}
69646990

@@ -6994,6 +7020,7 @@ zeGetDeviceProcAddrTableLegacy()
69947020
loader::loaderDispatch->pCore->Device->pfnGetGlobalTimestamps = loader::zeDeviceGetGlobalTimestamps;
69957021
loader::loaderDispatch->pCore->Device->pfnImportExternalSemaphoreExt = loader::zeDeviceImportExternalSemaphoreExt;
69967022
loader::loaderDispatch->pCore->Device->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt;
7023+
loader::loaderDispatch->pCore->Device->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt;
69977024
loader::loaderDispatch->pCore->Device->pfnReserveCacheExt = loader::zeDeviceReserveCacheExt;
69987025
loader::loaderDispatch->pCore->Device->pfnSetCacheAdviceExt = loader::zeDeviceSetCacheAdviceExt;
69997026
loader::loaderDispatch->pCore->Device->pfnPciGetPropertiesExt = loader::zeDevicePciGetPropertiesExt;
@@ -7482,11 +7509,33 @@ zeGetRTASBuilderProcAddrTable(
74827509
if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept )
74837510
{
74847511
// return pointers to loader's DDIs
7485-
pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt;
7486-
pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt;
7487-
pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt;
7488-
pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt;
7489-
pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt;
7512+
loader::loaderDispatch->pCore->RTASBuilder = new ze_rtas_builder_dditable_t;
7513+
if (loader::context->driverDDIPathDefault) {
7514+
pDdiTable->pfnCreateExt = loader_driver_ddi::zeRTASBuilderCreateExt;
7515+
} else {
7516+
pDdiTable->pfnCreateExt = loader::zeRTASBuilderCreateExt;
7517+
}
7518+
if (loader::context->driverDDIPathDefault) {
7519+
pDdiTable->pfnGetBuildPropertiesExt = loader_driver_ddi::zeRTASBuilderGetBuildPropertiesExt;
7520+
} else {
7521+
pDdiTable->pfnGetBuildPropertiesExt = loader::zeRTASBuilderGetBuildPropertiesExt;
7522+
}
7523+
if (loader::context->driverDDIPathDefault) {
7524+
pDdiTable->pfnBuildExt = loader_driver_ddi::zeRTASBuilderBuildExt;
7525+
} else {
7526+
pDdiTable->pfnBuildExt = loader::zeRTASBuilderBuildExt;
7527+
}
7528+
if (loader::context->driverDDIPathDefault) {
7529+
pDdiTable->pfnCommandListAppendCopyExt = loader_driver_ddi::zeRTASBuilderCommandListAppendCopyExt;
7530+
} else {
7531+
pDdiTable->pfnCommandListAppendCopyExt = loader::zeRTASBuilderCommandListAppendCopyExt;
7532+
}
7533+
if (loader::context->driverDDIPathDefault) {
7534+
pDdiTable->pfnDestroyExt = loader_driver_ddi::zeRTASBuilderDestroyExt;
7535+
} else {
7536+
pDdiTable->pfnDestroyExt = loader::zeRTASBuilderDestroyExt;
7537+
}
7538+
zeGetRTASBuilderProcAddrTableLegacy();
74907539
}
74917540
else
74927541
{
@@ -7682,10 +7731,28 @@ zeGetRTASParallelOperationProcAddrTable(
76827731
if( ( loader::context->zeDrivers.size() > 1 ) || loader::context->forceIntercept )
76837732
{
76847733
// return pointers to loader's DDIs
7685-
pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt;
7686-
pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt;
7687-
pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt;
7688-
pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt;
7734+
loader::loaderDispatch->pCore->RTASParallelOperation = new ze_rtas_parallel_operation_dditable_t;
7735+
if (loader::context->driverDDIPathDefault) {
7736+
pDdiTable->pfnCreateExt = loader_driver_ddi::zeRTASParallelOperationCreateExt;
7737+
} else {
7738+
pDdiTable->pfnCreateExt = loader::zeRTASParallelOperationCreateExt;
7739+
}
7740+
if (loader::context->driverDDIPathDefault) {
7741+
pDdiTable->pfnGetPropertiesExt = loader_driver_ddi::zeRTASParallelOperationGetPropertiesExt;
7742+
} else {
7743+
pDdiTable->pfnGetPropertiesExt = loader::zeRTASParallelOperationGetPropertiesExt;
7744+
}
7745+
if (loader::context->driverDDIPathDefault) {
7746+
pDdiTable->pfnJoinExt = loader_driver_ddi::zeRTASParallelOperationJoinExt;
7747+
} else {
7748+
pDdiTable->pfnJoinExt = loader::zeRTASParallelOperationJoinExt;
7749+
}
7750+
if (loader::context->driverDDIPathDefault) {
7751+
pDdiTable->pfnDestroyExt = loader_driver_ddi::zeRTASParallelOperationDestroyExt;
7752+
} else {
7753+
pDdiTable->pfnDestroyExt = loader::zeRTASParallelOperationDestroyExt;
7754+
}
7755+
zeGetRTASParallelOperationProcAddrTableLegacy();
76897756
}
76907757
else
76917758
{
@@ -7908,6 +7975,11 @@ zeGetDriverProcAddrTable(
79087975
} else {
79097976
pDdiTable->pfnGetExtensionFunctionAddress = loader::zeDriverGetExtensionFunctionAddress;
79107977
}
7978+
if (loader::context->driverDDIPathDefault) {
7979+
pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader_driver_ddi::zeDriverRTASFormatCompatibilityCheckExt;
7980+
} else {
7981+
pDdiTable->pfnRTASFormatCompatibilityCheckExt = loader::zeDriverRTASFormatCompatibilityCheckExt;
7982+
}
79117983
if (loader::context->driverDDIPathDefault) {
79127984
pDdiTable->pfnGetLastErrorDescription = loader_driver_ddi::zeDriverGetLastErrorDescription;
79137985
} else {
@@ -8180,6 +8252,11 @@ zeGetDeviceProcAddrTable(
81808252
} else {
81818253
pDdiTable->pfnReleaseExternalSemaphoreExt = loader::zeDeviceReleaseExternalSemaphoreExt;
81828254
}
8255+
if (loader::context->driverDDIPathDefault) {
8256+
pDdiTable->pfnGetVectorWidthPropertiesExt = loader_driver_ddi::zeDeviceGetVectorWidthPropertiesExt;
8257+
} else {
8258+
pDdiTable->pfnGetVectorWidthPropertiesExt = loader::zeDeviceGetVectorWidthPropertiesExt;
8259+
}
81838260
if (loader::context->driverDDIPathDefault) {
81848261
pDdiTable->pfnReserveCacheExt = loader_driver_ddi::zeDeviceReserveCacheExt;
81858262
} else {

0 commit comments

Comments
 (0)