WriteGmByPassDCache(ISASI)

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

x

Atlas A2 training product/Atlas A2 inference product

x

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

Writes data to the global memory address without passing through the DCache.

When multiple cores operate the global memory address, if the data cannot be aligned to the cache line, random overwriting of multi-core data may occur because data is read and written based on the cache line size when the DCache is used. In this case, you can directly read and write the global memory address without using the DCache to avoid random overwriting.

Prototype

1
2
template <typename T>
__aicore__ inline void WriteGmByPassDCache(__gm__ T* addr, T value)

Parameters

Table 1 Template parameters

Parameter

Description

T

Operand data type.

For the Atlas 350 Accelerator Card, the supported data types are int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, and uint64_t.

Table 2 API parameters

Parameter

Input/Output

Meaning

addr

Input

Target global memory address.

value

Input

Target data to be written.

Returns

None

Constraints

None

Example

1
2
3
__gm__ int32_t* addr = dstGlobal.GetPhyAddr();
int32_t value = 2;
WriteGmByPassDCache(addr, value);