Skip to content

init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_deviceT_init_compute_device🔗

Short description🔗

init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_deviceT_init_compute_device — Initialize a compute device.

Signature🔗

init_compute_device( compute_device DeviceHandle, string Operators )void InitComputeDevice( const HTuple& DeviceHandle, const HTuple& Operators )static void HOperatorSet.InitComputeDevice( HTuple deviceHandle, HTuple operators )def init_compute_device( device_handle: HHandle, operators: Sequence[str] ) -> None

Herror T_init_compute_device( const Htuple DeviceHandle, const Htuple Operators )

void HComputeDevice::InitComputeDevice( const HTuple& Operators ) const

void HComputeDevice.InitComputeDevice( HTuple operators )

Description🔗

init_compute_deviceInitComputeDevice initializes a compute device and prepares a list of operators given in Operatorsoperatorsoperators for the execution on this device. Further the device is activated for the current thread. If init_compute_deviceInitComputeDevice is not called or operators other than those in Operatorsoperatorsoperators are used on the device, the initialization is performed on demand.

Use get_operator_infoGetOperatorInfo to test if an operator qualifies for execution on the compute device.

Attention🔗

Be aware that the execution time of init_compute_deviceInitComputeDevice depends on the number of Operatorsoperatorsoperators and may last up to several seconds.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: local (may only be called from the same thread in which the window, model, or tool instance was created).

  • Processed without parallelization.

Parameters🔗

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

Compute device handle.

Operatorsoperatorsoperators (input_control) string-array → (string)HTuple (HString)HTuple (string)Sequence[str]Htuple (char*)

List of operators to prepare.

Default: 'all'"all"
List of values: 'all', 'derivate_gauss', 'sobel_amp'"all", "derivate_gauss", "sobel_amp"

Result🔗

The operator init_compute_deviceInitComputeDevice returns the value 2 (H_MSG_TRUE) if the initialization was successful. Otherwise an exception will be raised.

Combinations with other operators🔗

Combinations

Possible predecessors

query_available_compute_devicesQueryAvailableComputeDevices, open_compute_deviceOpenComputeDevice

Possible successors

activate_compute_deviceActivateComputeDevice

Module🔗

Foundation