Function: host_get_device_pointer

Applicable Products

Product

Supported (√/x)

Ascend 950PR

√

Ascend 950DT

x

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

x

Atlas inference products

x

Atlas 200I/500 A2 inference products

x

Description

Obtains the device memory address registered and mapped by the acl.rt.host_register or acl.rt.host_register_v2 API. This address cannot be used for memory operations, such as memory copy.

Prototype

  • C Prototype
    1
    aclError aclrtHostGetDevicePointer(void *pHost, void **pDevice, uint32_t flag)
    
  • Python Function
    1
    ptr_device, ret =acl.rt.host_get_device_pointer (ptr_host, flag)
    

Parameters

Parameter

Description

ptr_host

Host memory address mapped and registered by calling acl.rt.host_register or acl.rt.host_register_v2.

flag

Reserved. The value is fixed at 0.

Return Values

Return Value

Description

ptr_device

Int, device memory address.

ret

Int, 0 on success; else failure.