Skip to content

Commit 1b8a422

Browse files
committed
removed the other call.
Signed-off-by: Byoungro So <[email protected]>
1 parent 57dc2c2 commit 1b8a422

File tree

1 file changed

+18
-29
lines changed

1 file changed

+18
-29
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,7 +2269,7 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
22692269
case PI_DEVICE_INFO_UUID:
22702270
// Intel extension for device UUID. This returns the UUID as
22712271
// 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.
22732273
return ReturnValue(Device->ZeDeviceProperties->uuid.id);
22742274
case PI_DEVICE_INFO_EXTENSIONS: {
22752275
// Convention adopted from OpenCL:
@@ -3227,28 +3227,19 @@ pi_result piQueueFinish(pi_queue Queue) {
32273227
// Wait until command lists attached to the command queue are executed.
32283228
PI_ASSERT(Queue, PI_INVALID_QUEUE);
32293229

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);
32383232

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;
32423236

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]));
32483241
}
32493242

3250-
// Lock automatically releases when this goes out of scope.
3251-
std::lock_guard<std::mutex> lock(Queue->PiQueueMutex);
32523243
// Prevent unneeded already finished events to show up in the wait list.
32533244
Queue->LastCommandEvent = nullptr;
32543245

@@ -3398,7 +3389,7 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
33983389
if (Flags & PI_MEM_FLAGS_HOST_PTR_ALLOC) {
33993390
// Having PI_MEM_FLAGS_HOST_PTR_ALLOC for buffer requires allocation of
34003391
// 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
34023393
// We are however missing such functionality in Level Zero, so we just
34033394
// ignore the flag for now.
34043395
//
@@ -3446,7 +3437,7 @@ pi_result piMemBufferCreate(pi_context Context, pi_mem_flags Flags, size_t Size,
34463437
}
34473438
}
34483439

3449-
pi_result Result = PI_SUCCESS;
3440+
pi_result Result;
34503441
if (DeviceIsIntegrated) {
34513442
if (HostPtrImported) {
34523443
// When HostPtr is imported we use it for the buffer.
@@ -5381,10 +5372,6 @@ pi_result piextEventCreateWithNativeHandle(pi_native_handle NativeHandle,
53815372
*Event = new _pi_event(ZeEvent, nullptr /* ZeEventPool */, Context,
53825373
PI_COMMAND_TYPE_USER, OwnNativeHandle);
53835374

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-
53885375
return PI_SUCCESS;
53895376
}
53905377

@@ -7294,6 +7281,11 @@ pi_result piextUSMEnqueuePrefetch(pi_queue Queue, const void *Ptr, size_t Size,
72947281
// Lock automatically releases when this goes out of scope.
72957282
std::lock_guard<std::mutex> lock(Queue->PiQueueMutex);
72967283

7284+
_pi_ze_event_list_t TmpWaitList;
7285+
if (auto Res = TmpWaitList.createAndRetainPiZeEventList(NumEventsInWaitList,
7286+
EventWaitList, Queue))
7287+
return Res;
7288+
72977289
// Get a new command list to be used on this call
72987290
pi_command_list_ptr_t CommandList{};
72997291
// 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,
73097301
if (Res != PI_SUCCESS)
73107302
return Res;
73117303
ZeEvent = (*Event)->ZeEvent;
7312-
7313-
if (auto Res = (*Event)->WaitList.createAndRetainPiZeEventList(
7314-
NumEventsInWaitList, EventWaitList, Queue))
7315-
return Res;
7304+
(*Event)->WaitList = TmpWaitList;
73167305

73177306
const auto &WaitList = (*Event)->WaitList;
73187307
const auto &ZeCommandList = CommandList->first;

0 commit comments

Comments
 (0)