diff --git a/doc/index.rst b/doc/index.rst index f771ab25332ba378c42ae5b403e47e267009af2d..d715d1a2e945f2e7d9e717bfd5add37c244a093a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -108,6 +108,7 @@ Contents runtime_program runtime_gl array + types algorithm howto tools diff --git a/doc/misc.rst b/doc/misc.rst index 7459f89f525cd9d178f3b3814aac0fc3f9ddd527..b4e30db755258400525464fdfd4b88d2e082582d 100644 --- a/doc/misc.rst +++ b/doc/misc.rst @@ -121,6 +121,8 @@ checking `this file Note that the triple-quoted strings containing the source must start with `"""//CL// ..."""`. +.. _ipython-integration: + IPython integration ------------------- diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py index 793b62d69ecec2c08536f1038c40a6e868f89116..042cb9da324f246a5f8ed71062f94f7ef0253948 100644 --- a/pyopencl/__init__.py +++ b/pyopencl/__init__.py @@ -1038,6 +1038,13 @@ def _add_functionality(): def memory_map_exit(self, exc_type, exc_val, exc_tb): self.release() + MemoryMap.__doc__ = """ + This class may also be used as a context manager in a ``with`` statement. + The memory corresponding to this object will be unmapped when + this object is deleted or :meth:`release` is called. + + .. automethod:: release + """ MemoryMap.__enter__ = memory_map_enter MemoryMap.__exit__ = memory_map_exit @@ -1082,12 +1089,6 @@ def _add_functionality(): if get_cl_header_version() >= (2, 0): SVMAllocation.__init__ = svmallocation_init - # FIXME - # SVMAllocation.enqueue_release.__doc__ = """ - # :returns: a :class:`pyopencl.Event` - - # |std-enqueue-blurb| - # """ # }}} diff --git a/src/wrap_cl_part_1.cpp b/src/wrap_cl_part_1.cpp index e102a560922b5abde5376b05073430bc6c2d3a67..cb44c6b985b9b420a842f4684de6fe16a53e78e8 100644 --- a/src/wrap_cl_part_1.cpp +++ b/src/wrap_cl_part_1.cpp @@ -194,7 +194,7 @@ void pyopencl_expose_part_1(py::module &m) "If the previous owner of the object will *not* release the reference, " "*retain* should be set to *False*, to effectively transfer ownership to " ":mod:`pyopencl`." - "\n\n.. versionadded:: 2013.2\n", + "\n\n.. versionadded:: 2013.2\n" "\n\n.. versionchanged:: 2016.1\n\n *retain* added.", py::arg("int_ptr_value"), py::arg("retain")=true) diff --git a/src/wrap_cl_part_2.cpp b/src/wrap_cl_part_2.cpp index 2e8e9e4cd85f05b60920ab09deb07a6cf7925a84..0467ec1864064bdd1ecf4d91f9eaeac92b24e19f 100644 --- a/src/wrap_cl_part_2.cpp +++ b/src/wrap_cl_part_2.cpp @@ -245,7 +245,9 @@ void pyopencl_expose_part_2(py::module &m) py::class_<cls>(m, "SVMAllocation", py::dynamic_attr()) .def(py::init<std::shared_ptr<context>, size_t, cl_uint, cl_svm_mem_flags>()) .DEF_SIMPLE_METHOD(release) - .DEF_SIMPLE_METHOD(enqueue_release) + .def("enqueue_release", &cls::enqueue_release, + ":returns: a :class:`pyopencl.Event`\n\n" + "|std-enqueue-blurb|") .def("_ptr_as_int", &cls::ptr_as_int) .def(py::self == py::self) .def(py::self != py::self) diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp index e585e117460840f48b53327ecd8b9adaa3f77899..7b6a97f16fbf2083534d8175b0395981461c0b70 100644 --- a/src/wrap_constants.cpp +++ b/src/wrap_constants.cpp @@ -797,6 +797,7 @@ void pyopencl_expose_constants(py::module &m) ADD_ATTR(KERNEL_ARG_, ADDRESS_QUALIFIER); ADD_ATTR(KERNEL_ARG_, ACCESS_QUALIFIER); ADD_ATTR(KERNEL_ARG_, TYPE_NAME); + ADD_ATTR(KERNEL_ARG_, TYPE_QUALIFIER); ADD_ATTR(KERNEL_ARG_, NAME); #endif }