GetSsbufBaseAddr
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Obtains the base address of SSBuffer.
Prototype
__aicore__ inline __ssbuf__ void* GetSsbufBaseAddr()
Parameters
None
Returns
Pointer to the SSBuffer base address.
Restrictions
- Dirty data exists in the SSBuffer. When the data is read, it may not be all 0s.
- When AICs and AIVs start different tasks, SSBuffer cannot be accessed.
- An exception occurs when the address beyond the end is accessed. When running in non-MIX mode, each core can independently occupy 1 KB space (AIC, AIV0, and AIV1 each occupy 1 KB space). When running in MIX mode, each core can share the entire 3 KB space (AIC:AIV = 1:2). Currently, the value of ssbuf is 3 KB.
- Only 32-byte and 64-byte aligned access through read and write instructions is supported.
Example
1 2 3 | __ssbuf__ void* ssbuf = GetSsbufBaseAddr(); // (void*) 0 is returned in the NPU domain, and the CPU-simulated allocated address is returned in the NPU domain. AscendC::printf("Ssbuf base address pointer: %p\n", ssbuf); // %p is the format specifier for printing a pointer. In the NPU environment, the special pointer value 0 is displayed as nil. AscendC::PRINTF("Ssbuf base address pointer: %p\n", ssbuf); // The output is nil. |
Parent topic: Tool Functions