Skip to content

[SYCL][UR] Use official device info property for c-slices #8891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/plugins/unified_runtime/pi2ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ inline pi_result ur2piInfoValue(ur_device_info_t ParamName,
Map = {
{UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN,
PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN},
{UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE,
{UR_DEVICE_PARTITION_BY_CSLICE,
PI_EXT_INTEL_DEVICE_PARTITION_BY_CSLICE},
{(ur_device_partition_property_t)
UR_DEVICE_AFFINITY_DOMAIN_FLAG_NEXT_PARTITIONABLE,
Expand All @@ -224,7 +224,7 @@ inline pi_result ur2piInfoValue(ur_device_info_t ParamName,
Map = {
{UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN,
PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN},
{UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE,
{UR_DEVICE_PARTITION_BY_CSLICE,
PI_EXT_INTEL_DEVICE_PARTITION_BY_CSLICE},
};
return Value.convertArray(Map);
Expand Down Expand Up @@ -550,7 +550,7 @@ inline pi_result piDevicePartition(
{PI_DEVICE_PARTITION_BY_AFFINITY_DOMAIN,
UR_DEVICE_PARTITION_BY_AFFINITY_DOMAIN},
{PI_EXT_INTEL_DEVICE_PARTITION_BY_CSLICE,
UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE},
UR_DEVICE_PARTITION_BY_CSLICE},
};

auto PropertyIt = PropertyMap.find(Properties[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
if (Device->isCCS()) {
struct {
ur_device_partition_property_t Arr[2];
} PartitionProperties = {{UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE,
ur_device_partition_property_t(0)}};
} PartitionProperties = {
{UR_DEVICE_PARTITION_BY_CSLICE, ur_device_partition_property_t(0)}};
return ReturnValue(PartitionProperties);
}

Expand Down Expand Up @@ -1504,7 +1504,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
Properties[1] != UR_DEVICE_AFFINITY_DOMAIN_FLAG_NUMA)) {
return UR_RESULT_ERROR_INVALID_VALUE;
}
} else if (Properties[0] == UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE) {
} else if (Properties[0] == UR_DEVICE_PARTITION_BY_CSLICE) {
if (Properties[1] != 0) {
return UR_RESULT_ERROR_INVALID_VALUE;
}
Expand Down Expand Up @@ -1535,7 +1535,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDevicePartition(
return 0;
}
}
if (Properties[0] == UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE) {
if (Properties[0] == UR_DEVICE_PARTITION_BY_CSLICE) {
// Not a CSlice-based partitioning.
if (!Device->SubDevices[0]->isCCS()) {
return 0;
Expand Down
4 changes: 0 additions & 4 deletions sycl/plugins/unified_runtime/ur/ur.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ const int UR_EXT_USM_CAPS_ATOMIC_ACCESS = 1 << 1;
const int UR_EXT_USM_CAPS_CONCURRENT_ACCESS = 1 << 2;
const int UR_EXT_USM_CAPS_CONCURRENT_ATOMIC_ACCESS = 1 << 3;

const ur_device_partition_property_t
UR_EXT_DEVICE_PARTITION_PROPERTY_FLAG_BY_CSLICE =
ur_device_partition_property_t(UR_DEVICE_PARTITION_FORCE_UINT32 - 1);

// Terminates the process with a catastrophic error message.
[[noreturn]] inline void die(const char *Message) {
std::cerr << "die: " << Message << std::endl;
Expand Down