产品 |
是否支持 |
|---|---|
Ascend 950PR/Ascend 950DT |
√ |
√ |
|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
返回LocalTensor的地址或指定偏移量后的地址。
1 2 | __aicore__ inline uint64_t GetPhyAddr() const __aicore__ inline uint64_t GetPhyAddr(const uint32_t offset) const |
参数名 |
输入/输出 |
描述 |
|---|---|---|
offset |
输入 |
偏移量。 |
LocalTensor的地址或指定偏移量后的地址。
无
// 示例 // 调用GetPhyAddr()返回LocalTensor地址,CPU上返回的是指针类型(T*),NPU上返回的是物理存储的地址(uint64_t) #ifdef ASCENDC_CPU_DEBUG float *inputLocalCpuPtr = inputLocal.GetPhyAddr(); uint64_t realAddr = (uint64_t)inputLocalCpuPtr - (uint64_t)(GetTPipePtr()->GetBaseAddr(static_cast<int8_t>(AscendC::TPosition::VECCALC))); #else uint64_t realAddr = inputLocal.GetPhyAddr(); #endif