ClassesClasses | | Operators

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDevice (Operator)

Name

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDevice — Activate a compute device.

Signature

activate_compute_device( : : DeviceHandle : )

Herror activate_compute_device(const Hlong DeviceHandle)

Herror T_activate_compute_device(const Htuple DeviceHandle)

void ActivateComputeDevice(const HTuple& DeviceHandle)

void HComputeDevice::ActivateComputeDevice() const

static void HOperatorSet.ActivateComputeDevice(HTuple deviceHandle)

void HComputeDevice.ActivateComputeDevice()

Description

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDevice activates the compute device DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle for the current HALCON thread. All subsequent HALCON operators called in this thread are executed on DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle if they provide an implementation (see get_operator_infoget_operator_infoGetOperatorInfoGetOperatorInfoGetOperatorInfo) for this device. Use deactivate_compute_devicedeactivate_compute_deviceDeactivateComputeDeviceDeactivateComputeDeviceDeactivateComputeDevice to deactivate DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle.

Currently, only one compute device can be active for a HALCON thread. If a different device is active before activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDevice is called, this device is deactivated automatically.

Execution Information

Parameters

DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle (input_control)  compute_device HComputeDevice, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Compute device handle.

Example (HDevelop)

open_compute_device (DeviceIdentifier, DeviceHandle)
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

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDevice returns the value 2 (H_MSG_TRUE) if DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle is valid. Otherwise an exception will be raised.

Possible Predecessors

open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDevice

See also

deactivate_compute_devicedeactivate_compute_deviceDeactivateComputeDeviceDeactivateComputeDeviceDeactivateComputeDevice, deactivate_all_compute_devicesdeactivate_all_compute_devicesDeactivateAllComputeDevicesDeactivateAllComputeDevicesDeactivateAllComputeDevices

Module

Foundation


ClassesClasses | | Operators