open_compute_deviceT_open_compute_deviceOpenComputeDeviceOpenComputeDeviceopen_compute_device (算子)

名称

open_compute_deviceT_open_compute_deviceOpenComputeDeviceOpenComputeDeviceopen_compute_device — 打开计算设备。

签名

open_compute_device( : : DeviceIdentifier : DeviceHandle)

Herror T_open_compute_device(const Htuple DeviceIdentifier, Htuple* DeviceHandle)

void OpenComputeDevice(const HTuple& DeviceIdentifier, HTuple* DeviceHandle)

void HComputeDevice::HComputeDevice(Hlong DeviceIdentifier)

void HComputeDevice::OpenComputeDevice(Hlong DeviceIdentifier)

static void HOperatorSet.OpenComputeDevice(HTuple deviceIdentifier, out HTuple deviceHandle)

public HComputeDevice(int deviceIdentifier)

void HComputeDevice.OpenComputeDevice(int deviceIdentifier)

def open_compute_device(device_identifier: int) -> HHandle

描述

open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDeviceopen_compute_device opens the compute device referenced by DeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierdeviceIdentifierdevice_identifier and returns DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle. Enable computation on DeviceHandleDeviceHandleDeviceHandleDeviceHandledeviceHandledevice_handle via activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device

DeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierdeviceIdentifierdevice_identifier must be obtained by query_available_compute_devicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesquery_available_compute_devices

执行信息

此算子返回一个句柄。请注意,即使该句柄被用作特定算子的输入参数,这些算子仍可能改变此句柄类型的实例状态。

参数

DeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierdeviceIdentifierdevice_identifier (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Compute device Identifier.

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

计算设备句柄。

结果

open_compute_deviceopen_compute_deviceOpenComputeDeviceOpenComputeDeviceOpenComputeDeviceopen_compute_device 返回值 2 ( H_MSG_TRUE) if DeviceIdentifierDeviceIdentifierDeviceIdentifierDeviceIdentifierdeviceIdentifierdevice_identifier is valid.否则将抛出异常。

可能的前趋

query_available_compute_devicesquery_available_compute_devicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesQueryAvailableComputeDevicesquery_available_compute_devices

可能的后继

activate_compute_deviceactivate_compute_deviceActivateComputeDeviceActivateComputeDeviceActivateComputeDeviceactivate_compute_device, init_compute_deviceinit_compute_deviceInitComputeDeviceInitComputeDeviceInitComputeDeviceinit_compute_device

模块

基础