set_compute_device_paramT_set_compute_device_paramSetComputeDeviceParamSetComputeDeviceParam (Operator)

Name

set_compute_device_paramT_set_compute_device_paramSetComputeDeviceParamSetComputeDeviceParam — Setzen von Parametern eines Compute Devices.

Signatur

set_compute_device_param( : : DeviceHandle, GenParamName, GenParamValue : )

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

void SetComputeDeviceParam(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   (Nur Windows)

static void HOperatorSet.SetComputeDeviceParam(HTuple deviceHandle, HTuple genParamName, HTuple genParamValue)

void HComputeDevice.SetComputeDeviceParam(string genParamName, HTuple genParamValue)

void HComputeDevice.SetComputeDeviceParam(string genParamName, string genParamValue)

Beschreibung

set_compute_device_paramset_compute_device_paramSetComputeDeviceParamSetComputeDeviceParamSetComputeDeviceParam setzt die Parameter des Compute Devices DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle für den aktuellen HALCON Thread.

Die folgenden Parameter können gesetzt werden:

'alloc_pinned'

Wenn 'alloc_pinned' auf 'true' gesetzt ist werden die Ausgabebilder aller folgenden Operatoraufrufe (egal ob auf dem Device ausgeführt oder nicht) dieses Threads in page locked (oder 'pinned') Speicher erzeugt. Das beschleunigt den Transfer zwischen dem Hauptspeicher und dem Speicher des Devices. Zu exzessive Verwendung von page locked Speicher kann aber negativen Einfluss auf die Geschwindigkeit des Systems nehmen. 'alloc_pinned' sollte aktiviert werden, wenn das Ausgabebild des nächsten Operatoraufrufs auf das Device transferiert werden soll. Für Operatoraufrufe, deren Ausgabebilder nicht auf dem Device verwendet werden, sollte 'alloc_pinned' deaktiviert werden (siehe Beispiel).

Werte: 'true' oder 'false'

Default: 'true'

'asynchronous_execution'

Ist 'asynchronous_execution' auf 'true' gesetzt, warten Operatoren, die auf dem Device ausgeführt werden, nicht auf das Ende der Berechnungen, sondern enden, sobald die Berechnungen angestoßen wurden. Alle Berechnungen auf dem Device werden synchronisiert sobald die Ausgabe einer Device Berechnung auf der CPU benötigt wird (z.B. von disp_imagedisp_imageDispImageDispImageDispImage).

Werte: 'true' oder 'false'

Default: 'true'

'buffer_cache_capacity'

Maximale Größe (in Byte) des Compute Device Buffer Caches.

Wert: Größe in Byte

Default: 1/3 des verfügbaren Device Speichers

'image_cache_capacity'

Maximale Größe (in Byte) des Compute Device Bild Caches.

Wert: Größe in Byte

Default: 1/3 des verfügbaren Device Speichers

'pinned_mem_cache_capacity'

Maximale Größe (in Byte) des page locked Speicher Caches.

Wert: Größe in Byte

Default: 4 MByte

Ausführungsinformationen

Parameter

DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandle (input_control)  compute_device HComputeDevice, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Compute Device Handle.

GenParamNameGenParamNameGenParamNameGenParamNamegenParamName (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Name des zu setzenden Parameters.

Defaultwert: 'buffer_cache_capacity' "buffer_cache_capacity" "buffer_cache_capacity" "buffer_cache_capacity" "buffer_cache_capacity"

Werteliste: 'alloc_pinned'"alloc_pinned""alloc_pinned""alloc_pinned""alloc_pinned", 'asynchronous_execution'"asynchronous_execution""asynchronous_execution""asynchronous_execution""asynchronous_execution", 'buffer_cache_capacity'"buffer_cache_capacity""buffer_cache_capacity""buffer_cache_capacity""buffer_cache_capacity", 'image_cache_capacity'"image_cache_capacity""image_cache_capacity""image_cache_capacity""image_cache_capacity", 'pinned_mem_cache_capacity'"pinned_mem_cache_capacity""pinned_mem_cache_capacity""pinned_mem_cache_capacity""pinned_mem_cache_capacity"

GenParamValueGenParamValueGenParamValueGenParamValuegenParamValue (input_control)  string(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

Neuer Wert des Parameters.

Beispiel (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')

Ergebnis

Sind alle Parameterwerte korrekt, liefert set_compute_device_paramset_compute_device_paramSetComputeDeviceParamSetComputeDeviceParamSetComputeDeviceParam den Wert 2 (H_MSG_TRUE) zurück. Andernfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDevice

Siehe auch

get_compute_device_paramget_compute_device_paramGetComputeDeviceParamGetComputeDeviceParamGetComputeDeviceParam

Modul

Foundation