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

Make kernel names unique in radix sort #1927

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

dmitriy-sobolev
Copy link
Contributor

@dmitriy-sobolev dmitriy-sobolev commented Oct 31, 2024

Fixes #1922. You can find elaborate description of the issue there.

It appears that _Proj, a lambda declared in __pattern_sort_by_key template, will have different types for different __patter_sort_by_key instantiations:
https://github.com/oneapi-src/oneDPL/blob/28cb633583570457a2e21a752f6a517f5fc7134a/include/oneapi/dpl/pstl/hetero/algorithm_impl_hetero.h#L1274-L1275

Here is a simplified example of a lambda having different types in different function template instantiations: https://godbolt.org/z/ddrM6Tseq

Signed-off-by: Dmitriy Sobolev <dmitriy.sobolev@intel.com>
Signed-off-by: Dmitriy Sobolev <dmitriy.sobolev@intel.com>
Copy link
Contributor

@adamfidel adamfidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. The projection operator should definitely be part of the kernel name since the lambda's type is embedding the input iterator, which can change for different calls.

Copy link
Contributor

@danhoeflinger danhoeflinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmitriy-sobolev dmitriy-sobolev merged commit ac39d7e into main Oct 31, 2024
23 checks passed
@dmitriy-sobolev dmitriy-sobolev deleted the dev/dmitriy-sobolev/sort-mangling branch October 31, 2024 18:14
timmiesmith pushed a commit that referenced this pull request Nov 19, 2024
Signed-off-by: Dmitriy Sobolev <dmitriy.sobolev@intel.com>
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.

sort_by_key gives multiple definitions for the same mangled name
3 participants