On 28 September 2015 at 15:45, Andreas Kloeckner <[email protected]> wrote: > > James <[email protected]> writes: > > I am looking for advice on how to use Program.compile and/or > > pyopencl.link_program. I had original thought I could logically divide > > parts of my CL code in to separate Programs/source files that are compiled, > > but not linked immediately. Then when I need to use modules together I can > > pass the list of compiled Program objects to link_program. > > > > However when I try to invoke compile from a Program initialised with a > > source code string I recieve the following error, > > > > def compile(self, options=[], devices=None, headers=[]): > > options = " ".join(options) > >> return self._prg.compile(options, devices, headers) > > E AttributeError: 'NoneType' object has no attribute 'compile' > > > > Looking at the pyopencl source it seems this is because self._prg is not > > initialized if a source string is given. Is this a bug, or am I trying to > > use compile in the wrong manner? Any advice welcome! > > I'm not sure compile/link_program actually works in PyOpenCL. It doesn't > have any tests for it, which is probably a sign that it might not. If > you have a little bit of time, I'd appreciate if you could look into it > and submit a patch, ideally with tests. In the case above, I think > changing _prg to_get_prg() might already be enough. > > Andreas
Andreas, Thanks for the reply. I will take a look at the code and hopefully provide a fix with some tests when I have a moment. James _______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
