2012-10-30 21:58:44 +08:00
Data Structures and Utility Functions
========================================
.. highlight :: cpp
2013-10-04 00:00:41 +08:00
ocl::getOpenCLPlatforms
-----------------------
Returns the list of OpenCL platforms
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
.. ocv:function :: int ocl::getOpenCLPlatforms( PlatformsInfo& platforms )
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
:param platforms: Output variable
ocl::getOpenCLDevices
---------------------
2012-10-30 21:58:44 +08:00
Returns the list of devices
2013-10-04 00:00:41 +08:00
.. ocv:function :: int ocl::getOpenCLDevices( DevicesInfo& devices, int deviceType = CVCL_DEVICE_TYPE_GPU, const PlatformInfo* platform = NULL )
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
:param devices: Output variable
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
:param deviceType: Bitmask of ``CVCL_DEVICE_TYPE_GPU``, ``CVCL_DEVICE_TYPE_CPU`` or ``CVCL_DEVICE_TYPE_DEFAULT``.
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
:param platform: Specifies preferrable platform
2012-10-30 21:58:44 +08:00
ocl::setDevice
2013-10-04 00:00:41 +08:00
--------------
2013-12-12 23:59:22 +08:00
Initialize OpenCL computation context
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
.. ocv:function :: void ocl::setDevice( const DeviceInfo* info )
2012-10-30 21:58:44 +08:00
2013-10-04 00:00:41 +08:00
:param info: device info
2012-10-30 21:58:44 +08:00
2013-12-12 23:59:22 +08:00
ocl::initializeContext
--------------------------------
Alternative way to initialize OpenCL computation context.
.. ocv:function :: void ocl::initializeContext(void* pClPlatform, void* pClContext, void* pClDevice)
:param pClPlatform: selected ``platform_id`` (via pointer, parameter type is ``cl_platform_id*``)
:param pClContext: selected ``cl_context`` (via pointer, parameter type is ``cl_context*``)
:param pClDevice: selected ``cl_device_id`` (via pointer, parameter type is ``cl_device_id*``)
This function can be used for context initialization with D3D/OpenGL interoperability.
2013-10-04 00:00:41 +08:00
ocl::setBinaryPath
2012-10-30 21:58:44 +08:00
------------------
Returns void
2013-10-04 00:00:41 +08:00
.. ocv:function :: void ocl::setBinaryPath(const char *path)
2012-10-30 21:58:44 +08:00
:param path: the path of OpenCL kernel binaries
If you call this function and set a valid path, the OCL module will save the compiled kernel to the address in the first time and reload the binary since that. It can save compilation time at the runtime.