init_compute_deviceT_init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_device (算子名称)

名称

init_compute_deviceT_init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_device — Initialize a compute device.

参数签名

init_compute_device( : : DeviceHandle, Operators : )

Herror T_init_compute_device(const Htuple DeviceHandle, const Htuple Operators)

void InitComputeDevice(const HTuple& DeviceHandle, const HTuple& Operators)

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

static void HOperatorSet.InitComputeDevice(HTuple deviceHandle, HTuple operators)

void HComputeDevice.InitComputeDevice(HTuple operators)

def init_compute_device(device_handle: HHandle, operators: Sequence[str]) -> None

描述

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

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

注意

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

运行信息

参数表

DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle (input_control)  compute_device HComputeDevice, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Compute device handle.

OperatorsOperatorsOperatorsOperatorsoperatorsoperators (input_control)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

List of operators to prepare.

Default: 'all' "all" "all" "all" "all" "all"

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

结果

该算子 init_compute_deviceinit_compute_deviceInitComputeDeviceInitComputeDeviceInitComputeDeviceinit_compute_device returns the value 2 ( H_MSG_TRUE) if the initialization was successful. Otherwise an exception will be raised.

可能的前置算子

query_available_compute_devicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesquery_available_compute_devices, open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDeviceopen_compute_device

可能的后置算子

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device

模块

Foundation