lion03 / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

Potentially interpret tuple as an index type in zip_iterator #205

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by jaredhoberock on 3 Sep 2010 at 6:04

GoogleCodeExporter commented 8 years ago
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=22958c2f47c02cb1
a67d8e5c2ad1f788da99f7ac
[2] 
http://groups.google.com/group/thrust-users/browse_thread/thread/d76e6f7d6206790
e/1a7a307e843241f7
[3] 
http://groups.google.com/group/thrust-users/browse_thread/thread/853579a9bccff08
c/33c67c39e7e380a1

Original comment by andrew.c...@gmail.com on 17 Sep 2011 at 3:42

GoogleCodeExporter commented 8 years ago
Forwarded to https://github.com/thrust/thrust/issues/70

Original comment by jaredhoberock on 7 May 2012 at 9:25