1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

introduced new RST/Sphinx domain ocv.

This commit is contained in:
Vadim Pisarevsky
2011-06-16 12:48:23 +00:00
parent 4f3fb040a4
commit 8d8ef596c8
48 changed files with 2823 additions and 1691 deletions
+27 -27
View File
@@ -7,7 +7,7 @@ Data Structures
gpu::DevMem2D\_
---------------
.. cpp:class:: gpu::DevMem2D\_
.. ocv:class:: gpu::DevMem2D\_
This lightweight class encapsulates pitched memory on a GPU and is passed to nvcc-compiled code (CUDA kernels). Typically, it is used internally by OpenCV and by users who write device code. You can call its members from both host and device code. ::
@@ -44,10 +44,10 @@ This lightweight class encapsulates pitched memory on a GPU and is passed to nvc
gpu::PtrStep\_
--------------
.. cpp:class:: gpu::PtrStep\_
.. ocv:class:: gpu::PtrStep\_
This structure is similar to
:cpp:class:`DevMem2D_` but contains only a pointer and row step. Width and height fields are excluded due to performance reasons. The structure is intended for internal use or for users who write device code.
:ocv:class:`DevMem2D_` but contains only a pointer and row step. Width and height fields are excluded due to performance reasons. The structure is intended for internal use or for users who write device code.
::
template<typename T> struct PtrStep_
@@ -75,10 +75,10 @@ This structure is similar to
gpu::PtrElemStrp\_
------------------
.. cpp:class:: gpu::PtrElemStrp\_
.. ocv:class:: gpu::PtrElemStrp\_
This structure is similar to
:cpp:class:`DevMem2D_` but contains only pointer and row step in elements. Width and height fields are excluded due to performance reasons. This class can only be constructed if ``sizeof(T)`` is a multiple of 256. The structure is intended for internal use or for users who write device code.
:ocv:class:`DevMem2D_` but contains only pointer and row step in elements. Width and height fields are excluded due to performance reasons. This class can only be constructed if ``sizeof(T)`` is a multiple of 256. The structure is intended for internal use or for users who write device code.
::
template<typename T> struct PtrElemStep_ : public PtrStep_<T>
@@ -93,7 +93,7 @@ This structure is similar to
gpu::GpuMat
-----------
.. cpp:class:: gpu::GpuMat
.. ocv:class:: gpu::GpuMat
This is a base storage class for GPU memory with reference counting. Its interface matches the
:c:type:`Mat` interface with the following limitations:
@@ -105,7 +105,7 @@ This is a base storage class for GPU memory with reference counting. Its interfa
*
no expression templates technique support
Beware that the latter limitation may lead to overloaded matrix operators that cause memory allocations. The ``GpuMat`` class is convertible to :cpp:class:`gpu::DevMem2D_` and :cpp:class:`gpu::PtrStep_` so it can be passed directly to kernel.
Beware that the latter limitation may lead to overloaded matrix operators that cause memory allocations. The ``GpuMat`` class is convertible to :ocv:class:`gpu::DevMem2D_` and :ocv:class:`gpu::PtrStep_` so it can be passed directly to kernel.
**Note:**
@@ -148,16 +148,16 @@ In contrast with :c:type:`Mat`, in most cases ``GpuMat::isContinuous() == false`
You are not recommended to leave static or global ``GpuMat`` variables allocated, that is to rely on its destructor. The destruction order of such variables and CUDA context is undefined. GPU memory release function returns error if the CUDA context has been destroyed before.
See Also:
:cpp:func:`Mat`
:ocv:func:`Mat`
.. index:: gpu::CudaMem
gpu::CudaMem
------------
.. cpp:class:: gpu::CudaMem
.. ocv:class:: gpu::CudaMem
This class with reference counting wraps special memory type allocation functions from CUDA. Its interface is also
:cpp:func:`Mat`-like but with additional memory type parameters.
:ocv:func:`Mat`-like but with additional memory type parameters.
*
``ALLOC_PAGE_LOCKED``: Sets a page locked memory type, used commonly for fast and asynchronous uploading/downloading data from/to GPU.
@@ -206,24 +206,24 @@ Allocation size of such memory types is usually limited. For more details, see "
gpu::CudaMem::createMatHeader
---------------------------------
.. cpp:function:: Mat gpu::CudaMem::createMatHeader() const
.. ocv:function:: Mat gpu::CudaMem::createMatHeader() const
Creates a header without reference counting to :cpp:class:`gpu::CudaMem` data.
Creates a header without reference counting to :ocv:class:`gpu::CudaMem` data.
.. index:: gpu::CudaMem::createGpuMatHeader
gpu::CudaMem::createGpuMatHeader
------------------------------------
.. cpp:function:: GpuMat gpu::CudaMem::createGpuMatHeader() const
.. ocv:function:: GpuMat gpu::CudaMem::createGpuMatHeader() const
Maps CPU memory to GPU address space and creates the :cpp:class:`gpu::GpuMat` header without reference counting for it. This can be done only if memory was allocated with the ``ALLOC_ZEROCOPY`` flag and if it is supported by the hardware (laptops often share video and CPU memory, so address spaces can be mapped, which eliminates an extra copy).
Maps CPU memory to GPU address space and creates the :ocv:class:`gpu::GpuMat` header without reference counting for it. This can be done only if memory was allocated with the ``ALLOC_ZEROCOPY`` flag and if it is supported by the hardware (laptops often share video and CPU memory, so address spaces can be mapped, which eliminates an extra copy).
.. index:: gpu::CudaMem::canMapHostMemory
gpu::CudaMem::canMapHostMemory
----------------------------------
.. cpp:function:: static bool gpu::CudaMem::canMapHostMemory()
.. ocv:function:: static bool gpu::CudaMem::canMapHostMemory()
Returns ``true`` if the current hardware supports address space mapping and ``ALLOC_ZEROCOPY`` memory allocation.
@@ -231,9 +231,9 @@ gpu::CudaMem::canMapHostMemory
gpu::Stream
-----------
.. cpp:class:: gpu::Stream
.. ocv:class:: gpu::Stream
This class encapsulates a queue of asynchronous calls. Some functions have overloads with the additional ``gpu::Stream`` parameter. The overloads do initialization work (allocate output buffers, upload constants, and so on), start the GPU kernel, and return before results are ready. You can check whether all operations are complete via :cpp:func:`gpu::Stream::queryIfComplete`. You can asynchronously upload/download data from/to page-locked buffers, using the :cpp:class:`gpu::CudaMem` or :c:type:`Mat` header that points to a region of :cpp:class:`gpu::CudaMem`.
This class encapsulates a queue of asynchronous calls. Some functions have overloads with the additional ``gpu::Stream`` parameter. The overloads do initialization work (allocate output buffers, upload constants, and so on), start the GPU kernel, and return before results are ready. You can check whether all operations are complete via :ocv:func:`gpu::Stream::queryIfComplete`. You can asynchronously upload/download data from/to page-locked buffers, using the :ocv:class:`gpu::CudaMem` or :c:type:`Mat` header that points to a region of :ocv:class:`gpu::CudaMem`.
**Note:**
@@ -279,7 +279,7 @@ Currently, you may face problems if an operation is enqueued twice with differen
gpu::Stream::queryIfComplete
--------------------------------
.. cpp:function:: bool gpu::Stream::queryIfComplete()
.. ocv:function:: bool gpu::Stream::queryIfComplete()
Returns ``true`` if the current stream queue is finished. Otherwise, it returns false.
@@ -287,7 +287,7 @@ gpu::Stream::queryIfComplete
gpu::Stream::waitForCompletion
----------------------------------
.. cpp:function:: void gpu::Stream::waitForCompletion()
.. ocv:function:: void gpu::Stream::waitForCompletion()
Blocks the current CPU thread until all operations in the stream are complete.
@@ -295,9 +295,9 @@ gpu::Stream::waitForCompletion
gpu::StreamAccessor
-------------------
.. cpp:class:: gpu::StreamAccessor
.. ocv:class:: gpu::StreamAccessor
This class enables getting ``cudaStream_t`` from :cpp:class:`gpu::Stream` and is declared in ``stream_accessor.hpp`` because it is the only public header that depends on the CUDA Runtime API. Including it brings a dependency to your code.
This class enables getting ``cudaStream_t`` from :ocv:class:`gpu::Stream` and is declared in ``stream_accessor.hpp`` because it is the only public header that depends on the CUDA Runtime API. Including it brings a dependency to your code.
::
struct StreamAccessor
@@ -310,7 +310,7 @@ This class enables getting ``cudaStream_t`` from :cpp:class:`gpu::Stream` and is
gpu::createContinuous
-------------------------
.. cpp:function:: void gpu::createContinuous(int rows, int cols, int type, GpuMat& m)
.. ocv:function:: void gpu::createContinuous(int rows, int cols, int type, GpuMat& m)
Creates a continuous matrix in the GPU memory.
@@ -325,11 +325,11 @@ gpu::createContinuous
The following wrappers are also available:
* .. cpp:function:: GpuMat gpu::createContinuous(int rows, int cols, int type)
* .. ocv:function:: GpuMat gpu::createContinuous(int rows, int cols, int type)
* .. cpp:function:: void gpu::createContinuous(Size size, int type, GpuMat& m)
* .. ocv:function:: void gpu::createContinuous(Size size, int type, GpuMat& m)
* .. cpp:function:: GpuMat gpu::createContinuous(Size size, int type)
* .. ocv:function:: GpuMat gpu::createContinuous(Size size, int type)
Matrix is called continuous if its elements are stored continuously, that is without gaps in the end of each row.
@@ -337,9 +337,9 @@ gpu::createContinuous
gpu::ensureSizeIsEnough
---------------------------
.. cpp:function:: void gpu::ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
.. ocv:function:: void gpu::ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
.. cpp:function:: void gpu::ensureSizeIsEnough(Size size, int type, GpuMat& m)
.. ocv:function:: void gpu::ensureSizeIsEnough(Size size, int type, GpuMat& m)
Ensures that the size of a matrix is big enough and the matrix has a proper type. The function does not reallocate memory if the matrix has proper attributes already.