GetPhyAddr

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas training product

Function Usage

Obtains the address of the global data.

Prototype

  • Obtains the address of the global data.
    1
    __aicore__ inline const __gm__ PrimType* GetPhyAddr() const
    
  • Obtains the address (offset by offset elements) of the global data.
    1
    __aicore__ inline __gm__ PrimType* GetPhyAddr(const uint64_t offset) const
    

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

offset

Input

Number of offset elements, which is used to specify the data location.

Returns

Address of the global data.

Restrictions

None

Examples

1
2
3
4
5
AscendC::LocalTensor<T> xLocal = inQueueX.DeQue<T>();
AscendC::LocalTensor<T> yLocal = outQueueY.AllocTensor<T>();
// Call GetPhyAddr() to return the LocalTensor address. On the CPU, a pointer (T*) is returned, while on the NPU, a physical storage address (uint64_t) is returned.
__ubuf__ T* srcAddr = reinterpret_cast<__ubuf__ T*>(xLocal.GetPhyAddr());
__ubuf__ T* dstAddr = reinterpret_cast<__ubuf__ T*>(yLocal.GetPhyAddr());