set_compute_device_param
— Set parameters of an compute device.
set_compute_device_param( : : DeviceHandle, GenParamName, GenParamValue : )
set_compute_device_param
sets parameters of the
compute device DeviceHandle
for the current HALCON thread.
The following Parameters can be set:
If 'true', the output image matrices of all operators (executed on the compute device or not) called in the current HALCON thread are created in page locked (so called 'pinned') memory. This accelerates the transfer between host and device memory. However, too excessive usage of page locked memory may have a negative impact on overall system performance. You should activate page locked memory allocation if the output image of of the next operator call is to be transferred to the device. Page locked memory allocation should be deactivated for all operator calls whose output images are not required on the compute device (see example).
value: 'true' or 'false'
default: 'true'
If 'true', operators executed on the compute device
do not wait for the device computations to finish but
return after initiating the computations.
All device computations are synchronized as soon as
the output of a compute device operation is used on
the CPU (e.g. by disp_image
).
value: 'true' or 'false'
default: 'true'
Maximum size (in bytes) of the compute device buffer cache.
value: size in bytes
default: 1/3 of the available device memory
Maximum size (in bytes) of the compute device image cache.
value: size in bytes
default: 1/3 of the available device memory
Maximum size (in bytes) of the page locked (pinned) memory cache.
value: size in bytes
default: 32 MBytes
DeviceHandle
(input_control) compute_device →
(handle)
Compute device handle.
GenParamName
(input_control) string →
(string)
Name of the parameter to set.
Default value: 'buffer_cache_capacity'
List of values: 'alloc_pinned' , 'asynchronous_execution' , 'buffer_cache_capacity' , 'image_cache_capacity' , 'pinned_mem_cache_capacity'
GenParamValue
(input_control) string(-array) →
(string / integer / real)
New parameter value.
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')
The operator set_compute_device_param
returns the
value 2 (H_MSG_TRUE) if the parameters are correct. Otherwise
an exception will be raised.
Foundation