-
Notifications
You must be signed in to change notification settings - Fork 115
[Dynamic Selection] Customization of Backends and Policies #2508
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
base: main
Are you sure you want to change the base?
Conversation
…t after, also removed submit from the sycl_backend. Now uses the base implementation
…t after, also removed submit from the sycl_backend. Now uses the base implementation
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Dynamic Selection API to enhance customizability and simplify the user interface by removing the public select() function and introducing a flexible backend architecture with ResourceAdapter support.
Key changes:
- Introduced
policy_base.handdefault_backend.hproviding common base classes for policies and backends - Removed public
select()API - selections are now internal, with users exclusively usingtry_submit(),submit(), andsubmit_and_wait() - Added
ResourceAdaptersupport to backends, enabling different resource flavors (e.g.,sycl::queuevssycl::queue*)
Reviewed Changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/support/utils_invoke.h | Added include for execution header |
| test/support/utils_dynamic_selection.h | New utility header with DummyResource and wait_type helper |
| test/support/test_offset_utils.h | Removed select-before-submit tests, updated to use get_wait_type helper |
| test/support/test_dynamic_selection_utils.h | Removed select tests, added default universe initialization test, updated wait_type access |
| test/support/test_dynamic_selection_one_policy.h | Updated test policies to use try_select_impl and removed selection-based submit variants |
| test/support/test_dynamic_load_utils.h | Removed select tests, added CustomName template param, updated adapter usage |
| test/support/iterator_utils.h | Moved is_const_iterator from internal namespace to local scope |
| test/support/inline_backend.h | Added ResourceAdapter support, enhanced comparison operators, added reporting validation |
| test/parallel_api/dynamic_selection/*.pass.cpp | Updated policy template arguments and removed select-before-submit test variants |
| include/oneapi/dpl/internal/dynamic_selection_traits.h | Removed select() API, added try_submit() support, updated submit interfaces |
| include/oneapi/dpl/internal/dynamic_selection_impl/sycl_backend.h | Converted to partial specialization of default_backend with profiling tag support |
| include/oneapi/dpl/internal/dynamic_selection_impl/round_robin_policy.h | Refactored to use policy_base, implements try_select_impl |
| include/oneapi/dpl/internal/dynamic_selection_impl/policy_traits.h | Removed selection_type and wait_type from policy traits |
| include/oneapi/dpl/internal/dynamic_selection_impl/policy_base.h | New base class providing common policy functionality |
| include/oneapi/dpl/internal/dynamic_selection_impl/fixed_resource_policy.h | Refactored to use policy_base |
| include/oneapi/dpl/internal/dynamic_selection_impl/dynamic_load_policy.h | Refactored to use policy_base with required reporting |
| include/oneapi/dpl/internal/dynamic_selection_impl/default_backend.h | New default backend implementation with resource adapter support |
| include/oneapi/dpl/internal/dynamic_selection_impl/backend_traits.h | Added scratch space traits and detection |
| include/oneapi/dpl/internal/dynamic_selection_impl/auto_tune_policy.h | Refactored to use policy_base, implements try_select_impl |
| include/oneapi/dpl/dynamic_selection | Added default_backend.h include |
| examples/dynamic_selection//src/.cpp | Updated policy template arguments from Backend to ResourceType |
| documentation/library_guide/dynamic_selection_api/*.rst | Removed select() and report() documentation |
Comments suppressed due to low confidence (1)
include/oneapi/dpl/internal/dynamic_selection_impl/policy_base.h:1
- Using
static_assert(false, ...)unconditionally will cause a compilation error. This should use a dependent false type trait likestatic_assert(sizeof(Policy) == 0, ...).
// -*- C++ -*-
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
include/oneapi/dpl/internal/dynamic_selection_impl/fixed_resource_policy.h
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Signed-off-by: Dan Hoeflinger <[email protected]>
Dynamic Selection API: Backend and Policy Customization & Removal of Selection API
This PR refactors the Dynamic Selection API to introduce a flexible backend architecture and simplify the user-facing API by removing the
select()function. It provides better tools for customization of backend and policies to allow for easier customization and more flexibility for users.Implements RFCs #2220 and #2489 (without token policy, that will be a separate PR).
Key Changes
Backend Architecture
policy_base.handdefault_backend.hto provide common base classes for policies and backends respectivelyResourceAdapterfunction to support different flavors of resource with the same backend (e.g.sycl::queuevssycl::queue*)API Simplification
select()function - selections are now internal implementation detailstry_submit- always returns astd::optionalquickly, returns empty if unable to obtain a resourcetry_submit,submit()andsubmit_and_wait()functionstry_select_impl()(returnsstd::optional) instead of publicselect()Execution Info & Reporting
Summary of changes to look out for from individual components: