Open Source Computer Vision Library https://opencv.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
5.7 KiB

Initalization and Information
=============================
13 years ago
.. highlight:: cpp
13 years ago
gpu::getCudaEnabledDeviceCount
------------------------------
13 years ago
Returns the number of installed CUDA-enabled devices.
.. ocv:function:: int gpu::getCudaEnabledDeviceCount()
13 years ago
Use this function before any other GPU functions calls. If OpenCV is compiled without GPU support, this function returns 0.
gpu::setDevice
--------------
13 years ago
Sets a device and initializes it for the current thread.
13 years ago
.. ocv:function:: void gpu::setDevice(int device)
:param device: System index of a GPU device starting with 0.
13 years ago
If the call of this function is omitted, a default device is initialized at the fist GPU usage.
gpu::getDevice
--------------
13 years ago
Returns the current device index set by :ocv:func:`gpu::setDevice` or initialized by default.
.. ocv:function:: int gpu::getDevice()
13 years ago
gpu::resetDevice
----------------
13 years ago
Explicitly destroys and cleans up all resources associated with the current device in the current process.
.. ocv:function:: void gpu::resetDevice()
Any subsequent API call to this device will reinitialize the device.
gpu::FeatureSet
---------------
Enumeration providing GPU computing features.
.. ocv:enum:: gpu::FeatureSet
.. ocv:emember:: FEATURE_SET_COMPUTE_10
.. ocv:emember:: FEATURE_SET_COMPUTE_11
.. ocv:emember:: FEATURE_SET_COMPUTE_12
.. ocv:emember:: FEATURE_SET_COMPUTE_13
.. ocv:emember:: FEATURE_SET_COMPUTE_20
.. ocv:emember:: FEATURE_SET_COMPUTE_21
.. ocv:emember:: GLOBAL_ATOMICS
.. ocv:emember:: SHARED_ATOMICS
.. ocv:emember:: NATIVE_DOUBLE
13 years ago
gpu::TargetArchs
----------------
.. ocv:class:: gpu::TargetArchs
Class providing 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:
.. ocv:function:: static bool gpu::TargetArchs::builtWith( FeatureSet feature_set )
13 years ago
:param feature_set: Features to be checked. See :ocv:enum:`gpu::FeatureSet`.
13 years ago
There is a set of methods to check whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
.. ocv:function:: static bool gpu::TargetArchs::has(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasPtx(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasBin(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasEqualOrLessPtx(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasEqualOrGreater(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasEqualOrGreaterPtx(int major, int minor)
.. ocv:function:: static bool gpu::TargetArchs::hasEqualOrGreaterBin(int major, int minor)
:param 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".
gpu::DeviceInfo
---------------
.. ocv:class:: gpu::DeviceInfo
13 years ago
Class providing functionality for querying the specified GPU properties. ::
class CV_EXPORTS DeviceInfo
{
public:
DeviceInfo();
DeviceInfo(int device_id);
String name() const;
int majorVersion() const;
int minorVersion() const;
int multiProcessorCount() const;
size_t freeMemory() const;
size_t totalMemory() const;
13 years ago
bool supports(FeatureSet feature) const;
bool isCompatible() const;
13 years ago
int deviceID() const;
};
gpu::DeviceInfo::DeviceInfo
---------------------------
13 years ago
The constructors.
.. ocv:function:: gpu::DeviceInfo::DeviceInfo()
.. ocv:function:: gpu::DeviceInfo::DeviceInfo(int device_id)
:param device_id: System index of the GPU device starting with 0.
13 years ago
Constructs the ``DeviceInfo`` object for the specified device. If ``device_id`` parameter is missed, it constructs an object for the current device.
gpu::DeviceInfo::name
---------------------
13 years ago
Returns the device name.
.. ocv:function:: String gpu::DeviceInfo::name() const
gpu::DeviceInfo::majorVersion
-----------------------------
13 years ago
Returns the major compute capability version.
.. ocv:function:: int gpu::DeviceInfo::majorVersion()
gpu::DeviceInfo::minorVersion
-----------------------------
13 years ago
Returns the minor compute capability version.
.. ocv:function:: int gpu::DeviceInfo::minorVersion()
gpu::DeviceInfo::multiProcessorCount
------------------------------------
13 years ago
Returns the number of streaming multiprocessors.
.. ocv:function:: int gpu::DeviceInfo::multiProcessorCount()
gpu::DeviceInfo::freeMemory
---------------------------
13 years ago
Returns the amount of free memory in bytes.
.. ocv:function:: size_t gpu::DeviceInfo::freeMemory()
gpu::DeviceInfo::totalMemory
----------------------------
13 years ago
Returns the amount of total memory in bytes.
.. ocv:function:: size_t gpu::DeviceInfo::totalMemory()
gpu::DeviceInfo::supports
-------------------------
13 years ago
Provides information on GPU feature support.
.. ocv:function:: bool gpu::DeviceInfo::supports( FeatureSet feature_set ) const
:param feature_set: Features to be checked. See :ocv:enum:`gpu::FeatureSet`.
13 years ago
This function returns ``true`` if the device has the specified GPU feature. Otherwise, it returns ``false`` .
13 years ago
gpu::DeviceInfo::isCompatible
-----------------------------
13 years ago
Checks the GPU module and device compatibility.
13 years ago
.. ocv:function:: bool gpu::DeviceInfo::isCompatible()
13 years ago
This function returns ``true`` if the GPU module can be run on the specified device. Otherwise, it returns ``false`` .
13 years ago
gpu::DeviceInfo::deviceID
-------------------------
13 years ago
Returns system index of the GPU device starting with 0.
13 years ago
.. ocv:function:: int gpu::DeviceInfo::deviceID()