From 644ba6c4245c1ce69136df28c5c98bed4f40acc8 Mon Sep 17 00:00:00 2001 From: Chris Perkins Date: Wed, 4 Jan 2023 18:38:04 -0800 Subject: [PATCH 1/3] empty platforms shouldn't be gathered --- sycl/source/detail/platform_impl.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index a1382cecacc70..5281216c0f41c 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -126,10 +126,8 @@ std::vector platform_impl::get_platforms() { // insert PiPlatform into the Plugin Plugin.getPlatformId(PiPlatform); } - // The users of (deprecated) SYCL_DEVICE_ALLOWLIST expect that - // platforms with no devices will not be reported. - if (!SYCLConfig::get() || - !Platform.get_devices(info::device_type::all).empty()) { + + if (!Platform.get_devices(info::device_type::all).empty()) { Platforms.push_back(Platform); } } From 1b470eeb3f5eb63b2bcfa6a6f7dffd1c9f796e0c Mon Sep 17 00:00:00 2001 From: Chris Perkins Date: Wed, 4 Jan 2023 18:43:41 -0800 Subject: [PATCH 2/3] i forgot to clang-format, and now I must pay --- sycl/source/detail/platform_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index 5281216c0f41c..4f43b99fea918 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -126,7 +126,7 @@ std::vector platform_impl::get_platforms() { // insert PiPlatform into the Plugin Plugin.getPlatformId(PiPlatform); } - + if (!Platform.get_devices(info::device_type::all).empty()) { Platforms.push_back(Platform); } From e52d338d36d9b4400a6aa9f360e0896fb0427624 Mon Sep 17 00:00:00 2001 From: Chris Perkins Date: Thu, 5 Jan 2023 14:31:14 -0800 Subject: [PATCH 3/3] reviewer feedback. add comment with spec citation --- sycl/source/detail/platform_impl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index 4f43b99fea918..47e4558fd5635 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -127,6 +127,9 @@ std::vector platform_impl::get_platforms() { Plugin.getPlatformId(PiPlatform); } + // The SYCL spec says that a platform has one or more devices. ( SYCL + // 2020 4.6.2 ) If we have an empty platform, we don't report it back + // from platform::get_platforms(). if (!Platform.get_devices(info::device_type::all).empty()) { Platforms.push_back(Platform); }