[llvm] [libsycl] Generic code cleanup (PR #224330)

Sergey Semenov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 15:08:04 PDT 2026


================
@@ -27,55 +27,54 @@ platform device::get_platform() const {
 
 backend device::get_backend() const noexcept { return impl->getBackend(); }
 
-std::vector<device> device::get_devices(info::device_type DeviceType) {
+std::vector<device> device::get_devices(info::device_type type) {
   std::vector<device> Devices;
 
   // Not calling platform::get_devices to avoid multiple vector packing
-  for (auto &PlatformImpl : detail::PlatformImpl::getPlatforms()) {
-    assert(PlatformImpl && "PlatformImpl can not be nullptr");
-    PlatformImpl->iterateDevices(
-        DeviceType, [&Devices](detail::DeviceImpl *DevImpl) {
-          assert(DevImpl && "Device impl can't be nullptr");
-          Devices.push_back(detail::createSyclObjFromImpl<device>(*DevImpl));
-        });
+  for (const auto &Impl : detail::PlatformImpl::getPlatforms()) {
+    assert(Impl && "PlatformImpl can not be nullptr");
----------------
sergey-semenov wrote:

Very tiny nitpick, but we should probably stick to the same wording for this type of asserts (with a contraction or without).

https://github.com/llvm/llvm-project/pull/224330


More information about the llvm-commits mailing list