Remove use of inheritance from parallel-for bricks in SYCL backend #2136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #2023.
In #1976, parallel-for bricks were redesigned to have an inheritance relationship with a either a scalar or vector tuning base class in order to inherit compile-time tuning constants. This came with a downside of adding the user-provided range types to the class template of parallel-for bricks, complicating usage from the caller side as more templates must be provided when creating a brick.
This PR removes the use of inheritance from parallel-for bricks along with the range class templates with the following approach:
__can_vectorize
and__can_process_multiple_iters
.__pfor_params
which queries the brick's static members to define vectorization and iters per item tuning parameters.__pfor_params
is passed to the brick when invoking the function call operator which includes vector sizes and whether vectorization should be enabled.Additionally, the
__scalar_path_impl
,__vector_path_impl
, and dispatchoperator()
design of the bricks have been replaced with twooperator()
definitions using SFINAE to define scalar and vector implementations dependent on whether the provided parameter instance is vectorizable.