Inherit thrust::transform_iterator traversal from base iterator traversal#5883
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
|
/ok to test cf00e5e |
| use_default, | ||
| typename ::cuda::std::iterator_traits<Iterator>::iterator_category, | ||
| use_default, // pick system from Iterator | ||
| use_default, // pick traversal from Iterator |
There was a problem hiding this comment.
This line is the fix to #5860 and I also think it's an overall cleaner behavior. I don't know though why the old behavior was chosen. Need to do some digging.
There was a problem hiding this comment.
Found a hint: https://github.com/NVIDIA/cccl/pull/1915/files#diff-866ad8d2535a5dd3e954db56809b4673fcce2b064fc630fe24c872c5e8195a81L61-L67
typedef thrust::iterator_adaptor<transform_iterator<UnaryFunc, Iterator, Reference, Value>,
Iterator,
value_type,
thrust::use_default // Leave the system alone
//, thrust::use_default // Leave the traversal alone
// use the Iterator's category to let any system iterators remain
// random access even though transform_iterator's reference type
// may not be a reference
// XXX figure out why only iterators whose reference types are
// true references are random access
,
typename thrust::iterator_traits<Iterator>::iterator_category,
reference>It seems category was used to work around any system iterators loosing their random accessness. Let's see whether this problem still exists.
There was a problem hiding this comment.
I added tests to check whether the properties of a random access any system iterator are retained through a transform iterator. And they are. So I think the fix is legit.
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
8c71eea to
1fa341e
Compare
This comment has been minimized.
This comment has been minimized.
…rsal Instead of from the base iterator's iterator category. Fixes: NVIDIA#5860
fe93a03 to
1ed55d1
Compare
🥳 CI Workflow Results🟩 Finished in 3h 11m: Pass: 100%/159 | Total: 6d 01h | Max: 3h 02m | Hits: 65%/186335See results here. |
…versal (NVIDIA#5883) Instead of from the base iterator's iterator category. Fixes: NVIDIA#5860
Instead of from the base iterator's iterator category.
iterator_category_to_systemfor device iterator tags #5880Fixes: #5860