WriteGmByPassDCache(ISASI)
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
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
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. |
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); |