ClassesClassesClassesClasses | | | | Operators

query_available_compute_devicesT_query_available_compute_devicesQueryAvailableComputeDevicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevices (Operator)

Name

query_available_compute_devicesT_query_available_compute_devicesQueryAvailableComputeDevicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevices — Get the list of available compute devices.

Signature

query_available_compute_devices( : : : DeviceIdentifier)

Herror T_query_available_compute_devices(Htuple* DeviceIdentifier)

Herror query_available_compute_devices(HTuple* DeviceIdentifier)

HTuple HComputeDevice::QueryAvailableComputeDevices()

void QueryAvailableComputeDevices(HTuple* DeviceIdentifier)

static HTuple HComputeDevice::QueryAvailableComputeDevices()

void HOperatorSetX.QueryAvailableComputeDevices([out] VARIANT* DeviceIdentifier)

VARIANT HComputeDeviceX.QueryAvailableComputeDevices()

static void HOperatorSet.QueryAvailableComputeDevices(out HTuple deviceIdentifier)

static HTuple HComputeDevice.QueryAvailableComputeDevices()

Description

Returns the list of available compute devices. Use get_compute_device_infoget_compute_device_infoGetComputeDeviceInfoget_compute_device_infoGetComputeDeviceInfoGetComputeDeviceInfo to query information on a specific device. Use open_compute_deviceopen_compute_deviceOpenComputeDeviceopen_compute_deviceOpenComputeDeviceOpenComputeDevice to open a device in HALCON.

At present, HALCON only supports OpenCL compatible GPUs supporting the OpenCL extension cl_khr_byte_addressable_store and image objects. A list of compatible NVIDIA cards can be found here: http://www.nvidia.com/object/cuda_learn_products.html. ATI/AMD cards of the Radeon HD 5000 series or newer are supported.

Be aware that currently it is not possible to use OpenCL via the Windows Remote Desktop, because Windows Remote Desktop does not allow access to the graphics driver. You may use a VNC solution to use OpenCL on a remote computer. Of course you can use OpenCL via ssh on a Linux machine.

It is recommended to install the latest graphics drivers available for your GPU. To access the GPU on a Linux system you should be member of the 'video' group.

Parallelization

Parameters

DeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierdeviceIdentifier (output_control)  integer-array HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

List of available compute devices.

Example (HDevelop)

query_available_compute_devices (DeviceIdentifiers)
for Index := 0 to |DeviceIdentifiers|-1 by 1
    get_compute_device_info (DeviceIdentifiers[Index], 'name', DeviceName)
    get_compute_device_info (DeviceIdentifiers[Index], 'vendor', DeviceVendor)
    if (DeviceVendor == 'NVIDIA Corporation' and \
        DeviceName == 'GeForce 8800 Ultra')
        open_compute_device (DeviceIdentifiers[Index], DeviceHandle)
        break
    endif
endfor
*
init_compute_device (DeviceHandle, 'derivate_gauss')
read_image (Image, 'rings_and_nuts')
*
* Gaussian convolution on a compute device
activate_compute_device (DeviceHandle)
derivate_gauss (Image, DerivGauss, 5, 'none')
*
* Gaussian convolution on the CPU
deactivate_compute_device (DeviceHandle)
derivate_gauss (Image, DerivGauss, 5, 'none')

Result

query_available_compute_devicesquery_available_compute_devicesQueryAvailableComputeDevicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevices returns the value 2 (H_MSG_TRUE).

Possible Successors

get_compute_device_infoget_compute_device_infoGetComputeDeviceInfoget_compute_device_infoGetComputeDeviceInfoGetComputeDeviceInfo, open_compute_deviceopen_compute_deviceOpenComputeDeviceopen_compute_deviceOpenComputeDeviceOpenComputeDevice

Module

Foundation


ClassesClassesClassesClasses | | | | Operators