32 bits sorting FAILED !!!!

10 views
Skip to first unread message

Viewon01

unread,
Jul 22, 2011, 8:39:41 AM7/22/11
to clpp
Hi all,

Currently, both version of the radix-sort (CPU and GPU) failed to sort
32 bits values !

If you try to sort with 28 bits (or less)... it works !!!

So, what is common in the CPU and GPU part are the local-histogram
construction and the global-permutation phase. So, the problem is
there (I have even check the values of the previous phases and its
correct).
I don't know where is the problem. So, if someone find it, it will be
great because I have no more time to fix this last bug before release
of V1.0 of CLPP !

BTW : I have add documentation and also a direct load of the ".CL"
file in the clppRadixSort.cpp (To be changed for the release).

Thanks

Krys

Viewon01

unread,
Jul 22, 2011, 9:04:09 AM7/22/11
to clpp
In fact, the problem occur also with 16 bits values !!!

Chad Brewbaker

unread,
Jul 22, 2011, 9:37:10 AM7/22/11
to cl...@googlegroups.com

What was the last version in SVN that was working?

kr...@polarlights.net

unread,
Jul 22, 2011, 9:44:45 AM7/22/11
to cl...@googlegroups.com
Hi Chad,

I don't know...

In fact I have already discovered the bug there is a long time. And... due to a bug in the "numbers" generator I have miss it !

So, if you want to compare, first, we have to update the benchmark.cpp with the last one !

I have just discovered that all the sort-algorithms failed with :
8,16,24,32 bits sort but not with 4,12,20,28 !!!!! strange !!

At first, I was suspecting that I was not correctly generating the random values !
But I think that the last version is correct !

Regards

Krys

rapatel

unread,
Jul 22, 2011, 2:27:25 PM7/22/11
to clpp
What type of values are you sorting? Int or Unsigned Int?

Ritesh

On Jul 22, 6:44 am, k...@polarlights.net wrote:
> Hi Chad,
>
> I don't know...
>
> In fact I have already discovered the bug there is a long time. And... due to a bug in the "numbers" generator I have miss it !
>
> So, if you want to compare, first, we have to update the benchmark.cpp with the last one !
>
> I have just discovered that all the sort-algorithms failed with :
> 8,16,24,32 bits sort but not with 4,12,20,28 !!!!! strange !!
>
> At first, I was suspecting that I was not correctly generating the random values !
> But I think that the last version is correct !
>
> Regards
>
> Krys
>
>
>
>
>
>
>
> -----Original Message-----
> From: "Chad Brewbaker" <crb...@gmail.com>
> Sent: Friday, July 22, 2011 9:37am
> To: cl...@googlegroups.com
> Subject: Re: 32 bits sorting FAILED !!!!
>
> What was the last version in SVN that was working?

kr...@polarlights.net

unread,
Jul 23, 2011, 2:52:35 AM7/23/11
to cl...@googlegroups.com
"Int32", they are generated in 'makeRandomInt32Vector'

crb002

unread,
Jul 24, 2011, 1:28:32 AM7/24/11
to clpp
Lol. Hmm. I will get around to writing some unit tests. Perhaps make
some analogues of the LLVM CLANG std::sort() testing functions.


On Jul 22, 8:44 am, k...@polarlights.net wrote:
> Hi Chad,
>
> I don't know...
>
> In fact I have already discovered the bug there is a long time. And... due to a bug in the "numbers" generator I have miss it !
>
> So, if you want to compare, first, we have to update the benchmark.cpp with the last one !
>
> I have just discovered that all the sort-algorithms failed with :
> 8,16,24,32 bits sort but not with 4,12,20,28 !!!!! strange !!
>
> At first, I was suspecting that I was not correctly generating the random values !
> But I think that the last version is correct !
>
> Regards
>
> Krys
>
>
>
> -----Original Message-----
> From: "Chad Brewbaker" <crb...@gmail.com>
> Sent: Friday, July 22, 2011 9:37am
> To: cl...@googlegroups.com
> Subject: Re: 32 bits sorting FAILED !!!!
>
> What was the last version in SVN that was working?

kr...@polarlights.net

unread,
Jul 24, 2011, 6:52:00 AM7/24/11
to cl...@googlegroups.com
benchmark.cpp is a "unit test" and if you want to compare you can test the simplest "clppSort_CPU" that use the std::sort.

The problem is that this sort algorithm is not OpenCL based and cannot sort based on a radix parameter !!

Krys

Reply all
Reply to author
Forward
0 new messages