GetCurAddr

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

x

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas training product

x

Function Usage

Returns the starting address of the currently free physical location.

Prototype

1
2
template <Hardware hard>
__aicore__ inline uint32_t LocalMemAllocator<hard>::GetCurAddr() const

Parameters

None

Returns

Starting address of the currently free physical location. The value range is [0, Maximum size of the physical memory).

Constraints

None

Example

1
2
3
LocalMemAllocator allocator;
// The default physical location is UB. Because the allocation starts from address 0, the following print result is 0.
AscendC::printf("current addr is %u\n", allocator.GetCurAddr());