.. cpp:function:: int gpu::getCudaEnabledDeviceCount()
Returns number of CUDA-enabled devices installed. It is to be used before any other GPU functions calls. If OpenCV is compiled without GPU support this function returns 0.
.. cpp:function:: int getCudaEnabledDeviceCount()
Returns the number of installed CUDA-enabled devices. Use this function before any other GPU functions calls. If OpenCV is compiled without GPU support, this function returns 0.
.. index:: gpu::setDevice
gpu::setDevice
------------------
.. cpp:function:: void gpu::setDevice(int device)
Sets device and initializes it for the current thread. Call of this function can be omitted, but in this case a default device will be initialized on fist GPU usage.
:param device: index of GPU device in system starting with 0.
.. cpp:function:: void setDevice(int device)
Sets a device and initializes it for the current thread. If call of this function is omitted, a default device is initialized at the fist GPU usage.
:param device: System index of a GPU device starting with 0.
.. index:: gpu::getDevice
gpu::getDevice
------------------
.. cpp:function:: int gpu::getDevice()
Returns the current device index, which was set by :cpp:func:`gpu::setDevice` or initialized by default.
.. cpp:function:: int getDevice()
Returns the current device index that was set by {gpu::getDevice} or initialized by default.
.. index:: gpu::GpuFeature
gpu::GpuFeature
---------------
.. c:type:: gpu::GpuFeature
GPU compute features. ::
This class provides GPU computing features.
::
enum GpuFeature
{
...
...
@@ -54,16 +47,16 @@ GPU compute features. ::
};
.. index:: gpu::DeviceInfo
gpu::DeviceInfo
---------------
.. cpp:class:: gpu::DeviceInfo
This class provides functionality for querying the specified GPU properties. ::
This class provides functionality for querying the specified GPU properties.
::
class DeviceInfo
class CV_EXPORTS DeviceInfo
{
public:
DeviceInfo();
...
...
@@ -84,20 +77,18 @@ This class provides functionality for querying the specified GPU properties. ::
Constructs :cpp:class:`gpu::DeviceInfo` object for the specified device. If ``device_id`` parameter is missed it constructs object for the current device.
:param device_id: Index of the GPU device in system starting with 0.
Constructs the ``DeviceInfo`` object for the specified device. If ``device_id`` parameter is missed, it constructs an object for the current device.
:param device_id: System index of the GPU device starting with 0.
Returns true if the GPU module can be run on the specified device, otherwise false.
Checks the GPU module and device compatibility. This function returns true if the GPU module can be run on the specified device, otherwise returns false.
.. index:: gpu::TargetArchs
.. _gpu::TargetArchs:
gpu::TargetArchs
----------------
.. cpp:class:: gpu::TargetArchs
This class provides functionality (as set of static methods) for checking which NVIDIA card architectures the GPU module was built for.
This class provides a set of static methods to check what NVIDIA card architecture the GPU module was built for.
The following method checks whether the module was built with the support of the given feature:
:param feature: Feature to be checked. See :c:type:`gpu::GpuFeature`.
:param feature: Feature to be checked. See ?.
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
There is a set of methods to check whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
.. cpp:function:: static bool gpu::TargetArchs::has(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::has(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasBin(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasBin(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrLessPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrLessPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
.. cpp:function:: static bool gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
:param major: Major compute capability version.
* **major** Major compute capability version.
:param minor: Minor compute capability version.
According to the CUDA C Programming Guide Version 3.2: "PTX code produced for some specific compute capability can always be compiled to binary code of greater or equal compute capability".
* **minor** Minor compute capability version.
According to the CUDA C Programming Guide Version 3.2: "PTX code produced for some specific compute capability can always be compiled to binary code of greater or equal compute capability".