@@ -2269,7 +2269,7 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
2269
2269
case PI_DEVICE_INFO_UUID:
2270
2270
// Intel extension for device UUID. This returns the UUID as
2271
2271
// std::array<std::byte, 16>. For details about this extension,
2272
- // see sycl/doc/extensions/supported/SYCL_EXT_INTEL_DEVICE_INFO .md.
2272
+ // see sycl/doc/extensions/IntelGPU/IntelGPUDeviceInfo .md.
2273
2273
return ReturnValue (Device->ZeDeviceProperties ->uuid .id );
2274
2274
case PI_DEVICE_INFO_EXTENSIONS: {
2275
2275
// Convention adopted from OpenCL:
@@ -3227,28 +3227,19 @@ pi_result piQueueFinish(pi_queue Queue) {
3227
3227
// Wait until command lists attached to the command queue are executed.
3228
3228
PI_ASSERT (Queue, PI_INVALID_QUEUE);
3229
3229
3230
- std::vector<ze_command_queue_handle_t > ZeQueues;
3231
- {
3232
- // Lock automatically releases when this goes out of scope.
3233
- std::lock_guard<std::mutex> lock (Queue->PiQueueMutex );
3234
-
3235
- // execute any command list that may still be open.
3236
- if (auto Res = Queue->executeAllOpenCommandLists ())
3237
- return Res;
3230
+ // Lock automatically releases when this goes out of scope.
3231
+ std::lock_guard<std::mutex> lock (Queue->PiQueueMutex );
3238
3232
3239
- ZeQueues = Queue-> ZeCopyCommandQueues ;
3240
- ZeQueues. push_back ( Queue->ZeComputeCommandQueue );
3241
- }
3233
+ // execute any command list that may still be open.
3234
+ if ( auto Res = Queue->executeAllOpenCommandLists ())
3235
+ return Res;
3242
3236
3243
- // Don't hold a lock to the queue's mutex while waiting.
3244
- // This allows continue working with the queue from other threads.
3245
- for (auto ZeQueue : ZeQueues) {
3246
- if (ZeQueue)
3247
- ZE_CALL (zeHostSynchronize, (ZeQueue));
3237
+ ZE_CALL (zeHostSynchronize, (Queue->ZeComputeCommandQueue ));
3238
+ for (uint32_t i = 0 ; i < Queue->ZeCopyCommandQueues .size (); ++i) {
3239
+ if (Queue->ZeCopyCommandQueues [i])
3240
+ ZE_CALL (zeHostSynchronize, (Queue->ZeCopyCommandQueues [i]));
3248
3241
}
3249
3242
3250
- // Lock automatically releases when this goes out of scope.
3251
- std::lock_guard<std::mutex> lock (Queue->PiQueueMutex );
3252
3243
// Prevent unneeded already finished events to show up in the wait list.
3253
3244
Queue->LastCommandEvent = nullptr ;
3254
3245
@@ -3398,7 +3389,7 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
3398
3389
if (Flags & PI_MEM_FLAGS_HOST_PTR_ALLOC) {
3399
3390
// Having PI_MEM_FLAGS_HOST_PTR_ALLOC for buffer requires allocation of
3400
3391
// pinned host memory, see:
3401
- // sycl/doc/extensions/supported/SYCL_EXT_ONEAPI_USE_PINNED_HOST_MEMORY_PROPERTY.asciidoc
3392
+ // https://github.com/intel/llvm/blob/ sycl/sycl/ doc/extensions/UsePinnedMemoryProperty/UsePinnedMemoryPropery.adoc
3402
3393
// We are however missing such functionality in Level Zero, so we just
3403
3394
// ignore the flag for now.
3404
3395
//
@@ -3446,7 +3437,7 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
3446
3437
}
3447
3438
}
3448
3439
3449
- pi_result Result = PI_SUCCESS ;
3440
+ pi_result Result;
3450
3441
if (DeviceIsIntegrated) {
3451
3442
if (HostPtrImported) {
3452
3443
// When HostPtr is imported we use it for the buffer.
@@ -5381,10 +5372,6 @@ pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle,
5381
5372
*Event = new _pi_event (ZeEvent, nullptr /* ZeEventPool */ , Context,
5382
5373
PI_COMMAND_TYPE_USER, OwnNativeHandle);
5383
5374
5384
- // Assume native event is host-visible, or otherwise we'd
5385
- // need to create a host-visible proxy for it.
5386
- (*Event)->HostVisibleEvent = *Event;
5387
-
5388
5375
return PI_SUCCESS;
5389
5376
}
5390
5377
@@ -7294,6 +7281,11 @@ pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
7294
7281
// Lock automatically releases when this goes out of scope.
7295
7282
std::lock_guard<std::mutex> lock (Queue->PiQueueMutex );
7296
7283
7284
+ _pi_ze_event_list_t TmpWaitList;
7285
+ if (auto Res = TmpWaitList.createAndRetainPiZeEventList (NumEventsInWaitList,
7286
+ EventWaitList, Queue))
7287
+ return Res;
7288
+
7297
7289
// Get a new command list to be used on this call
7298
7290
pi_command_list_ptr_t CommandList{};
7299
7291
// TODO: Change UseCopyEngine argument to 'true' once L0 backend
@@ -7309,10 +7301,7 @@ pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
7309
7301
if (Res != PI_SUCCESS)
7310
7302
return Res;
7311
7303
ZeEvent = (*Event)->ZeEvent ;
7312
-
7313
- if (auto Res = (*Event)->WaitList .createAndRetainPiZeEventList (
7314
- NumEventsInWaitList, EventWaitList, Queue))
7315
- return Res;
7304
+ (*Event)->WaitList = TmpWaitList;
7316
7305
7317
7306
const auto &WaitList = (*Event)->WaitList ;
7318
7307
const auto &ZeCommandList = CommandList->first ;
0 commit comments