Data Movement
data_move
Description
Moves data based on the data types of the src and dst tensors. The options are as follows:
- UB->UB
- UB->GM
- GM->UB
- GM->L1
Prototype
data_move (dst, src, sid, nburst, burst, src_stride, dst_stride, *args, **argv)
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
dst |
Output |
Destination operand. For details about the data type restrictions, see Table 12-46. If the scope of dst is the L1 Buffer or Unified Buffer, the address offset must be 32-byte aligned. |
src |
Input |
Source operand. For details about the data type restrictions, see Table 12-46. If the scope of dst is the L1 Buffer or Unified Buffer, the address offset must be 32-byte aligned. |
sid |
Input |
A scalar, an immediate, or an Expr of type int32, specifying the SMMU ID, which is hardware-related. The value range is [0, 15]. The value 0 is recommended. |
nburst |
Input |
A scalar, an immediate, or an Expr of type int32, specifying the number of the data segments to be transmitted. The value range is [1, 4095]. |
burst |
Input |
Burst length. The value range is [1, 65535], in the unit of 32 bytes. Must be a scalar of type int16/int32/int64/uint16/uint32/uint64, an immediate of type int, or an Expr of type int16/int32/int64/uint16/uint32/uint64. |
src_stride |
Input |
Burst-to-burst stride of the source tensor. The value range is [0, 65535]. Must be a scalar of type int16/int32/int64/uint16/uint32/uint64, an immediate of type int, or an Expr of type int16/int32/int64/uint16/uint32/uint64. |
dst_stride |
Input |
Burst-to-burst stride of the destination tensor. The value range is [0, 65535]. Must be a scalar of type int16/int32/int64/uint16/uint32/uint64, an immediate of type int, or an Expr of type int16/int32/int64/uint16/uint32/uint64. |
*args |
Input |
Number of extended arguments |
**argv |
Input |
Extended arguments |
src.scope |
dst.scope |
dtype (src and dst Have the Same dtype) |
burst Unit |
src_stride Unit |
dst_stride Unit |
---|---|---|---|---|---|
OUT |
L1 |
uint8, int8, float16, uint16, int16, float32, int32, uint32, uint64, int64 |
32 bytes |
32 bytes |
32 bytes |
OUT |
UB |
uint8, int8, float16, uint16, int16, float32, int32, uint32, uint64, int64 |
32 bytes |
32 bytes |
32 bytes |
UB |
OUT |
uint8, int8, float16, uint16, int16, float32, int32, uint32, uint64, int64 |
32 bytes |
32 bytes |
32 bytes |
UB |
UB |
uint8, int8, float16, uint16, int16, float32, int32, uint32, uint64, int64 |
32 bytes |
32 bytes |
32 bytes |
Restrictions
None
Returns
None
Example
from te import tik tik_instance = tik.Tik() src_ub = tik_instance.Tensor("float16", (128,), name="src_ub", scope=tik.scope_ubuf) dst_ub = tik_instance.Tensor("float16", (128,), name="dst_ub", scope=tik.scope_ubuf) tik_instance.data_move(dst_ub, src_ub, 0, 1, 128 // 16, 0, 0)