lion03 / thrust

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

Eliminate warnings due to thrust::sequence #337

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We get a ton of warnings about possible loss of data from thrust::sequence's 
implementation.

The problem is that counting_iterator's difference_type is 64b by default on 
32b platforms (to avoid overflowing the value_type).  When we zip this up with 
sequence's ForwardIterator, it produces a zip_iterator with a 64b 
difference_type.  When we try to increment the ForwardIterator by a 64b index, 
MSVC warns.

To fix this, we should specify that the counting_iterator should just inherit 
the ForwardIterator's difference_type by making the following change:

thrust/detail/sequence.inl:88:

thrust::counting_iterator<difference_type, thrust::use_default, 
thrust::use_default, difference_type> iter(0);

Original issue reported on code.google.com by jaredhoberock on 16 May 2011 at 6:26

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 8656c6612d42.

Original comment by jaredhoberock on 23 May 2011 at 7:19