From 75d5071f10860892eaac6df77bf9f9264907d8f0 Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Mon, 28 Jun 2021 12:49:59 +0300 Subject: [PATCH 1/2] Rename usm_system_allocator to usm_system_allocations This patch renames usm_system_allocator to usm_system_allocations to conform SYCL 2020 spec. --- sycl/include/CL/sycl/aspects.hpp | 2 +- sycl/include/CL/sycl/info/device_traits.def | 2 +- sycl/include/CL/sycl/info/info_desc.hpp | 2 +- sycl/source/detail/device_impl.cpp | 4 ++-- sycl/source/detail/device_info.hpp | 6 +++--- sycl/test/on-device/basic_tests/aspects.cpp | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sycl/include/CL/sycl/aspects.hpp b/sycl/include/CL/sycl/aspects.hpp index 24513ed3e515d..5699e78bdc9c3 100644 --- a/sycl/include/CL/sycl/aspects.hpp +++ b/sycl/include/CL/sycl/aspects.hpp @@ -30,7 +30,7 @@ enum class aspect { usm_host_allocations = 14, usm_shared_allocations = 15, usm_restricted_shared_allocations = 16, - usm_system_allocator = 17, + usm_system_allocations = 17, ext_intel_pci_address = 18, ext_intel_gpu_eu_count = 19, ext_intel_gpu_eu_simd_width = 20, diff --git a/sycl/include/CL/sycl/info/device_traits.def b/sycl/include/CL/sycl/info/device_traits.def index f3d4dd6b1d1b3..aa288dbe26d51 100644 --- a/sycl/include/CL/sycl/info/device_traits.def +++ b/sycl/include/CL/sycl/info/device_traits.def @@ -84,7 +84,7 @@ __SYCL_PARAM_TRAITS_SPEC(device, usm_device_allocations, bool) __SYCL_PARAM_TRAITS_SPEC(device, usm_host_allocations, bool) __SYCL_PARAM_TRAITS_SPEC(device, usm_shared_allocations, bool) __SYCL_PARAM_TRAITS_SPEC(device, usm_restricted_shared_allocations, bool) -__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocator, bool) +__SYCL_PARAM_TRAITS_SPEC(device, usm_system_allocations, bool) __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_pci_address, string_class) __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_count, pi_uint32) __SYCL_PARAM_TRAITS_SPEC(device, ext_intel_gpu_eu_simd_width, pi_uint32) diff --git a/sycl/include/CL/sycl/info/info_desc.hpp b/sycl/include/CL/sycl/info/info_desc.hpp index f221638c9af99..12315057b9ba7 100644 --- a/sycl/include/CL/sycl/info/info_desc.hpp +++ b/sycl/include/CL/sycl/info/info_desc.hpp @@ -130,7 +130,7 @@ enum class device : cl_device_info { usm_host_allocations = PI_USM_HOST_SUPPORT, usm_shared_allocations = PI_USM_SINGLE_SHARED_SUPPORT, usm_restricted_shared_allocations = PI_USM_CROSS_SHARED_SUPPORT, - usm_system_allocator = PI_USM_SYSTEM_SHARED_SUPPORT, + usm_system_allocations = PI_USM_SYSTEM_SHARED_SUPPORT, // intel extensions ext_intel_pci_address = PI_DEVICE_INFO_PCI_ADDRESS, diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index 172c19be83344..05760db93a92b 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -268,8 +268,8 @@ bool device_impl::has(aspect Aspect) const { PI_USM_ATOMIC_ACCESS); case aspect::usm_restricted_shared_allocations: return get_info(); - case aspect::usm_system_allocator: - return get_info(); + case aspect::usm_system_allocations: + return get_info(); case aspect::ext_intel_pci_address: return getPlugin().call_nocheck( MDevice, PI_DEVICE_INFO_PCI_ADDRESS, sizeof(pi_device_type), diff --git a/sycl/source/detail/device_info.hpp b/sycl/source/detail/device_info.hpp index bf3eb0561ef7a..a104f82cd3ea2 100644 --- a/sycl/source/detail/device_info.hpp +++ b/sycl/source/detail/device_info.hpp @@ -948,7 +948,7 @@ get_device_info_host() { } template <> -inline bool get_device_info_host() { +inline bool get_device_info_host() { return true; } @@ -1014,11 +1014,11 @@ struct get_device_info { }; // Specialization for system usm query -template <> struct get_device_info { +template <> struct get_device_info { static bool get(RT::PiDevice dev, const plugin &Plugin) { pi_usm_capabilities caps; pi_result Err = Plugin.call_nocheck( - dev, pi::cast(info::device::usm_system_allocator), + dev, pi::cast(info::device::usm_system_allocations), sizeof(pi_usm_capabilities), &caps, nullptr); return (Err != PI_SUCCESS) ? false : (caps & PI_USM_ACCESS); } diff --git a/sycl/test/on-device/basic_tests/aspects.cpp b/sycl/test/on-device/basic_tests/aspects.cpp index 521247708a774..d4463122984d6 100644 --- a/sycl/test/on-device/basic_tests/aspects.cpp +++ b/sycl/test/on-device/basic_tests/aspects.cpp @@ -87,8 +87,8 @@ int main() { if (plt.has(aspect::usm_restricted_shared_allocations)) { std::cout << " USM restricted shared allocations" << std::endl; } - if (plt.has(aspect::usm_system_allocator)) { - std::cout << " USM system allocator" << std::endl; + if (plt.has(aspect::usm_system_allocations)) { + std::cout << " USM system allocations" << std::endl; } } std::cout << "Passed." << std::endl; From a185fc5aca5988af65ea80cd17a3a727deff1a13 Mon Sep 17 00:00:00 2001 From: Dmitry Vodopyanov Date: Wed, 7 Jul 2021 19:14:46 +0300 Subject: [PATCH 2/2] Fix CR comments --- sycl/include/CL/sycl/aspects.hpp | 2 ++ sycl/include/CL/sycl/info/info_desc.hpp | 2 ++ sycl/test/on-device/basic_tests/aspects.cpp | 3 +++ 3 files changed, 7 insertions(+) diff --git a/sycl/include/CL/sycl/aspects.hpp b/sycl/include/CL/sycl/aspects.hpp index 5699e78bdc9c3..b534acfa145a4 100644 --- a/sycl/include/CL/sycl/aspects.hpp +++ b/sycl/include/CL/sycl/aspects.hpp @@ -31,6 +31,8 @@ enum class aspect { usm_shared_allocations = 15, usm_restricted_shared_allocations = 16, usm_system_allocations = 17, + usm_system_allocator __SYCL2020_DEPRECATED( + "use usm_system_allocations instead") = usm_system_allocations, ext_intel_pci_address = 18, ext_intel_gpu_eu_count = 19, ext_intel_gpu_eu_simd_width = 20, diff --git a/sycl/include/CL/sycl/info/info_desc.hpp b/sycl/include/CL/sycl/info/info_desc.hpp index 12315057b9ba7..3b053c7567159 100644 --- a/sycl/include/CL/sycl/info/info_desc.hpp +++ b/sycl/include/CL/sycl/info/info_desc.hpp @@ -131,6 +131,8 @@ enum class device : cl_device_info { usm_shared_allocations = PI_USM_SINGLE_SHARED_SUPPORT, usm_restricted_shared_allocations = PI_USM_CROSS_SHARED_SUPPORT, usm_system_allocations = PI_USM_SYSTEM_SHARED_SUPPORT, + usm_system_allocator __SYCL2020_DEPRECATED( + "use usm_system_allocations instead") = usm_system_allocations, // intel extensions ext_intel_pci_address = PI_DEVICE_INFO_PCI_ADDRESS, diff --git a/sycl/test/on-device/basic_tests/aspects.cpp b/sycl/test/on-device/basic_tests/aspects.cpp index d4463122984d6..1afb91ad3824f 100644 --- a/sycl/test/on-device/basic_tests/aspects.cpp +++ b/sycl/test/on-device/basic_tests/aspects.cpp @@ -87,6 +87,9 @@ int main() { if (plt.has(aspect::usm_restricted_shared_allocations)) { std::cout << " USM restricted shared allocations" << std::endl; } + if (plt.has(aspect::usm_system_allocator)) { + std::cout << " USM system allocator" << std::endl; + } if (plt.has(aspect::usm_system_allocations)) { std::cout << " USM system allocations" << std::endl; }