Skip to content

Commit c4743a7

Browse files
author
Jaime Arteaga
authored
[SYCL][UR] Fix device partition queries (2) (#10592)
Fix CSLICE partitioning for PVC. Also, fix level_zero_ext_intel_cslice to correctly test with and without immediate command list. Signed-off-by: Jaime Arteaga <[email protected]> Signed-off-by: Piotr Balcer <[email protected]> Signed-off-by: Fábio Mestre <[email protected]> Signed-off-by: Jaime Arteaga <[email protected]> Signed-off-by: Piotr Balcer <[email protected]> Signed-off-by: Fábio Mestre <[email protected]>
1 parent c1c3c94 commit c4743a7

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

sycl/plugins/unified_runtime/pi2ur.hpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ inline pi_result ur2piDeviceInfoValue(ur_device_info_t ParamName,
469469
*pValuePI = pValueUR->value.affinity_domain;
470470
break;
471471
}
472+
case UR_DEVICE_PARTITION_BY_CSLICE: {
473+
*pValuePI = 0;
474+
break;
475+
}
472476
default:
473477
die("UR_DEVICE_INFO_PARTITION_TYPE query returned unsupported type");
474478
}
@@ -1283,6 +1287,14 @@ inline pi_result piDevicePartition(
12831287
}
12841288

12851289
std::vector<ur_device_partition_property_t> UrProperties{};
1290+
1291+
// UR_DEVICE_PARTITION_BY_CSLICE doesn't have a value, so
1292+
// handle it outside the while loop below.
1293+
if (UrType == UR_DEVICE_PARTITION_BY_CSLICE) {
1294+
ur_device_partition_property_t UrProperty{};
1295+
UrProperty.type = UrType;
1296+
UrProperties.push_back(UrProperty);
1297+
}
12861298
while (*(++Properties)) {
12871299
ur_device_partition_property_t UrProperty;
12881300
UrProperty.type = UrType;
@@ -1301,9 +1313,6 @@ inline pi_result piDevicePartition(
13011313
UrProperty.value.affinity_domain = *Properties;
13021314
break;
13031315
}
1304-
case UR_DEVICE_PARTITION_BY_CSLICE: {
1305-
break;
1306-
}
13071316
default: {
13081317
die("Invalid properties for call to piDevicePartition");
13091318
}

sycl/plugins/unified_runtime/ur/adapters/level_zero/device.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
340340
return UR_RESULT_SUCCESS;
341341
}
342342

343+
if (Device->isCCS()) {
344+
ur_device_partition_property_t cslice = {
345+
UR_DEVICE_PARTITION_BY_CSLICE,
346+
};
347+
348+
return ReturnValue(cslice);
349+
}
350+
343351
return ReturnValue(Device->SubDeviceCreationProperty);
344352
}
345353
// Everything under here is not supported yet

sycl/test-e2e/Plugin/level_zero_ext_intel_cslice.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
// RUN: env SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 \
99
// RUN: ZEX_NUMBER_OF_CCS=0:4 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC
1010

11-
// Same, but using immediate commandlists:
11+
// Same, but without using immediate commandlists:
1212

13-
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 ZEX_NUMBER_OF_CCS=0:4 \
13+
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 ZEX_NUMBER_OF_CCS=0:4 \
1414
// RUN: ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC
1515

16-
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 \
16+
// RUN: env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 SYCL_PI_LEVEL_ZERO_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING=1 \
1717
// RUN: ZEX_NUMBER_OF_CCS=0:4 ZE_DEBUG=1 %{run} %t.out 2>&1 | FileCheck %s --check-prefixes=CHECK-PVC
1818

1919
#include <sycl/sycl.hpp>

0 commit comments

Comments
 (0)