Skip to content
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

[oneDPL] Improve requirements for iterator source types #550

Conversation

danhoeflinger
Copy link
Contributor

@danhoeflinger danhoeflinger commented Jun 26, 2024

This PR aims to improve the specification of permutation_iterator, zip_iterator, and transform_iterator by adding requirements for their source iterator types.

The source iterator type for each of these iterators share the same requirements, for which a name requirement ValidParallelIteratorSource has been defined. There may be a better or more concise name for this requirement.

permutation_iterator has a type IndexMap which has a modified set of requirements from ValidParallelIteratorSource, because some types like zip_iterator and discard_iterator do not make sense in this setting. Additionally, IndexMap can instead be a functor which transforms consecutive indices into a map. In practice, one implementation of this functionality would be to use a transform_iterator<counting_iterator, IndexMap> to provide the iterator serving as the IndexMap in a similar way to other incoming IndexMap iterators.

@akukanov akukanov added the DPL label Aug 12, 2024
source/elements/oneDPL/source/parallel_api.rst Outdated Show resolved Hide resolved
source/elements/oneDPL/source/parallel_api.rst Outdated Show resolved Hide resolved
source/elements/oneDPL/source/parallel_api.rst Outdated Show resolved Hide resolved
source/elements/oneDPL/source/parallel_api.rst Outdated Show resolved Hide resolved
source/elements/oneDPL/source/parallel_api.rst Outdated Show resolved Hide resolved
danhoeflinger and others added 10 commits August 20, 2024 14:17
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
…ike type

(We would need to require that the reversed iterator satisfies legacy random access iterator, but we get that for free as reverse iterator does not modify that trait.)

Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Co-authored-by: Alexey Kukanov <alexey.kukanov@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
@danhoeflinger danhoeflinger force-pushed the dev/dhoeflin/iterator_restrictions branch from ab0dc05 to d00d244 Compare August 20, 2024 18:21
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
@danhoeflinger danhoeflinger merged commit 50c99c2 into uxlfoundation:main Aug 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants