@@ -281,7 +281,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
281
281
}
282
282
case UR_DEVICE_INFO_REFERENCE_COUNT:
283
283
return ReturnValue (uint32_t {Device->RefCount .load ()});
284
- case UR_DEVICE_INFO_PARTITION_PROPERTIES : {
284
+ case UR_DEVICE_INFO_SUPPORTED_PARTITIONS : {
285
285
// SYCL spec says: if this SYCL device cannot be partitioned into at least
286
286
// two sub devices then the returned vector must be empty.
287
287
auto Res = Device->Platform ->populateDeviceCacheIfNeeded ();
@@ -291,15 +291,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
291
291
292
292
uint32_t ZeSubDeviceCount = Device->SubDevices .size ();
293
293
if (ZeSubDeviceCount < 2 ) {
294
- return ReturnValue ((ur_device_partition_property_t )0 );
294
+ return ReturnValue ((ur_device_partition_t )0 );
295
295
}
296
296
bool PartitionedByCSlice = Device->SubDevices [0 ]->isCCS ();
297
297
298
298
auto ReturnHelper = [&](auto ... Partitions) {
299
299
struct {
300
300
ur_device_partition_property_t Arr[sizeof ...(Partitions) + 1 ];
301
301
} PartitionProperties = {
302
- {Partitions..., ur_device_partition_property_t (0 )}};
302
+ {Partitions..., ur_device_partition_t (0 )}};
303
303
return ReturnValue (PartitionProperties);
304
304
};
305
305
@@ -324,23 +324,23 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
324
324
case UR_DEVICE_INFO_PARTITION_TYPE: {
325
325
// For root-device there is no partitioning to report.
326
326
if (!Device->isSubDevice ())
327
- return ReturnValue (ur_device_partition_property_t (0 ));
327
+ return ReturnValue (ur_device_partition_t (0 ));
328
328
329
329
if (Device->isCCS ()) {
330
330
struct {
331
331
ur_device_partition_property_t Arr[2 ];
332
332
} PartitionProperties = {
333
- {UR_DEVICE_PARTITION_BY_CSLICE, ur_device_partition_property_t (0 )}};
333
+ {UR_DEVICE_PARTITION_BY_CSLICE, ur_device_partition_t (0 )}};
334
334
return ReturnValue (PartitionProperties);
335
335
}
336
336
337
337
struct {
338
338
ur_device_partition_property_t Arr[3 ];
339
339
} PartitionProperties = {
340
340
{UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN,
341
- (ur_device_partition_property_t )
341
+ (ur_device_partition_t )
342
342
UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE,
343
- ur_device_partition_property_t (0 )}};
343
+ ur_device_partition_t (0 )}};
344
344
return ReturnValue (PartitionProperties);
345
345
}
346
346
@@ -1088,9 +1088,8 @@ void ZeUSMImportExtension::doZeUSMRelease(ze_driver_handle_t DriverHandle,
1088
1088
1089
1089
UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition (
1090
1090
ur_device_handle_t Device, // /< [in] handle of the device to partition.
1091
- const ur_device_partition_property_t
1092
- *Properties, // /< [in] null-terminated array of <$_device_partition_t
1093
- // /< enum, value> pairs.
1091
+ const ur_device_partition_properties_t
1092
+ *Properties, // /< [in] Device partition properties.
1094
1093
uint32_t NumDevices, // /< [in] the number of sub-devices.
1095
1094
ur_device_handle_t
1096
1095
*OutDevices, // /< [out][optional][range(0, NumDevices)] array of handle
@@ -1102,13 +1101,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
1102
1101
// /< according to the partitioning property.
1103
1102
) {
1104
1103
// Other partitioning ways are not supported by Level Zero
1105
- if (Properties[0 ] == UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) {
1106
- if ((Properties[1 ] != UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE &&
1107
- Properties[1 ] != UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA)) {
1104
+ if (Properties->pProperties ->type == UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN) {
1105
+ if ((Properties->pProperties ->value .affinity_domain !=
1106
+ UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE &&
1107
+ Properties->pProperties ->value .affinity_domain !=
1108
+ UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA)) {
1108
1109
return UR_RESULT_ERROR_INVALID_VALUE;
1109
1110
}
1110
- } else if (Properties[ 0 ] == UR_DEVICE_PARTITION_BY_CSLICE) {
1111
- if (Properties[ 1 ] != 0 ) {
1111
+ } else if (Properties-> pProperties -> type == UR_DEVICE_PARTITION_BY_CSLICE) {
1112
+ if (Properties-> pProperties -> value . affinity_domain != 0 ) {
1112
1113
return UR_RESULT_ERROR_INVALID_VALUE;
1113
1114
}
1114
1115
} else {
@@ -1132,13 +1133,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
1132
1133
// UR_L0_EXPOSE_CSLICE_IN_AFFINITY_PARTITIONING overrides that
1133
1134
// still expose CSlices in partitioning by affinity domain for compatibility
1134
1135
// reasons.
1135
- if (Properties[0 ] == UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN &&
1136
+ if (Properties->pProperties ->type ==
1137
+ UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN &&
1136
1138
!ExposeCSliceInAffinityPartitioning) {
1137
1139
if (Device->isSubDevice ()) {
1138
1140
return 0 ;
1139
1141
}
1140
1142
}
1141
- if (Properties[ 0 ] == UR_DEVICE_PARTITION_BY_CSLICE) {
1143
+ if (Properties-> pProperties -> type == UR_DEVICE_PARTITION_BY_CSLICE) {
1142
1144
// Not a CSlice-based partitioning.
1143
1145
if (!Device->SubDevices [0 ]->isCCS ()) {
1144
1146
return 0 ;
0 commit comments