DataCachePreload

Supported Products

Product

Supported/Unsupported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference product's AI Core

Atlas inference product's Vector Core

x

Atlas training products

x

Function Usage

Preloads data from the specific GM address where the source address is located to the data cache.

Prototype

1
2
template <typename T>
__aicore__ inline void DataCachePreload(const GlobalTensor<uint64_t>& src, const T cacheOffset)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

src

Input

Source operand of the GlobalTensor type. The supported data type is uint64_t.

cacheOffset

Input

Load data by offsetting cacheOffset on the source operand. The unit is byte. The supported data type is int16_t or int64_t.

Returns

None

Constraints

Frequent calls to this API may cause congestion in the reservation station. In this case, this instruction is regarded as a NOP instruction, which blocks the scalar pipeline. Therefore, you are not advised to call this API frequently.

Example

1
2
3
AscendC::GlobalTensor<uint64_t> srcGlobal;
int64_t cacheOffset = 0;
AscendC::DataCachePreload(srcGlobal, cacheOffset);