On Thu, 6 Oct 2011 07:32:26 -0300, andrew cooke <[email protected]> wrote: > On Thu, Oct 06, 2011 at 08:19:41AM +0200, Andreas Kloeckner wrote: > > On Wed, 5 Oct 2011 19:59:16 -0300, andrew cooke <[email protected]> wrote: > > > i am having trouble working out how to clear the kernel cache. the docs > > > suggest clear_context_caches() from pyopencl.tools, but it doesn't seem > > > to be > > > there: > > > > > > Python 3.2 (r32:88445, Jun 9 2011, 09:31:13) > > > [GCC 4.5.1 20101208 [gcc-4_5-branch revision 167585]] on linux2 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> from pyopencl.tools import clear_context_caches > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > ImportError: cannot import name clear_context_caches > > > >>> from pyopencl import VERSION > > > >>> VERSION > > > (2011, 1, 2) > > > > > > what should i be doing? > > > > 1) Why do you need to clear the cache? Whatever it is, it's likely > > indicative of a bug in PyOpenCL. > > OK, so maybe there is a better way to do this... > > http://stackoverflow.com/questions/7622293/how-to-structure-large-opencl-kernels > > I have a project with several kernels that share structures and logic. The > Program() object takes only a single file, so the simplest way to manage this > that I have foud is to use #include to assemble a kernel from several files > (in contrast, clCreateProgramWithSource() takes multiple files). Pyopencl's > caching does not take acocunt of these included files.
The git version does understand include files. (sort of--it greps the code for #include and considers those when deciding cache validity.) > > 2) rm -Rf /tmp/pyopencl-compiler-cache-v2-uidandreas-py2.6.7.final.0/ > > OK, thanks. > > > (With different values subsituted in in the obvious places.) > > > > 3) The facility you found only caches the stage from array operator to > > kernel, i.e. it is more specialized. > > I did not find it. It appears to be missing. Ah--it's in the git version, really soon now(tm) to be 2011.2. I've added version remarks to that facility. Those were missing. Thanks for the report. HTH, Andreas
pgpq3MkQ8Thj2.pgp
Description: PGP signature
_______________________________________________ PyOpenCL mailing list [email protected] http://lists.tiker.net/listinfo/pyopencl
