activate_compute_deviceT_activate_compute_deviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device (算子名称)

名称

activate_compute_deviceT_activate_compute_deviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device — 激活一个计算设备。

参数签名

activate_compute_device( : : 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()

def activate_compute_device(device_handle: HHandle) -> None

描述

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device activates the compute device DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle for the current HALCON thread. All subsequent HALCON operators called in this thread are executed on DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle if they provide an implementation (see get_operator_infoget_operator_infoGetOperatorInfoGetOperatorInfoGetOperatorInfoget_operator_info) for this device. Use deactivate_compute_devicedeactivate_compute_deviceDeactivateComputeDeviceDeactivateComputeDeviceDeactivateComputeDevicedeactivate_compute_device to deactivate DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle.

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

运行信息

参数表

DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle (input_control)  compute_device HComputeDevice, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Compute device handle.

例程 (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')

结果

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

可能的前置算子

open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDeviceopen_compute_device

参考其它

deactivate_compute_devicedeactivate_compute_deviceDeactivateComputeDeviceDeactivateComputeDeviceDeactivateComputeDevicedeactivate_compute_device, deactivate_all_compute_devicesdeactivate_all_compute_devicesDeactivateAllComputeDevicesDeactivateAllComputeDevicesDeactivateAllComputeDevicesdeactivate_all_compute_devices

模块

Foundation