lion03 / thrust

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

wrong sort algorithm is used by default #317

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
in thrust/detail/device/cuda/detail/stable_radix_sort.inl there is a line which 
reads:

#if !defined(THRUST_USE_MERRILL_RADIX_SORT) || (THRUST_USE_MERRILL_RADIX_SORT 
== 1)

the condition will evaluate to true if THRUST_USE_MERRILL_RADIX_SORT is NOT 
defined. I imagine the intention was for it to evaluate to true if it IS 
defined. By default thrust 1.3.0 will use the Merrill implementation of radix 
sort.

diman

Original issue reported on code.google.com by diman.to...@gmail.com on 4 Mar 2011 at 12:59

GoogleCodeExporter commented 8 years ago
If THRUST_USE_MERRIL_RADIX_SORT is undefined, Merrill's implementation is used 
(by default).

If THRUST_USE_MERRIL_RADIX_SORT is defined to 0, Merrill's implementation is 
not used.

If THRUST_USE_MERRIL_RADIX_SORT is defined to 1, Merrill's implementation is 
used.

This is the intended behavior.

Original comment by jaredhoberock on 4 Mar 2011 at 2:08

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Merrill's radix sort is ~3x faster than the previous implementation.  We 
retained the old code so we could revert back to it if any problems were 
discovered.  The latent code will be removed in Thrust v1.5.

Original comment by wnbell on 4 Mar 2011 at 2:22

GoogleCodeExporter commented 8 years ago
I am afraid I don't see that improvement. I am sorting a fairly short sequence 
(2000 to 10000 elements) but I am sorting it often. My code runs about 1/3rd 
faster if I use the legacy code. Perhaps Merrill's code does a lot of expensive 
initialization which only pays off when sorting large sequences?

Original comment by diman.to...@gmail.com on 4 Mar 2011 at 2:34