Skip to content

Commit 25c5b72

Browse files
addressed recent comments
1 parent 2e931e7 commit 25c5b72

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

unified-runtime/source/adapters/level_zero/platform.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,21 +503,17 @@ bool ur_platform_handle_t_::allowDriverInOrderLists(bool OnlyIfRequested) {
503503
#define L0_DRIVER_INORDER_MINOR_VERSION 6
504504
#define L0_DRIVER_INORDER_PATCH_VERSION 32149
505505

506-
static const bool UseDriverInOrderLists = [&] {
506+
static const bool UseEnvVarDriverInOrderLists = [&] {
507507
const char *UrRet = std::getenv("UR_L0_USE_DRIVER_INORDER_LISTS");
508+
return UrRet ? std::atoi(UrRet) != 0 : false;
509+
}();
510+
static const bool UseDriverInOrderLists = [this] {
508511
bool CompatibleDriver = this->isDriverVersionNewerOrSimilar(
509512
1, L0_DRIVER_INORDER_MINOR_VERSION, L0_DRIVER_INORDER_PATCH_VERSION);
510-
bool DriverInOrderRequested = UrRet ? std::atoi(UrRet) != 0 : false;
511-
bool CanUseDriverInOrderLists = CompatibleDriver || DriverInOrderRequested;
512-
return CanUseDriverInOrderLists;
513+
return CompatibleDriver || UseEnvVarDriverInOrderLists;
513514
}();
514515

515-
if (OnlyIfRequested) {
516-
const char *UrRet = std::getenv("UR_L0_USE_DRIVER_INORDER_LISTS");
517-
bool DriverInOrderRequested = UrRet ? std::atoi(UrRet) != 0 : false;
518-
return DriverInOrderRequested;
519-
}
520-
return UseDriverInOrderLists;
516+
return OnlyIfRequested ? UseEnvVarDriverInOrderLists : UseDriverInOrderLists;
521517
}
522518

523519
/// Checks the version of the level-zero driver.

0 commit comments

Comments
 (0)