aclrtHostGetDevicePointer

Applicable Products

Product

Supported

Ascend 950PR

√

Ascend 950DT

☓

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

☓

Atlas inference products

☓

Atlas training products

☓

Function

Obtains the device memory address registered and mapped using aclrtHostRegister.

This is an encapsulated API that applies only to C++ programs. It internally calls the C API aclrtHostGetDevicePointer.

Prototype

1
2
template <typename T>
aclError aclrtHostGetDevicePointer(T *pHost, T **pDevice, uint32_t flag)

Parameters

Parameter

Input/Output

Description

pHost

Input

Host memory address registered and mapped by aclrtHostRegister.

pDevice

Output

Device memory address mapped from the host memory.

flag

Input

Reserved. The value is fixed at 0.

Returns

0 on success; otherwise, failure. For details, see aclError.