Skip to content

Commit 306cc9f

Browse files
committed
fix pre-commit fail.
Signed-off-by: rehana begam <[email protected]>
1 parent 33c4449 commit 306cc9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ static const pi_uint32 ZeSerialize = [] {
4646
return SerializeModeValue;
4747
}();
4848

49+
static const bool CopyEngineRequested = [] {
50+
const char *CopyEngine = std::getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE");
51+
bool UseCopyEngine = (!CopyEngine || (std::stoi(CopyEngine) != 0));
52+
return UseCopyEngine;
53+
}();
54+
4955
// This class encapsulates actions taken along with a call to Level Zero API.
5056
class ZeCall {
5157
private:
@@ -564,9 +570,7 @@ pi_result _pi_device::initialize(int SubSubDeviceOrdinal,
564570
ZeComputeEngineIndex = 0;
565571

566572
int CopyGroupIndex = -1;
567-
const char *CopyEngine = std::getenv("SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE");
568-
bool UseCopyEngine = (!CopyEngine || (std::stoi(CopyEngine) != 0));
569-
if (UseCopyEngine) {
573+
if (CopyEngineRequested) {
570574
for (uint32_t i = 0; i < numQueueGroups; i++) {
571575
if (((QueueProperties[i].flags &
572576
ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE) == 0) &&
@@ -1583,10 +1587,6 @@ pi_result _pi_platform::populateDeviceCacheIfNeeded() {
15831587
}
15841588
}
15851589

1586-
if (Ordinals.empty()) {
1587-
return PI_ERROR_UNKNOWN;
1588-
}
1589-
15901590
// Create PI sub-sub-devices with the sub-device for all the ordinals.
15911591
// Each {ordinal, index} points to a specific CCS which constructs
15921592
// a sub-sub-device at this point.

0 commit comments

Comments
 (0)