Potentially interpret tuple as an index type in zip_iterator
z_iter[(i,j,k)] could potentially make sense if the tuple is the right size and the element types are each convertible to zip_iterator::difference_type
Comment 1 by andrew.corrigan, Sep 16, 2011 I implemented a new iterator called multi_permutation_iterator [1]. It is a new iterator which is like a permutation_iterator but with tuple-valued indexes, and thus dereferences to produce tuples of values from ElementIterator, as opposed to a single value like permutation_iterator. This implements the functionality I described last year, which led to this issue being opened. [2]
As compared to a combination of zip_iterator and multiple permutation_iterators, this new iterator has the advantage of only using one ElementIterator, which can reduce register usage and also parameter size (and thus avoid launch_closure_by_pointer and its memory allocation and copy). This has already helped speed up my code quite a bit, where so far I use it to implement non-contiguous, coalesced multi-dimensional arrays. This multi_permutation_iterator should also help others implement things like finite-difference stencils without excessive register usage, as discussed in [3].
[1] https://code.google.com/r/andrewcorrigan-thrust/source/detail?r=22958c2f47c02cb1a67d8e5c2ad1f788da99f7ac [2] http://groups.google.com/group/thrust-users/browse_thread/thread/d76e6f7d6206790e/1a7a307e843241f7 [3] http://groups.google.com/group/thrust-users/browse_thread/thread/853579a9bccff08c/33c67c39e7e380a1
Forwarded from http://code.google.com/p/thrust/issues/detail?id=205