-
Notifications
You must be signed in to change notification settings - Fork 757
Add zip_function adaptor to simplify using n-ary functions with zip iterators #1029
Conversation
Running internal CI. @griwes and @jaredhoberock for code review. |
Note that i've left the two new files without a copyright message in them for now as the style seems to be slightly different between the different files I had a quick look at for guidance and i wasnt sure exactly whats needed. Let me know what format you want it in and i can add it or a reviewer can add in whatever is needed by nvidia |
Great submission! |
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.
Looks pretty good. Aside from the small nitpicks, this looks ready to merge as long as we get documentation. Ideally, that would be:
- Doxygen-style comments for the public functionality
- An example program
thrust/zip_function.h
Outdated
} | ||
} | ||
|
||
// Adaptor type that turns an N-ary function object into one that takes a tuple |
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.
This class a Doxygen-style comment, preferably with a demo code snippet.
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.
This is C++11 only, so please give it a C++11 only guard/warning.
Any updates on this review? i believe i've covered off the requested changes.
@brycelelbach @griwes @jaredhoberock can you confirm if the above license is adequate? I'm happy to sign the code over to NVIDIA |
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 think this is almost ready to go -- I had requested an example program and Doxygen comments, and they're in place.
The final thing to do is to update the CHANGELOG to mention these new features and credit @bjude.
I agree that this looks like a really useful feature! I just noted a couple small issues to address before we merge. |
Looks like this is almost ready to go. If you could add the missing newline at the end of |
Missing newline is added. |
@bjude Just to keep you in the loop, I'm working on getting this in now. There are some NVIDIA-internal steps I need to go through to get this merged, but it shouldn't be much longer. |
Internal CI submitted under CL 28074591. |
Eases the use general function objects with zip iterators without modifying them or hand writing a wrapping class Test for zip_function Based on the zip iterator transform test zip_function: Move details into thrust::detal::zip_detail zip_function: make operator() const and make stored function mutable CMake: Add filter for test that require c++11 Only add zip_function for now, making the list exhaustive can be another PR zip_function: Add example to arbitrary_transformation zip_function: Add c++11 guard zip_function: Documentation Zip Function: newline at end of file Allison rewrote some bits to support C++11 compilers. Reviewed-by: Allison Vacanti <alliepiper16@gmail.com>
Rebased, squashed, and fixed some c++11-specific issues caught by CI. |
#721 is stale and hasn't been updated in a few years so this PR updates it and adds a test