@@ -227,6 +227,7 @@ ur_result_t ur_platform_handle_t_::initialize() {
227
227
228
228
bool MutableCommandListSpecExtensionSupported = false ;
229
229
bool ZeIntelExternalSemaphoreExtensionSupported = false ;
230
+ bool ZeExternalSemaphoreExtensionSupported = false ;
230
231
bool ZeImmediateCommandListAppendExtensionFound = false ;
231
232
for (auto &extension : ZeExtensions) {
232
233
// Check if global offset extension is available
@@ -267,13 +268,20 @@ ur_result_t ur_platform_handle_t_::initialize() {
267
268
MutableCommandListSpecExtensionSupported = true ;
268
269
}
269
270
}
270
- // Check if extension is available for External Sempahores
271
+ // Check if extension is available for Exp External Sempahores
271
272
if (strncmp (extension.name , ZE_INTEL_EXTERNAL_SEMAPHORE_EXP_NAME,
272
273
strlen (ZE_INTEL_EXTERNAL_SEMAPHORE_EXP_NAME) + 1 ) == 0 ) {
273
274
if (extension.version == ZE_EXTERNAL_SEMAPHORE_EXP_VERSION_1_0) {
274
275
ZeIntelExternalSemaphoreExtensionSupported = true ;
275
276
}
276
277
}
278
+ // Check if extension is available for Spec External Sempahores
279
+ if (strncmp (extension.name , ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME,
280
+ strlen (ZE_EXTERNAL_SEMAPHORES_EXTENSION_NAME) + 1 ) == 0 ) {
281
+ if (extension.version == ZE_EXTERNAL_SEMAPHORE_EXT_VERSION_1_0) {
282
+ ZeExternalSemaphoreExtensionSupported = true ;
283
+ }
284
+ }
277
285
if (strncmp (extension.name , ZE_EU_COUNT_EXT_NAME,
278
286
strlen (ZE_EU_COUNT_EXT_NAME) + 1 ) == 0 ) {
279
287
if (extension.version == ZE_EU_COUNT_EXT_VERSION_1_0) {
@@ -323,7 +331,37 @@ ur_result_t ur_platform_handle_t_::initialize() {
323
331
// If yes, then set up L0 API pointers if the platform supports it.
324
332
ZeUSMImport.setZeUSMImport (this );
325
333
326
- if (ZeIntelExternalSemaphoreExtensionSupported) {
334
+ if (ZeExternalSemaphoreExtensionSupported) {
335
+ ZeExternalSemaphoreExt.Supported |=
336
+ (ZE_CALL_NOCHECK (
337
+ zeDriverGetExtensionFunctionAddress,
338
+ (ZeDriver, " zeDeviceImportExternalSemaphoreExt" ,
339
+ reinterpret_cast <void **>(
340
+ &ZeExternalSemaphoreExt.zexImportExternalSemaphoreExp ))) ==
341
+ 0 );
342
+ ZeExternalSemaphoreExt.Supported |=
343
+ (ZE_CALL_NOCHECK (
344
+ zeDriverGetExtensionFunctionAddress,
345
+ (ZeDriver, " zeCommandListAppendWaitExternalSemaphoreExt" ,
346
+ reinterpret_cast <void **>(
347
+ &ZeExternalSemaphoreExt
348
+ .zexCommandListAppendWaitExternalSemaphoresExp ))) == 0 );
349
+ ZeExternalSemaphoreExt.Supported |=
350
+ (ZE_CALL_NOCHECK (
351
+ zeDriverGetExtensionFunctionAddress,
352
+ (ZeDriver, " zeCommandListAppendSignalExternalSemaphoreExt" ,
353
+ reinterpret_cast <void **>(
354
+ &ZeExternalSemaphoreExt
355
+ .zexCommandListAppendSignalExternalSemaphoresExp ))) ==
356
+ 0 );
357
+ ZeExternalSemaphoreExt.Supported |=
358
+ (ZE_CALL_NOCHECK (zeDriverGetExtensionFunctionAddress,
359
+ (ZeDriver, " zeDeviceReleaseExternalSemaphoreExt" ,
360
+ reinterpret_cast <void **>(
361
+ &ZeExternalSemaphoreExt
362
+ .zexDeviceReleaseExternalSemaphoreExp ))) ==
363
+ 0 );
364
+ } else if (ZeIntelExternalSemaphoreExtensionSupported) {
327
365
ZeExternalSemaphoreExt.Supported |=
328
366
(ZE_CALL_NOCHECK (
329
367
zeDriverGetExtensionFunctionAddress,
0 commit comments