From b54aa6c2ba69db4cccb614c913a41e2f8236a731 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 22 Oct 2011 14:54:34 -0400 Subject: [PATCH] Introduce autodoc for context-dependent caching. --- doc/source/conf.py | 1 + doc/source/tools.rst | 23 ++++------------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 269c57c6..851b137e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -25,6 +25,7 @@ import sys, os # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.intersphinx', + 'sphinx.ext.autodoc', ] # Add any paths that contain templates here, relative to this directory. diff --git a/doc/source/tools.rst b/doc/source/tools.rst index 57200f7e..845d9cea 100644 --- a/doc/source/tools.rst +++ b/doc/source/tools.rst @@ -74,26 +74,11 @@ the available memory. This is useful as a cleanup action when a memory pool falls out of use. -Context-based Caching ---------------------- +CL-Object-dependent Caching +--------------------------- -.. function:: context_dependent_memoize(func) - - This decorator caches the result of the decorated function, *if* a - subsequent occurs with the same :class:`pyopencl.Context`. This is useful - for caching of kernels. Assumes that the first argument of the decorated - function is the :class:`pyopencl.Context`. - - .. versionadded:: 2011.2 - -.. function:: clear_context_caches() - - Empties all context-dependent memoization caches. Also releases - all held reference contexts. If it is important to you that the - program detaches from its context, you might need to call this - function to free all remaining references to your context. - - .. versionadded:: 2011.2 +.. autofunction:: first_arg_dependent_memoize +.. autofunction:: clear_first_arg_caches Testing ------- -- GitLab