Hi Sven

I don't think it is trivial to modify the sorting algorithm to handle
different array lengths other than just inserting dummy values, as Ian
said. In pysph, I use radix sort, and I use the largest uint32 for padding.
See here:
https://github.com/benma/pysph/blob/7c9bb8da0e366ebc261f54a10686bbb91487cbce/src/sph/sph.py#L222

Best, Marko

Date: Mon, 14 May 2012 10:44:13 +0200
From: Sven Schreiber <[email protected]>
To: [email protected]
Subject: Re: [PyOpenCL] pysph: a particle fluid simulation using
       pyopencl
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hi Marko,

I was looking at the sorting code port/wrappers that you are using there
to see if I could "steal" something, and I stumbled over the comment
"only power-of-two array lengths are supported" in bitonic_sort.py.
Since I know very little about sorting algorithms on GPUs I'm not sure
whether that's an inherent limitation or if it could be easily
generalized. At the very least it seems that it should be possible to
add dummy elements to the array to get to a power-of-two length. Do you
have any hints on how it could be made more general? Also, does the
limitation also apply to the radix sort?

Thanks for any comments,
Sven

On 05/04/2012 01:36 PM, Marko Bencun wrote:
> Hello everyone
>
> I created a sph fluid simulation with Python and pyopencl. Find it here:
> https://github.com/benma/pysph.
>
> I would appreciate any feedback. Also, since I have an nvidia card, I
> would be glad if someone using an ATI card could test it and tell me
> whether it works.
>
> Best, Marko
>
>
> _______________________________________________
> PyOpenCL mailing list
> [email protected]
> http://lists.tiker.net/listinfo/pyopencl
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to