allendaicool / thrust

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

optimize handling of BinaryPredicates when pred is an equivalence relation. #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In algorithms like unique() or unique_by_key() we apply the predicate to
adjacent elements in the key sequence and explicitly store the boolean
results.  In most cases, is_arithmetic<T> is true and pred is equal_to<T>,
and therefore pred is an equivalence relation.  In this situation we can
avoid computing explicit predicate values and simply carry the keys through
the segmented scan.

Original issue reported on code.google.com by wnbell on 25 Jan 2010 at 1:00

GoogleCodeExporter commented 9 years ago

Original comment by wnbell on 25 Jan 2010 at 1:00

GoogleCodeExporter commented 9 years ago
In the most recent C++0x draft the predicate is required to be an equivalence 
relation:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3090.pdf

Section 25.3.9 Unique
  Requires: The comparison function shall be an equivalence relation

Original comment by wnbell on 16 May 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Forwarded to https://github.com/thrust/thrust/issues/77

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