init_compute_deviceT_init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_device (算子)

名称

init_compute_deviceT_init_compute_deviceInitComputeDeviceInitComputeDeviceinit_compute_device — 初始化计算设备。

签名

init_compute_device( : : DeviceHandle, 算子 : )

Herror T_init_compute_device(const Htuple DeviceHandle, const Htuple 算子)

void InitComputeDevice(const HTuple& DeviceHandle, const HTuple& 算子)

void HComputeDevice::InitComputeDevice(const HTuple& 算子) const

static void HOperatorSet.InitComputeDevice(HTuple deviceHandle, HTuple 算子)

void HComputeDevice.InitComputeDevice(HTuple 算子)

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

描述

init_compute_deviceinit_compute_deviceInitComputeDeviceInitComputeDeviceInitComputeDeviceinit_compute_device initializes a compute device and prepares a list of operators given in 算子算子算子算子算子算子 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 算子算子算子算子算子算子 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 算子算子算子算子算子算子 and may last up to several seconds.

执行信息

参数

DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle (输入控制)  compute_device HComputeDevice, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

计算设备句柄。

算子算子算子算子算子算子 (输入控制)  string-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

List of operators to prepare.

默认值: 'all' "all" "all" "all" "all" "all"

值列表: '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 返回值 2 ( H_MSG_TRUE) if the initialization was successful.否则将抛出异常。

可能的前趋

query_available_compute_devicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesquery_available_compute_devices, open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDeviceopen_compute_device

可能的后继

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device

模块

基础