Skip to content

[NFC][SYCL] Add device_images_range helper #19508

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
Jul 21, 2025
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
12 changes: 12 additions & 0 deletions sycl/source/detail/device_image_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,18 @@ class device_image_impl
std::unique_ptr<DynRTDeviceBinaryImage> MMergedImageStorage = nullptr;
};

using device_images_iterator =
variadic_iterator<device_image_plain,
std::vector<device_image_plain>::const_iterator,
std::set<device_image_impl *>::const_iterator>;
class device_images_range : public iterator_range<device_images_iterator> {
private:
using Base = iterator_range<device_images_iterator>;

public:
using Base::Base;
};

} // namespace detail
} // namespace _V1
} // namespace sycl
2 changes: 2 additions & 0 deletions sycl/source/detail/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ template <typename SyclTy, typename... Iterators> class variadic_iterator {
},
It);
}

pointer operator->() { return &this->operator*(); }
};

// Non-owning!
Expand Down
Loading