ReadSpmBuffer
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
√ |
|
x |
|
√ |
Function Usage
Reads data from the SPM buffer back to the local data.
Prototype
- Applicable to continuous and discontinuous data readback:
1 2
template <typename T> __aicore__ inline void ReadSpmBuffer(const LocalTensor<T>& readBuffer, const DataCopyParams& copyParams, int32_t readOffset = 0)
- Applicable to continuous temporary data readback:
1 2
template <typename T> __aicore__ inline void ReadSpmBuffer(const LocalTensor<T>& readBuffer, const int32_t readSize, int32_t readOffset = 0)
Parameters
Parameter |
Input/Output |
Meaning |
|---|---|---|
readBuffer |
Input |
Readback target local memory. |
copyParams |
Input |
Movement parameter, DataCopyParams type. For details about the structure definition of DataCopyParams, see Table 2. |
readSize |
Input |
Number of read elements. |
readOffset |
Input |
Offset of the SPM buffer, in bytes. |
Parameter |
Description |
|---|---|
blockCount |
Number of data chunks to be transferred, which is of the uint16_t type. The value range is [1, 4095]. |
blockLen |
Length of each data chunk to be transferred, in the unit of a data block (32 bytes). The value is of the uint16_t type. The value range is [1, 65535]. Notes:
|
srcGap |
Gap between adjacent data chunks of the source operand (the distance from the tail of one data chunk to the head of the next). The unit is a data block (32 bytes). The value is of the uint16_t type and must not exceed the value range of this data type. In the scenario of L1 Buffer -> Fixpipe Buffer, srcGap refers to the gap between adjacent data chunks of the source operand (the distance from the head of one data chunk to the head of the next). The unit is a data block (32 bytes). The value is of the uint16_t type and must not exceed the value range of this data type. |
dstGap |
Gap between adjacent data chunks of the destination operand (the distance from the tail of one data chunk to the head of the next). The unit is a data block (32 bytes). The value is of the uint16_t type and must not exceed the value range of this data type. Notes:
In the scenario of L1 Buffer -> Fixpipe Buffer, dstGap refers to the gap between adjacent data chunks of the source operand (the distance from the head of one data chunk to the head of the next). The unit is a data block (32 bytes). The value is of the uint16_t type and must not exceed the value range of this data type. |
Constraints
None
Returns
None
Example
For details about the calling example, see Example.