-
Notifications
You must be signed in to change notification settings - Fork 188
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
Several improvements to zip_iterator/zip_function #1710
Conversation
_CCCL_HOST_DEVICE Function& underlying_function() const | ||
{ | ||
return func; | ||
} |
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.
Thanks for adding this. This makes it easier to "undo" the zip_function when the zip iterator has been destructured, and will be really helpful for the thrust::transform
performance work.
thrust/thrust/zip_function.h
Outdated
@@ -154,6 +140,9 @@ template <typename Function> | |||
class zip_function | |||
{ | |||
public: | |||
//! Default constructs Function. |
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.
Please Ignore: I am not a fan of comments that add no information
//! Default constructs Function. | |
//! Default constructs function. |
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.
I hate that too, so what do you prefer:
- Drop the comment
- Reword to "Default constructs the contained function object"
I thought I would make it clear that there is no partially formed state, and you can call a default constructed zip_function
.
Also, I spelled it Function
on purpose, because it is the name of the class template parameter. function
does not refer to any entity within this scope.
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.
"Default constructs the contained function object." it is.
🟨 CI Results [ Failed: 115 | Passed: 83 | Total: 198 ]
|
# | Runner |
---|---|
154 | linux-amd64-cpu16 |
16 | linux-arm64-cpu16 |
16 | linux-amd64-gpu-v100-latest-1 |
12 | windows-amd64-cpu16 |
👃 Inspect Changes
Modifications in project?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
+/- | Thrust |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
+/- | CUB |
+/- | Thrust |
🟩 CI Results [ Failed: 0 | Passed: 198 | Total: 198 ]
|
# | Runner |
---|---|
154 | linux-amd64-cpu16 |
16 | linux-arm64-cpu16 |
16 | linux-amd64-gpu-v100-latest-1 |
12 | windows-amd64-cpu16 |
👃 Inspect Changes
Modifications in project?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
CUB | |
+/- | Thrust |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
libcu++ | |
+/- | CUB |
+/- | Thrust |
This PR adds a few improvements to
zip_iterator
/zip_function
, which come out of the collaboration with @ahendriksen who is playing with thrust in BabelStream. There, we need to unwrap zip iterators/functions, which is why I added a few such observers. I also modernized and improved the documentation examples a bit.