Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][L0] Fix use of copy-engines in L0 interop queue #5579

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3333,7 +3333,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle,
// TODO: see if we need to let user choose the device.
pi_device Device = Context->Devices[0];
// TODO: see what we can do to correctly initialize PI queue for
// compute vs. copy Level-Zero queue.
// compute vs. copy Level-Zero queue. Currently we will send
// all commands to the "ZeQueue".
std::vector<ze_command_queue_handle_t> ZeroCopyQueues;
*Queue =
new _pi_queue(ZeQueue, ZeroCopyQueues, Context, Device, OwnNativeHandle);
Expand Down Expand Up @@ -5755,8 +5756,9 @@ pi_result piEnqueueMemBufferReadRect(
} // extern "C"

bool _pi_queue::useCopyEngine(bool PreferCopyEngine) const {
return (!isInOrderQueue() || UseCopyEngineForInOrderQueue) &&
PreferCopyEngine && Device->hasCopyEngine();
return PreferCopyEngine && Device->hasCopyEngine() &&
ZeCopyCommandQueues.size() > 0 && // TODO: initialize interop queues
(!isInOrderQueue() || UseCopyEngineForInOrderQueue);
}

// Shared by all memory read/write/copy PI interfaces.
Expand Down