Skip to content

[SYCL] [L0] Follow-up to make_queue backwards compatibility removal. #9523

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

Merged
merged 3 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 5 additions & 30 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,35 +961,15 @@ static const zeCommandListBatchConfig ZeCommandListBatchCopyConfig = [] {
return ZeCommandListBatchConfig(IsCopy{true});
}();

// Temporarily check whether immediate command list env var has been set. This
// affects default behavior of make_queue API.
static const bool ImmediateCommandlistEnvVarIsSet = [] {
const char *UrRet = std::getenv("UR_L0_USE_IMMEDIATE_COMMANDLISTS");
const char *PiRet =
std::getenv("SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS");
return (UrRet ? std::stoi(UrRet) : (PiRet ? std::stoi(PiRet) : 0));
}();

_pi_queue::_pi_queue(std::vector<ze_command_queue_handle_t> &ComputeQueues,
std::vector<ze_command_queue_handle_t> &CopyQueues,
pi_context Context, pi_device Device,
bool OwnZeCommandQueue,
pi_queue_properties PiQueueProperties,
int ForceComputeIndex, bool OldAPI)
int ForceComputeIndex)
: Context{Context}, Device{Device}, OwnZeCommandQueue{OwnZeCommandQueue},
Properties(PiQueueProperties) {

// Set the type of commandlists the queue will use.
bool Default = !ImmediateCommandlistEnvVarIsSet;
UsingImmCmdLists = Device->useImmediateCommandLists();
urPrint("ImmCmdList env var is set (%s), OldAPI (%s)\n",
(ImmediateCommandlistEnvVarIsSet ? "YES" : "NO"),
(OldAPI ? "YES" : "NO"));

if (OldAPI && Default)
// The default when called from pre-compiled binaries is to not use
// immediate command lists.
UsingImmCmdLists = false;
urPrint("ImmCmdList setting (%s)\n", (UsingImmCmdLists ? "YES" : "NO"));

// Compute group initialization.
Expand Down Expand Up @@ -2576,9 +2556,9 @@ pi_result piQueueCreate(pi_context Context, pi_device Device,
pi_queue_properties Properties[] = {PI_QUEUE_FLAGS, Flags, 0};
return piextQueueCreate(Context, Device, Properties, Queue);
}
pi_result piextQueueCreateInternal(pi_context Context, pi_device Device,
pi_queue_properties *Properties,
pi_queue *Queue, bool OldAPI) {

pi_result piextQueueCreate(pi_context Context, pi_device Device,
pi_queue_properties *Properties, pi_queue *Queue) {
PI_ASSERT(Properties, PI_ERROR_INVALID_VALUE);
// Expect flags mask to be passed first.
PI_ASSERT(Properties[0] == PI_QUEUE_FLAGS, PI_ERROR_INVALID_VALUE);
Expand Down Expand Up @@ -2629,7 +2609,7 @@ pi_result piextQueueCreateInternal(pi_context Context, pi_device Device,

try {
*Queue = new _pi_queue(ZeComputeCommandQueues, ZeCopyCommandQueues, Context,
Device, true, Flags, ForceComputeIndex, OldAPI);
Device, true, Flags, ForceComputeIndex);
} catch (const std::bad_alloc &) {
return PI_ERROR_OUT_OF_HOST_MEMORY;
} catch (...) {
Expand Down Expand Up @@ -2678,11 +2658,6 @@ pi_result piextQueueCreateInternal(pi_context Context, pi_device Device,
return PI_SUCCESS;
}

pi_result piextQueueCreate(pi_context Context, pi_device Device,
pi_queue_properties *Properties, pi_queue *Queue) {
return piextQueueCreateInternal(Context, Device, Properties, Queue, true);
}

pi_result piQueueGetInfo(pi_queue Queue, pi_queue_info ParamName,
size_t ParamValueSize, void *ParamValue,
size_t *ParamValueSizeRet) {
Expand Down
3 changes: 1 addition & 2 deletions sycl/plugins/level_zero/pi_level_zero.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ struct _pi_queue : _ur_object {
_pi_queue(std::vector<ze_command_queue_handle_t> &ComputeQueues,
std::vector<ze_command_queue_handle_t> &CopyQueues,
pi_context Context, pi_device Device, bool OwnZeCommandQueue,
pi_queue_properties Properties = 0, int ForceComputeIndex = -1,
bool oldAPI = false);
pi_queue_properties Properties = 0, int ForceComputeIndex = -1);

using queue_type = _pi_device::queue_group_info_t::type;

Expand Down