Skip to content

set_compute_device_paramSetComputeDeviceParamSetComputeDeviceParamset_compute_device_paramT_set_compute_device_param🔗

説明🔗

set_compute_device_paramSetComputeDeviceParamSetComputeDeviceParamset_compute_device_paramT_set_compute_device_param — 計算デバイスのパラメーター値を設定する。

書式🔗

set_compute_device_param( compute_device DeviceHandle, string GenParamName, string GenParamValue )void SetComputeDeviceParam( const HTuple& DeviceHandle, const HTuple& GenParamName, const HTuple& GenParamValue )static void HOperatorSet.SetComputeDeviceParam( HTuple deviceHandle, HTuple genParamName, HTuple genParamValue )def set_compute_device_param( device_handle: HHandle, gen_param_name: str, gen_param_value: MaybeSequence[Union[str, int, float]] ) -> None

Herror T_set_compute_device_param( const Htuple DeviceHandle, const Htuple GenParamName, const Htuple GenParamValue )

void HComputeDevice::SetComputeDeviceParam( const HString& GenParamName, const HTuple& GenParamValue ) const

void HComputeDevice::SetComputeDeviceParam( const HString& GenParamName, const HString& GenParamValue ) const

void HComputeDevice::SetComputeDeviceParam( const char* GenParamName, const char* GenParamValue ) const

void HComputeDevice::SetComputeDeviceParam( const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

void HComputeDevice.SetComputeDeviceParam( string genParamName, HTuple genParamValue )

void HComputeDevice.SetComputeDeviceParam( string genParamName, string genParamValue )

説明🔗

set_compute_device_paramSetComputeDeviceParam は、現在の HALCON スレッドの計算 デバイス DeviceHandledeviceHandledevice_handle のパラメーター値を設定します。

以下のパラメーター値を設定できます。

  • 'alloc_pinned'"alloc_pinned" 'true'"true" の場合、現在の HALCON スレッドで呼び出され るすべてのオペレーターの出力画像の行列は(計算デバ イスで実行されるかどうかにかかわらず)、ページロッ ク(’ピン’)されたメモリで作成されます。 これによって、ホストとデバイスメモリ間の転送速度が 速くなります。ただし、ページロックされたメモリを使 用しすぎると、システムの全体的なパフォーマンスが低 下する場合があります。 ページロックされたメモリの割り当ては、次のオペレー ター呼び出しの出力画像をデバイスに転送する場合に有 効にしてください。 計算デバイスが出力画像を必要としないオペレーター呼 び出しに対しては、ページロックされたメモリの割り当 てを無効にする必要があります(例を参照してくださ い)。

    値:'true'"true" または 'false'"false"

    デフォルト:'true'"true"

  • 'asynchronous_execution'"asynchronous_execution" 'true'"true" の場合、計算デバイスで実行されるオペレーターは 計算の開始後、デバイス上の他の計算処理の完了を待たず に結果を返します。 デバイス上のすべての計算は、計算デバイスの出力が disp_imageDispImage などによって CPU で使用されると すぐに同期されます。

    値:'true'"true" または 'false'"false"

    デフォルト:'true'"true"

  • 'buffer_cache_capacity'"buffer_cache_capacity" 計算デバイスのバッファキャッシュの最大サイズ(バイト)

    値:サイズ(バイト)

    デフォルト:利用可能なデバイスメモリの 1/3

  • 'image_cache_capacity'"image_cache_capacity" 計算デバイスの画像キャッシュの最大サイズ(バイト)

    値:サイズ(バイト)

    デフォルト:利用可能なデバイスメモリの 1/3

  • 'pinned_mem_cache_capacity'"pinned_mem_cache_capacity" ページロック(ピン)されたメモリキャッシュの最大サ イズ(バイト)

    値:サイズ(バイト)

    デフォルト:3200000032000000 (32MByte) (メガバイト)

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: ローカル(同じスレッドからのみ呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

DeviceHandledeviceHandledevice_handle (input_control) compute_device → (handle)HTuple (HHandle)HComputeDevice, HTuple (IntPtr)HHandleHtuple (handle)

計算デバイスのハンドル

GenParamNamegenParamNamegen_param_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

設定するパラメーター名

初期値: 'buffer_cache_capacity'"buffer_cache_capacity"
値のリスト: 'alloc_pinned', 'asynchronous_execution', 'buffer_cache_capacity', 'image_cache_capacity', 'pinned_mem_cache_capacity'"alloc_pinned", "asynchronous_execution", "buffer_cache_capacity", "image_cache_capacity", "pinned_mem_cache_capacity"

GenParamValuegenParamValuegen_param_value (input_control) string(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[str, int, float]]Htuple (char* / Hlong / double)

新しいパラメーター値

例🔗

(HDevelop)


activate_compute_device (DeviceHandle)
read_image (Image, 'fuse')
set_compute_device_param (DeviceHandle, 'alloc_pinned', 'true')
* filter on compute device, output image is page locked
derivate_gauss (Image, DerivGauss, 3, 'gradient')
* filter result on the CPU, output image should not be page locked
set_compute_device_param (DeviceHandle, 'alloc_pinned', 'false')
median_image (DerivGauss, ImageMedian, 'circle', 1, 'mirrored')

結果🔗

パラメーターが正しければ、オペレーター set_compute_device_paramSetComputeDeviceParam は値 2 (H_MSG_TRUE) を返します。さもなければ、 例外処理が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

activate_compute_deviceActivateComputeDevice

関連項目

get_compute_device_paramGetComputeDeviceParam

モジュール🔗

Foundation