activate_compute_device🔗
説明🔗
activate_compute_device — 計算デバイスをアクティブにする。
書式🔗
activate_compute_device( compute_device DeviceHandle )
説明🔗
activate_compute_device は、現在のHALCONスレッド
の計算デバイス DeviceHandle をアクティブにします。
このスレッドでその後呼び出されるHALCONオペレーターが
このデバイス上での実行が可能な場合( get_operator_info を参照)、
それらはすべて DeviceHandle で実行されます。
DeviceHandle を非アクティブにするには、
deactivate_compute_device を使用します。
現在、計算デバイスは、HALCON スレッド1つにつき1台だけアクティブに
できます。activate_compute_device が呼び出される前に別のデバイスが
アクティブになっている場合、このデバイスは自動的に非アクティブになります。
実行情報🔗
実行情報
-
マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)
-
マルチスレッドスコープ: ローカル(同じスレッドからのみ呼び出される可能性あり)
-
並列演算処理には未対応
パラメーター🔗
DeviceHandle (input_control) 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')
結果🔗
DeviceHandle が有効な場合、activate_compute_device
は 2 (H_MSG_TRUE) の値を返します。それ以外の場合は、
例外が発生します。
他のオペレーターとの組み合わせ🔗
モジュール🔗
Foundation