On Thu, Feb 17, 2011 at 10:14 AM, Andreas Kloeckner <lists(a)informa.tiker.net
wrote:
> On Thu, 17 Feb 2011 00:59:36 -0500, Ian Johnson <enjalot(a)gmail.com
wrote:
> > My problem is that I use the
Mac a lot, and PyOpenCL doesn't support
> OpenGL
> > context sharing, so I decided to add it. I don't think my way of adding
> it
> > is the cleanest, because I just added a #ifdef __APPLE__ in
> create_context
> > which will go ahead and create from an OpenGL context if no devices are
> > passed in (instead of using createContextFromType) as demonstrated in
> this
> > pdf:
> >
http://sa10.idav.ucdavis.edu/docs/sa10-dg-opencl-gl-interop.pdf
> >
> > In my limited (and 1.0) experience the two cases on a mac are where you
> > choose a device (either gpu or cpu) and don't share with GL, or you do
> this
> > very specific command for creating from GL context (no other combination
> of
> > standard createContext calls seem to work for GL sharing)
> >
> > I have attached my git diff (only a few lines in wrap_cl.hpp and
> > gl_interop_demo.py) and the demo works on my mac!
>
> I've reworked your patch a bit to make what is happening a bit more
> explicit--can you please try my changes and report back?
>
I had to add some more stuff to accomodate apple's weird define for the
context property, also with apple you can't use createContextFromType to do
GL sharing, so the user has to pass in an empty device array if on apple.
(also we don't pass in the platform to the properties array when doing GL
sharing on apple)
I do like the improvements with pyopencl.tools function call, makes it much
nicer for the user!
Also as a side note, when building from git
doing
git submodule init
git submodule update
did not seem to get all of the dependencies for pyopencl (it was missing
ptr_container) so I manually pulled from bpl-subset.git and replaced the
bpl-subset folder inside pyopencl
Should be fixed in git.
This still didn't work for me =\ I checked out a fresh copy of the repo to
test the changes and bpl-subset still seemed to be missing files:
src/wrapper/mempool.hpp:12:43: error: boost/ptr_container/ptr_map.hpp: No
such file or directory
src/wrapper/mempool.hpp:14:28: error: boost/format.hpp: No such file or
directory
Copying the actual bpl-subset directory worked again tho.
Thanks for your contribution!
Andreas
--
Ian Johnson
http://enja.org