Skip to content

Commit 533324d

Browse files
committed
[L0 v2] Change dispatching logic
Whenever UR_L0_USE_QUEUE_V2 is set, create v2 queue. v2 queue will always be created as immediate_in_order for now. This makes switching to v2 easier and less error-prone.
1 parent 1baed0b commit 533324d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

source/adapters/level_zero/v2/queue_factory.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ namespace v2 {
1818

1919
inline bool shouldUseQueueV2(ur_device_handle_t Device,
2020
ur_queue_flags_t Flags) {
21-
const char *UrRet = std::getenv("UR_L0_USE_QUEUE_V2");
21+
std::ignore = Device;
22+
std::ignore = Flags;
2223

23-
// only support immediate, in-order for now
24-
return UrRet && std::stoi(UrRet) && Device->useImmediateCommandLists() &&
25-
(Flags & UR_QUEUE_FLAG_SUBMISSION_BATCHED) == 0 &&
26-
(Flags & UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE) == 0;
24+
const char *UrRet = std::getenv("UR_L0_USE_QUEUE_V2");
25+
return UrRet && std::stoi(UrRet);
2726
}
2827

2928
inline ur_queue_handle_t createQueue(ur_context_handle_t Context,
@@ -32,6 +31,8 @@ inline ur_queue_handle_t createQueue(ur_context_handle_t Context,
3231
if (!shouldUseQueueV2(Device, Flags)) {
3332
throw UR_RESULT_ERROR_INVALID_ARGUMENT;
3433
}
34+
35+
// TODO: For now, always use immediate, in-order
3536
return new ur_queue_immediate_in_order_t(Context, Device, Flags);
3637
}
3738

0 commit comments

Comments
 (0)