Skip to content

Commit 847f8b6

Browse files
[SYCL][L0] Fix use of copy-engines in L0 interop queue (#5579)
Signed-off-by: Sergey V Maslov <[email protected]>
1 parent 7f5bd40 commit 847f8b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,7 +3333,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle,
33333333
// TODO: see if we need to let user choose the device.
33343334
pi_device Device = Context->Devices[0];
33353335
// TODO: see what we can do to correctly initialize PI queue for
3336-
// compute vs. copy Level-Zero queue.
3336+
// compute vs. copy Level-Zero queue. Currently we will send
3337+
// all commands to the "ZeQueue".
33373338
std::vector<ze_command_queue_handle_t> ZeroCopyQueues;
33383339
*Queue =
33393340
new _pi_queue(ZeQueue, ZeroCopyQueues, Context, Device, OwnNativeHandle);
@@ -5753,8 +5754,9 @@ pi_result piEnqueueMemBufferReadRect(
57535754
} // extern "C"
57545755

57555756
bool _pi_queue::useCopyEngine(bool PreferCopyEngine) const {
5756-
return (!isInOrderQueue() || UseCopyEngineForInOrderQueue) &&
5757-
PreferCopyEngine && Device->hasCopyEngine();
5757+
return PreferCopyEngine && Device->hasCopyEngine() &&
5758+
ZeCopyCommandQueues.size() > 0 && // TODO: initialize interop queues
5759+
(!isInOrderQueue() || UseCopyEngineForInOrderQueue);
57585760
}
57595761

57605762
// Shared by all memory read/write/copy PI interfaces.

0 commit comments

Comments
 (0)