Skip to content

Commit 000cc82

Browse files
[SYCL] Rename usm_system_allocator to usm_system_allocations (#4007)
This patch renames usm_system_allocator to usm_system_allocations to conform SYCL 2020 spec.
1 parent 881724f commit 000cc82

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

sycl/include/CL/sycl/aspects.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ enum class aspect {
3030
usm_host_allocations = 14,
3131
usm_shared_allocations = 15,
3232
usm_restricted_shared_allocations = 16,
33-
usm_system_allocator = 17,
33+
usm_system_allocations = 17,
34+
usm_system_allocator __SYCL2020_DEPRECATED(
35+
"use usm_system_allocations instead") = usm_system_allocations,
3436
ext_intel_pci_address = 18,
3537
ext_intel_gpu_eu_count = 19,
3638
ext_intel_gpu_eu_simd_width = 20,

sycl/include/CL/sycl/info/device_traits.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, usm_device_allocations, bool)
8585
__SYCL_PARAM_TRAITS_SPEC(device, usm_host_allocations, bool)
8686
__SYCL_PARAM_TRAITS_SPEC(device, usm_shared_allocations, bool)
8787
__SYCL_PARAM_TRAITS_SPEC(device, usm_restricted_shared_allocations, bool)
88-
__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocator, bool)
88+
__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocations, bool)
8989
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_pci_address, std::string)
9090
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_count, pi_uint32)
9191
__SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_simd_width, pi_uint32)

sycl/include/CL/sycl/info/info_desc.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ enum class device : cl_device_info {
133133
usm_host_allocations = PI_USM_HOST_SUPPORT,
134134
usm_shared_allocations = PI_USM_SINGLE_SHARED_SUPPORT,
135135
usm_restricted_shared_allocations = PI_USM_CROSS_SHARED_SUPPORT,
136-
usm_system_allocator = PI_USM_SYSTEM_SHARED_SUPPORT,
136+
usm_system_allocations = PI_USM_SYSTEM_SHARED_SUPPORT,
137+
usm_system_allocator __SYCL2020_DEPRECATED(
138+
"use usm_system_allocations instead") = usm_system_allocations,
139+
137140
// intel extensions
138141
ext_intel_pci_address = PI_DEVICE_INFO_PCI_ADDRESS,
139142
ext_intel_gpu_eu_count = PI_DEVICE_INFO_GPU_EU_COUNT,

sycl/source/detail/device_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ bool device_impl::has(aspect Aspect) const {
269269
PI_USM_ATOMIC_ACCESS);
270270
case aspect::usm_restricted_shared_allocations:
271271
return get_info<info::device::usm_restricted_shared_allocations>();
272-
case aspect::usm_system_allocator:
273-
return get_info<info::device::usm_system_allocator>();
272+
case aspect::usm_system_allocations:
273+
return get_info<info::device::usm_system_allocations>();
274274
case aspect::ext_intel_pci_address:
275275
return getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
276276
MDevice, PI_DEVICE_INFO_PCI_ADDRESS, sizeof(pi_device_type),

sycl/source/detail/device_info.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ get_device_info_host<info::device::usm_restricted_shared_allocations>() {
966966
}
967967

968968
template <>
969-
inline bool get_device_info_host<info::device::usm_system_allocator>() {
969+
inline bool get_device_info_host<info::device::usm_system_allocations>() {
970970
return true;
971971
}
972972

@@ -1032,11 +1032,11 @@ struct get_device_info<bool, info::device::usm_restricted_shared_allocations> {
10321032
};
10331033

10341034
// Specialization for system usm query
1035-
template <> struct get_device_info<bool, info::device::usm_system_allocator> {
1035+
template <> struct get_device_info<bool, info::device::usm_system_allocations> {
10361036
static bool get(RT::PiDevice dev, const plugin &Plugin) {
10371037
pi_usm_capabilities caps;
10381038
pi_result Err = Plugin.call_nocheck<PiApiKind::piDeviceGetInfo>(
1039-
dev, pi::cast<RT::PiDeviceInfo>(info::device::usm_system_allocator),
1039+
dev, pi::cast<RT::PiDeviceInfo>(info::device::usm_system_allocations),
10401040
sizeof(pi_usm_capabilities), &caps, nullptr);
10411041
return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS);
10421042
}

sycl/test/on-device/basic_tests/aspects.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ int main() {
9393
if (plt.has(aspect::usm_system_allocator)) {
9494
std::cout << " USM system allocator" << std::endl;
9595
}
96+
if (plt.has(aspect::usm_system_allocations)) {
97+
std::cout << " USM system allocations" << std::endl;
98+
}
9699
}
97100
std::cout << "Passed." << std::endl;
98101
return 0;

0 commit comments

Comments
 (0)