How to distinguish between Int and Uint

13 views
Skip to first unread message

rapatel

unread,
Sep 8, 2011, 4:38:10 PM9/8/11
to clpp
Hi,

I am trying to sort a large amount of unsigned integers. However, I am
not sure how to the CLPP API determines whether the data I have passed
it is Int or Uint. Can you please help me out with this. Thanks.

Ritesh

kr...@polarlights.net

unread,
Sep 8, 2011, 4:44:40 PM9/8/11
to cl...@googlegroups.com
The current version of CLPP work only for 'uint'.

Regards

rapatel

unread,
Sep 8, 2011, 4:49:16 PM9/8/11
to clpp
Ok, I am confused on this. In the file "clppSort_RadixSort.cl", I see
the following code:

source = _keysOnly ? "#define MAX_KV_TYPE 0x7FFFFFFF\n" : "#define
MAX_KV_TYPE ((int2)(0x7FFFFFFF,0xFFFFFFFF))\n";
source += _keysOnly ? "#define KV_TYPE int\n" : "#define KV_TYPE
int2\n";

I am trying to sort my unsigned integers and it is failing. You have
clppSort_RadixSort.cl and clppSort_RadixSortGPU.cl. I am not sure
which one to use. Can you please explain to me what I am doing wrong
here.

I am using the .cl files because I have made a few changes inside the
kernels, therefore, I am using the .cl files.

-Ritesh

kr...@polarlights.net

unread,
Sep 8, 2011, 5:21:41 PM9/8/11
to cl...@googlegroups.com
You're right, I have to modify this. In fact I should review to support int and uint sorting.

To create a "sort" class use clpp::createBestSort.... it will create the 'best' sorting algorithm depending of your context (CPU or GPU, number of elements to sort...).

-----Original Message-----
From: "rapatel" <rite...@gmail.com>

Reply all
Reply to author
Forward
0 new messages