fixed documentation build
This commit is contained in:
parent
439c3574ed
commit
564fd21e87
@ -201,9 +201,9 @@ def process_module(module, path):
|
||||
hdrlist.append(os.path.join(root, filename))
|
||||
|
||||
if module == "gpu":
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "cuda_devptrs.hpp"))
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpumat.hpp"))
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "stream_accessor.hpp"))
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpu_types.hpp"))
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpu.hpp"))
|
||||
hdrlist.append(os.path.join(path, "..", "core", "include", "opencv2", "core", "gpu_stream_accessor.hpp"))
|
||||
|
||||
decls = []
|
||||
for hname in hdrlist:
|
||||
|
@ -251,7 +251,7 @@ public:
|
||||
uchar* dataend;
|
||||
};
|
||||
|
||||
//! creates continuous GPU matrix
|
||||
//! creates continuous matrix
|
||||
CV_EXPORTS void createContinuous(int rows, int cols, int type, OutputArray arr);
|
||||
|
||||
//! ensures that size of the given matrix is not less than (rows, cols) size
|
||||
|
@ -60,7 +60,7 @@ namespace cv
|
||||
// Simple lightweight structures that encapsulates information about an image on device.
|
||||
// It is intended to pass to nvcc-compiled code. GpuMat depends on headers that nvcc can't compile
|
||||
|
||||
template<typename T> struct DevPtr
|
||||
template <typename T> struct DevPtr
|
||||
{
|
||||
typedef T elem_type;
|
||||
typedef int index_type;
|
||||
@ -77,7 +77,7 @@ namespace cv
|
||||
__CV_GPU_HOST_DEVICE__ operator const T*() const { return data; }
|
||||
};
|
||||
|
||||
template<typename T> struct PtrSz : public DevPtr<T>
|
||||
template <typename T> struct PtrSz : public DevPtr<T>
|
||||
{
|
||||
__CV_GPU_HOST_DEVICE__ PtrSz() : size(0) {}
|
||||
__CV_GPU_HOST_DEVICE__ PtrSz(T* data_, size_t size_) : DevPtr<T>(data_), size(size_) {}
|
||||
@ -85,7 +85,7 @@ namespace cv
|
||||
size_t size;
|
||||
};
|
||||
|
||||
template<typename T> struct PtrStep : public DevPtr<T>
|
||||
template <typename T> struct PtrStep : public DevPtr<T>
|
||||
{
|
||||
__CV_GPU_HOST_DEVICE__ PtrStep() : step(0) {}
|
||||
__CV_GPU_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {}
|
||||
|
@ -6,32 +6,22 @@ Data Structures
|
||||
|
||||
|
||||
gpu::PtrStepSz
|
||||
---------------
|
||||
--------------
|
||||
.. ocv:class:: gpu::PtrStepSz
|
||||
|
||||
Lightweight class encapsulating pitched memory on a GPU and 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. ::
|
||||
|
||||
template <typename T> struct PtrStepSz
|
||||
template <typename T> struct PtrStepSz : public PtrStep<T>
|
||||
{
|
||||
int cols;
|
||||
int rows;
|
||||
T* data;
|
||||
size_t step;
|
||||
|
||||
PtrStepSz() : cols(0), rows(0), data(0), step(0){};
|
||||
PtrStepSz(int rows, int cols, T *data, size_t step);
|
||||
__CV_GPU_HOST_DEVICE__ PtrStepSz() : cols(0), rows(0) {}
|
||||
__CV_GPU_HOST_DEVICE__ PtrStepSz(int rows_, int cols_, T* data_, size_t step_)
|
||||
: PtrStep<T>(data_, step_), cols(cols_), rows(rows_) {}
|
||||
|
||||
template <typename U>
|
||||
explicit PtrStepSz(const PtrStepSz<U>& d);
|
||||
explicit PtrStepSz(const PtrStepSz<U>& d) : PtrStep<T>((T*)d.data, d.step), cols(d.cols), rows(d.rows){}
|
||||
|
||||
typedef T elem_type;
|
||||
enum { elem_size = sizeof(elem_type) };
|
||||
|
||||
__CV_GPU_HOST_DEVICE__ size_t elemSize() const;
|
||||
|
||||
/* returns pointer to the beginning of the given image row */
|
||||
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0);
|
||||
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const;
|
||||
int cols;
|
||||
int rows;
|
||||
};
|
||||
|
||||
typedef PtrStepSz<unsigned char> PtrStepSzb;
|
||||
@ -41,32 +31,32 @@ Lightweight class encapsulating pitched memory on a GPU and passed to nvcc-compi
|
||||
|
||||
|
||||
gpu::PtrStep
|
||||
--------------
|
||||
------------
|
||||
.. ocv:class:: gpu::PtrStep
|
||||
|
||||
Structure similar to :ocv:class:`gpu::PtrStepSz` but containing 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
|
||||
template <typename T> struct PtrStep : public DevPtr<T>
|
||||
{
|
||||
T* data;
|
||||
size_t step;
|
||||
__CV_GPU_HOST_DEVICE__ PtrStep() : step(0) {}
|
||||
__CV_GPU_HOST_DEVICE__ PtrStep(T* data_, size_t step_) : DevPtr<T>(data_), step(step_) {}
|
||||
|
||||
PtrStep();
|
||||
PtrStep(const PtrStepSz<T>& mem);
|
||||
//! stride between two consecutive rows in bytes. Step is stored always and everywhere in bytes!!!
|
||||
size_t step;
|
||||
|
||||
typedef T elem_type;
|
||||
enum { elem_size = sizeof(elem_type) };
|
||||
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)DevPtr<T>::data + y * step); }
|
||||
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)DevPtr<T>::data + y * step); }
|
||||
|
||||
__CV_GPU_HOST_DEVICE__ size_t elemSize() const;
|
||||
__CV_GPU_HOST_DEVICE__ T* ptr(int y = 0);
|
||||
__CV_GPU_HOST_DEVICE__ const T* ptr(int y = 0) const;
|
||||
__CV_GPU_HOST_DEVICE__ T& operator ()(int y, int x) { return ptr(y)[x]; }
|
||||
__CV_GPU_HOST_DEVICE__ const T& operator ()(int y, int x) const { return ptr(y)[x]; }
|
||||
};
|
||||
|
||||
typedef PtrStep<unsigned char> PtrStep;
|
||||
typedef PtrStep<unsigned char> PtrStepb;
|
||||
typedef PtrStep<float> PtrStepf;
|
||||
typedef PtrStep<int> PtrStepi;
|
||||
|
||||
|
||||
|
||||
gpu::GpuMat
|
||||
-----------
|
||||
.. ocv:class:: gpu::GpuMat
|
||||
@ -89,28 +79,31 @@ Beware that the latter limitation may lead to overloaded matrix operators that c
|
||||
//! default constructor
|
||||
GpuMat();
|
||||
|
||||
//! constructs GpuMat of the specified size and type
|
||||
GpuMat(int rows, int cols, int type);
|
||||
GpuMat(Size size, int type);
|
||||
|
||||
.....
|
||||
|
||||
//! builds GpuMat from Mat. Blocks uploading to device.
|
||||
explicit GpuMat (const Mat& m);
|
||||
//! builds GpuMat from host memory (Blocking call)
|
||||
explicit GpuMat(InputArray arr);
|
||||
|
||||
//! returns lightweight PtrStepSz structure for passing
|
||||
//to nvcc-compiled code. Contains size, data ptr and step.
|
||||
template <class T> operator PtrStepSz<T>() const;
|
||||
template <class T> operator PtrStep<T>() const;
|
||||
|
||||
//! blocks uploading data to GpuMat.
|
||||
void upload(const cv::Mat& m);
|
||||
void upload(const CudaMem& m, Stream& stream);
|
||||
//! pefroms upload data to GpuMat (Blocking call)
|
||||
void upload(InputArray arr);
|
||||
|
||||
//! downloads data from device to host memory. Blocking calls.
|
||||
void download(cv::Mat& m) const;
|
||||
//! pefroms upload data to GpuMat (Non-Blocking call)
|
||||
void upload(InputArray arr, Stream& stream);
|
||||
|
||||
//! download async
|
||||
void download(CudaMem& m, Stream& stream) const;
|
||||
//! pefroms download data from device to host memory (Blocking call)
|
||||
void download(OutputArray dst) const;
|
||||
|
||||
//! pefroms download data from device to host memory (Non-Blocking call)
|
||||
void download(OutputArray dst, Stream& stream) const;
|
||||
};
|
||||
|
||||
|
||||
@ -121,16 +114,10 @@ Beware that the latter limitation may lead to overloaded matrix operators that c
|
||||
|
||||
|
||||
gpu::createContinuous
|
||||
-------------------------
|
||||
Creates a continuous matrix in the GPU memory.
|
||||
---------------------
|
||||
Creates a continuous matrix.
|
||||
|
||||
.. ocv:function:: void gpu::createContinuous(int rows, int cols, int type, GpuMat& m)
|
||||
|
||||
.. ocv:function:: GpuMat gpu::createContinuous(int rows, int cols, int type)
|
||||
|
||||
.. ocv:function:: void gpu::createContinuous(Size size, int type, GpuMat& m)
|
||||
|
||||
.. ocv:function:: GpuMat gpu::createContinuous(Size size, int type)
|
||||
.. ocv:function:: void gpu::createContinuous(int rows, int cols, int type, OutputArray arr)
|
||||
|
||||
:param rows: Row count.
|
||||
|
||||
@ -138,36 +125,92 @@ Creates a continuous matrix in the GPU memory.
|
||||
|
||||
:param type: Type of the matrix.
|
||||
|
||||
:param m: Destination matrix. This parameter changes only if it has a proper type and area ( :math:`\texttt{rows} \times \texttt{cols}` ).
|
||||
:param arr: Destination matrix. This parameter changes only if it has a proper type and area ( :math:`\texttt{rows} \times \texttt{cols}` ).
|
||||
|
||||
Matrix is called continuous if its elements are stored continuously, that is, without gaps at the end of each row.
|
||||
|
||||
|
||||
|
||||
gpu::ensureSizeIsEnough
|
||||
---------------------------
|
||||
-----------------------
|
||||
Ensures that the size of a matrix is big enough and the matrix has a proper type.
|
||||
|
||||
.. ocv:function:: void gpu::ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
|
||||
|
||||
.. ocv:function:: void gpu::ensureSizeIsEnough(Size size, int type, GpuMat& m)
|
||||
.. ocv:function:: void gpu::ensureSizeIsEnough(int rows, int cols, int type, OutputArray arr)
|
||||
|
||||
:param rows: Minimum desired number of rows.
|
||||
|
||||
:param cols: Minimum desired number of columns.
|
||||
|
||||
:param size: Rows and columns passed as a structure.
|
||||
|
||||
:param type: Desired matrix type.
|
||||
|
||||
:param m: Destination matrix.
|
||||
:param arr: Destination matrix.
|
||||
|
||||
The function does not reallocate memory if the matrix has proper attributes already.
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem
|
||||
------------
|
||||
.. ocv:class:: gpu::CudaMem
|
||||
|
||||
Class with reference counting wrapping special memory type allocation functions from CUDA. Its interface is also :ocv:func:`Mat`-like but with additional memory type parameters.
|
||||
|
||||
* **PAGE_LOCKED** sets a page locked memory type used commonly for fast and asynchronous uploading/downloading data from/to GPU.
|
||||
* **SHARED** specifies a zero copy memory allocation that enables mapping the host memory to GPU address space, if supported.
|
||||
* **WRITE_COMBINED** sets the write combined buffer that is not cached by CPU. Such buffers are used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache utilization.
|
||||
|
||||
.. note:: Allocation size of such memory types is usually limited. For more details, see *CUDA 2.2 Pinned Memory APIs* document or *CUDA C Programming Guide*.
|
||||
|
||||
::
|
||||
|
||||
class CV_EXPORTS CudaMem
|
||||
{
|
||||
public:
|
||||
enum AllocType { PAGE_LOCKED = 1, SHARED = 2, WRITE_COMBINED = 4 };
|
||||
|
||||
explicit CudaMem(AllocType alloc_type = PAGE_LOCKED);
|
||||
|
||||
CudaMem(int rows, int cols, int type, AllocType alloc_type = PAGE_LOCKED);
|
||||
CudaMem(Size size, int type, AllocType alloc_type = PAGE_LOCKED);
|
||||
|
||||
//! creates from host memory with coping data
|
||||
explicit CudaMem(InputArray arr, AllocType alloc_type = PAGE_LOCKED);
|
||||
|
||||
......
|
||||
|
||||
//! returns matrix header with disabled reference counting for CudaMem data.
|
||||
Mat createMatHeader() const;
|
||||
|
||||
//! maps host memory into device address space and returns GpuMat header for it. Throws exception if not supported by hardware.
|
||||
GpuMat createGpuMatHeader() const;
|
||||
|
||||
......
|
||||
|
||||
AllocType alloc_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem::createMatHeader
|
||||
-----------------------------
|
||||
Creates a header without reference counting to :ocv:class:`gpu::CudaMem` data.
|
||||
|
||||
.. ocv:function:: Mat gpu::CudaMem::createMatHeader() const
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem::createGpuMatHeader
|
||||
--------------------------------
|
||||
Maps CPU memory to GPU address space and creates the :ocv:class:`gpu::GpuMat` header without reference counting for it.
|
||||
|
||||
.. ocv:function:: GpuMat gpu::CudaMem::createGpuMatHeader() const
|
||||
|
||||
This can be done only if memory was allocated with the ``SHARED`` 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.
|
||||
|
||||
|
||||
|
||||
gpu::registerPageLocked
|
||||
-------------------------------
|
||||
-----------------------
|
||||
Page-locks the memory of matrix and maps it for the device(s).
|
||||
|
||||
.. ocv:function:: void gpu::registerPageLocked(Mat& m)
|
||||
@ -177,7 +220,7 @@ Page-locks the memory of matrix and maps it for the device(s).
|
||||
|
||||
|
||||
gpu::unregisterPageLocked
|
||||
-------------------------------
|
||||
-------------------------
|
||||
Unmaps the memory of matrix and makes it pageable again.
|
||||
|
||||
.. ocv:function:: void gpu::unregisterPageLocked(Mat& m)
|
||||
@ -186,83 +229,11 @@ Unmaps the memory of matrix and makes it pageable again.
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem
|
||||
------------
|
||||
.. ocv:class:: gpu::CudaMem
|
||||
|
||||
Class with reference counting wrapping special memory type allocation functions from CUDA. Its interface is also
|
||||
: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.
|
||||
* **ALLOC_ZEROCOPY** specifies a zero copy memory allocation that enables mapping the host memory to GPU address space, if supported.
|
||||
* **ALLOC_WRITE_COMBINED** sets the write combined buffer that is not cached by CPU. Such buffers are used to supply GPU with data when GPU only reads it. The advantage is a better CPU cache utilization.
|
||||
|
||||
.. note:: Allocation size of such memory types is usually limited. For more details, see *CUDA 2.2 Pinned Memory APIs* document or *CUDA C Programming Guide*.
|
||||
|
||||
::
|
||||
|
||||
class CV_EXPORTS CudaMem
|
||||
{
|
||||
public:
|
||||
enum { ALLOC_PAGE_LOCKED = 1, ALLOC_ZEROCOPY = 2,
|
||||
ALLOC_WRITE_COMBINED = 4 };
|
||||
|
||||
CudaMem(Size size, int type, int alloc_type = ALLOC_PAGE_LOCKED);
|
||||
|
||||
//! creates from cv::Mat with coping data
|
||||
explicit CudaMem(const Mat& m, int alloc_type = ALLOC_PAGE_LOCKED);
|
||||
|
||||
......
|
||||
|
||||
void create(Size size, int type, int alloc_type = ALLOC_PAGE_LOCKED);
|
||||
|
||||
//! returns matrix header with disabled ref. counting for CudaMem data.
|
||||
Mat createMatHeader() const;
|
||||
operator Mat() const;
|
||||
|
||||
//! maps host memory into device address space
|
||||
GpuMat createGpuMatHeader() const;
|
||||
operator GpuMat() const;
|
||||
|
||||
//if host memory can be mapped to gpu address space;
|
||||
static bool canMapHostMemory();
|
||||
|
||||
int alloc_type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem::createMatHeader
|
||||
---------------------------------
|
||||
Creates a header without reference counting to :ocv:class:`gpu::CudaMem` data.
|
||||
|
||||
.. ocv:function:: Mat gpu::CudaMem::createMatHeader() const
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem::createGpuMatHeader
|
||||
------------------------------------
|
||||
Maps CPU memory to GPU address space and creates the :ocv:class:`gpu::GpuMat` header without reference counting for it.
|
||||
|
||||
.. ocv:function:: GpuMat gpu::CudaMem::createGpuMatHeader() const
|
||||
|
||||
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.
|
||||
|
||||
|
||||
|
||||
gpu::CudaMem::canMapHostMemory
|
||||
----------------------------------
|
||||
Returns ``true`` if the current hardware supports address space mapping and ``ALLOC_ZEROCOPY`` memory allocation.
|
||||
|
||||
.. ocv:function:: static bool gpu::CudaMem::canMapHostMemory()
|
||||
|
||||
|
||||
|
||||
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 :ocv:func:`gpu::Stream::queryIfComplete`. You can asynchronously upload/download data from/to page-locked buffers, using the :ocv:class:`gpu::CudaMem` or :ocv:class:`Mat` header that points to a region of :ocv:class:`gpu::CudaMem`.
|
||||
This class encapsulates a queue of asynchronous calls.
|
||||
|
||||
.. note:: Currently, you may face problems if an operation is enqueued twice with different data. Some functions use the constant GPU memory, and next call may update the memory before the previous one has been finished. But calling different operations asynchronously is safe because each operation has its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are also safe.
|
||||
|
||||
@ -272,30 +243,24 @@ This class encapsulates a queue of asynchronous calls. Some functions have overl
|
||||
{
|
||||
public:
|
||||
Stream();
|
||||
~Stream();
|
||||
|
||||
Stream(const Stream&);
|
||||
Stream& operator=(const Stream&);
|
||||
//! queries an asynchronous stream for completion status
|
||||
bool queryIfComplete() const;
|
||||
|
||||
bool queryIfComplete();
|
||||
//! waits for stream tasks to complete
|
||||
void waitForCompletion();
|
||||
|
||||
void enqueueDownload(const GpuMat& src, CudaMem& dst);
|
||||
void enqueueDownload(const GpuMat& src, Mat& dst);
|
||||
//! makes a compute stream wait on an event
|
||||
void waitEvent(const Event& event);
|
||||
|
||||
void enqueueUpload(const CudaMem& src, GpuMat& dst);
|
||||
void enqueueUpload(const Mat& src, GpuMat& dst);
|
||||
|
||||
void enqueueCopy(const GpuMat& src, GpuMat& dst);
|
||||
|
||||
void enqueueMemSet(const GpuMat& src, Scalar val);
|
||||
void enqueueMemSet(const GpuMat& src, Scalar val, const GpuMat& mask);
|
||||
|
||||
void enqueueConvert(const GpuMat& src, GpuMat& dst, int type,
|
||||
double a = 1, double b = 0);
|
||||
|
||||
typedef void (*StreamCallback)(Stream& stream, int status, void* userData);
|
||||
//! adds a callback to be called on the host after all currently enqueued items in the stream have completed
|
||||
void enqueueHostCallback(StreamCallback callback, void* userData);
|
||||
|
||||
//! return Stream object for default CUDA stream
|
||||
static Stream& Null();
|
||||
|
||||
//! returns true if stream object is not default (!= 0)
|
||||
operator bool_type() const;
|
||||
};
|
||||
|
||||
|
||||
@ -316,53 +281,11 @@ Blocks the current CPU thread until all operations in the stream are complete.
|
||||
|
||||
|
||||
|
||||
gpu::Stream::enqueueDownload
|
||||
----------------------------
|
||||
Copies data from device to host.
|
||||
gpu::Stream::waitEvent
|
||||
----------------------
|
||||
Makes a compute stream wait on an event.
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueDownload(const GpuMat& src, CudaMem& dst)
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueDownload(const GpuMat& src, Mat& dst)
|
||||
|
||||
.. note:: ``cv::Mat`` must point to page locked memory (i.e. to ``CudaMem`` data or to its subMat) or must be registered with :ocv:func:`gpu::registerPageLocked` .
|
||||
|
||||
|
||||
|
||||
gpu::Stream::enqueueUpload
|
||||
--------------------------
|
||||
Copies data from host to device.
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueUpload(const CudaMem& src, GpuMat& dst)
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueUpload(const Mat& src, GpuMat& dst)
|
||||
|
||||
.. note:: ``cv::Mat`` must point to page locked memory (i.e. to ``CudaMem`` data or to its subMat) or must be registered with :ocv:func:`gpu::registerPageLocked` .
|
||||
|
||||
|
||||
|
||||
gpu::Stream::enqueueCopy
|
||||
------------------------
|
||||
Copies data from device to device.
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueCopy(const GpuMat& src, GpuMat& dst)
|
||||
|
||||
|
||||
|
||||
gpu::Stream::enqueueMemSet
|
||||
--------------------------
|
||||
Initializes or sets device memory to a value.
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueMemSet( GpuMat& src, Scalar val )
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueMemSet( GpuMat& src, Scalar val, const GpuMat& mask )
|
||||
|
||||
|
||||
|
||||
gpu::Stream::enqueueConvert
|
||||
---------------------------
|
||||
Converts matrix type, ex from float to uchar depending on type.
|
||||
|
||||
.. ocv:function:: void gpu::Stream::enqueueConvert( const GpuMat& src, GpuMat& dst, int dtype, double a=1, double b=0 )
|
||||
.. ocv:function:: void gpu::Stream::waitEvent(const Event& event)
|
||||
|
||||
|
||||
|
||||
|
@ -107,23 +107,186 @@ Class providing functionality for querying the specified GPU properties. ::
|
||||
class CV_EXPORTS DeviceInfo
|
||||
{
|
||||
public:
|
||||
//! creates DeviceInfo object for the current GPU
|
||||
DeviceInfo();
|
||||
|
||||
//! creates DeviceInfo object for the given GPU
|
||||
DeviceInfo(int device_id);
|
||||
|
||||
String name() const;
|
||||
//! ASCII string identifying device
|
||||
const char* name() const;
|
||||
|
||||
int majorVersion() const;
|
||||
int minorVersion() const;
|
||||
//! global memory available on device in bytes
|
||||
size_t totalGlobalMem() const;
|
||||
|
||||
//! shared memory available per block in bytes
|
||||
size_t sharedMemPerBlock() const;
|
||||
|
||||
//! 32-bit registers available per block
|
||||
int regsPerBlock() const;
|
||||
|
||||
//! warp size in threads
|
||||
int warpSize() const;
|
||||
|
||||
//! maximum pitch in bytes allowed by memory copies
|
||||
size_t memPitch() const;
|
||||
|
||||
//! maximum number of threads per block
|
||||
int maxThreadsPerBlock() const;
|
||||
|
||||
//! maximum size of each dimension of a block
|
||||
Vec3i maxThreadsDim() const;
|
||||
|
||||
//! maximum size of each dimension of a grid
|
||||
Vec3i maxGridSize() const;
|
||||
|
||||
//! clock frequency in kilohertz
|
||||
int clockRate() const;
|
||||
|
||||
//! constant memory available on device in bytes
|
||||
size_t totalConstMem() const;
|
||||
|
||||
//! major compute capability
|
||||
int major() const;
|
||||
|
||||
//! minor compute capability
|
||||
int minor() const;
|
||||
|
||||
//! alignment requirement for textures
|
||||
size_t textureAlignment() const;
|
||||
|
||||
//! pitch alignment requirement for texture references bound to pitched memory
|
||||
size_t texturePitchAlignment() const;
|
||||
|
||||
//! number of multiprocessors on device
|
||||
int multiProcessorCount() const;
|
||||
|
||||
//! specified whether there is a run time limit on kernels
|
||||
bool kernelExecTimeoutEnabled() const;
|
||||
|
||||
//! device is integrated as opposed to discrete
|
||||
bool integrated() const;
|
||||
|
||||
//! device can map host memory with cudaHostAlloc/cudaHostGetDevicePointer
|
||||
bool canMapHostMemory() const;
|
||||
|
||||
enum ComputeMode
|
||||
{
|
||||
ComputeModeDefault, /**< default compute mode (Multiple threads can use ::cudaSetDevice() with this device) */
|
||||
ComputeModeExclusive, /**< compute-exclusive-thread mode (Only one thread in one process will be able to use ::cudaSetDevice() with this device) */
|
||||
ComputeModeProhibited, /**< compute-prohibited mode (No threads can use ::cudaSetDevice() with this device) */
|
||||
ComputeModeExclusiveProcess /**< compute-exclusive-process mode (Many threads in one process will be able to use ::cudaSetDevice() with this device) */
|
||||
};
|
||||
|
||||
//! compute mode
|
||||
ComputeMode computeMode() const;
|
||||
|
||||
//! maximum 1D texture size
|
||||
int maxTexture1D() const;
|
||||
|
||||
//! maximum 1D mipmapped texture size
|
||||
int maxTexture1DMipmap() const;
|
||||
|
||||
//! maximum size for 1D textures bound to linear memory
|
||||
int maxTexture1DLinear() const;
|
||||
|
||||
//! maximum 2D texture dimensions
|
||||
Vec2i maxTexture2D() const;
|
||||
|
||||
//! maximum 2D mipmapped texture dimensions
|
||||
Vec2i maxTexture2DMipmap() const;
|
||||
|
||||
//! maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory
|
||||
Vec3i maxTexture2DLinear() const;
|
||||
|
||||
//! maximum 2D texture dimensions if texture gather operations have to be performed
|
||||
Vec2i maxTexture2DGather() const;
|
||||
|
||||
//! maximum 3D texture dimensions
|
||||
Vec3i maxTexture3D() const;
|
||||
|
||||
//! maximum Cubemap texture dimensions
|
||||
int maxTextureCubemap() const;
|
||||
|
||||
//! maximum 1D layered texture dimensions
|
||||
Vec2i maxTexture1DLayered() const;
|
||||
|
||||
//! maximum 2D layered texture dimensions
|
||||
Vec3i maxTexture2DLayered() const;
|
||||
|
||||
//! maximum Cubemap layered texture dimensions
|
||||
Vec2i maxTextureCubemapLayered() const;
|
||||
|
||||
//! maximum 1D surface size
|
||||
int maxSurface1D() const;
|
||||
|
||||
//! maximum 2D surface dimensions
|
||||
Vec2i maxSurface2D() const;
|
||||
|
||||
//! maximum 3D surface dimensions
|
||||
Vec3i maxSurface3D() const;
|
||||
|
||||
//! maximum 1D layered surface dimensions
|
||||
Vec2i maxSurface1DLayered() const;
|
||||
|
||||
//! maximum 2D layered surface dimensions
|
||||
Vec3i maxSurface2DLayered() const;
|
||||
|
||||
//! maximum Cubemap surface dimensions
|
||||
int maxSurfaceCubemap() const;
|
||||
|
||||
//! maximum Cubemap layered surface dimensions
|
||||
Vec2i maxSurfaceCubemapLayered() const;
|
||||
|
||||
//! alignment requirements for surfaces
|
||||
size_t surfaceAlignment() const;
|
||||
|
||||
//! device can possibly execute multiple kernels concurrently
|
||||
bool concurrentKernels() const;
|
||||
|
||||
//! device has ECC support enabled
|
||||
bool ECCEnabled() const;
|
||||
|
||||
//! PCI bus ID of the device
|
||||
int pciBusID() const;
|
||||
|
||||
//! PCI device ID of the device
|
||||
int pciDeviceID() const;
|
||||
|
||||
//! PCI domain ID of the device
|
||||
int pciDomainID() const;
|
||||
|
||||
//! true if device is a Tesla device using TCC driver, false otherwise
|
||||
bool tccDriver() const;
|
||||
|
||||
//! number of asynchronous engines
|
||||
int asyncEngineCount() const;
|
||||
|
||||
//! device shares a unified address space with the host
|
||||
bool unifiedAddressing() const;
|
||||
|
||||
//! peak memory clock frequency in kilohertz
|
||||
int memoryClockRate() const;
|
||||
|
||||
//! global memory bus width in bits
|
||||
int memoryBusWidth() const;
|
||||
|
||||
//! size of L2 cache in bytes
|
||||
int l2CacheSize() const;
|
||||
|
||||
//! maximum resident threads per multiprocessor
|
||||
int maxThreadsPerMultiProcessor() const;
|
||||
|
||||
//! gets free and total device memory
|
||||
void queryMemory(size_t& totalMemory, size_t& freeMemory) const;
|
||||
size_t freeMemory() const;
|
||||
size_t totalMemory() const;
|
||||
|
||||
bool supports(FeatureSet feature) const;
|
||||
bool isCompatible() const;
|
||||
//! checks whether device supports the given feature
|
||||
bool supports(FeatureSet feature_set) const;
|
||||
|
||||
int deviceID() const;
|
||||
//! checks whether the GPU module can be run on the given device
|
||||
bool isCompatible() const;
|
||||
};
|
||||
|
||||
|
||||
@ -146,31 +309,23 @@ gpu::DeviceInfo::name
|
||||
---------------------
|
||||
Returns the device name.
|
||||
|
||||
.. ocv:function:: String gpu::DeviceInfo::name() const
|
||||
.. ocv:function:: const char* gpu::DeviceInfo::name() const
|
||||
|
||||
|
||||
|
||||
gpu::DeviceInfo::majorVersion
|
||||
-----------------------------
|
||||
gpu::DeviceInfo::major
|
||||
----------------------
|
||||
Returns the major compute capability version.
|
||||
|
||||
.. ocv:function:: int gpu::DeviceInfo::majorVersion()
|
||||
.. ocv:function:: int gpu::DeviceInfo::major()
|
||||
|
||||
|
||||
|
||||
gpu::DeviceInfo::minorVersion
|
||||
-----------------------------
|
||||
gpu::DeviceInfo::minor
|
||||
----------------------
|
||||
Returns the minor compute capability version.
|
||||
|
||||
.. ocv:function:: int gpu::DeviceInfo::minorVersion()
|
||||
|
||||
|
||||
|
||||
gpu::DeviceInfo::multiProcessorCount
|
||||
------------------------------------
|
||||
Returns the number of streaming multiprocessors.
|
||||
|
||||
.. ocv:function:: int gpu::DeviceInfo::multiProcessorCount()
|
||||
.. ocv:function:: int gpu::DeviceInfo::minor()
|
||||
|
||||
|
||||
|
||||
@ -194,7 +349,7 @@ gpu::DeviceInfo::supports
|
||||
-------------------------
|
||||
Provides information on GPU feature support.
|
||||
|
||||
.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const
|
||||
.. ocv:function:: bool gpu::DeviceInfo::supports(FeatureSet feature_set) const
|
||||
|
||||
:param feature_set: Features to be checked. See :ocv:enum:`gpu::FeatureSet`.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user