Ian Johnson <enjalot@...> writes:
https://github.com/enjalot/adventures_in_opencl/tree/master/python/part2
It does require pygame (I should probably switch to tkinter to remove a
dependency) and numpy at least version 1.4 (altho I may remove the code that
depends on this since it is not that important). I'll do those things before I
write it up.
pygame is find...setuptools knows about it, right? easy_install pygame worked
for me, I think.
I finally got contexts working (not sure how, and I ain't gonna reboot this
machine ever ever ever again :-) and this demo works awesomely on me HD5870.
I changed line 174 of main.py to this:
print clock.tick(60)
so I can see what the particle limit appears to be (line 37):
num = 85000
It looks like around 85000 particles is the most I can do before I start to slow
the frame rate down on the GPU.
To test the CPU context, I changed like 17 in part2.py to this:
self.ctx = cl.Context(properties=[
(cl.context_properties.PLATFORM, plats[0])]
+ get_gl_sharing_context_properties(), devices=
[plats[0].get_devices()[1]])
and oddly enough, I it takes about 190000 particles before the frame rate starts
to be affected. I guess this particular kernel is just better suited to the CPU
in my case.
PyOpenCL takes the a lot of pain and tedium out of
OpenCL <3
Yes indeed!
--Keith Brafford