Memory Functions¶
okk_bdc_32bit_cpy¶
-
void okk_bdc_32bit_cpy(local_addr_t dst_addr, local_addr_t src_addr, const dim4 *shape, const dim4 *dst_stride, const dim4 *src_stride)
Copy the elements of the source tensor to the destination tensor for 32-bit data type.
\[dst(n, c, h, w) = src(n, c, h, w)\]- Parameters
dst_addr – Address of the destination tensor.
src_addr – Address of the source tensor.
shape – Pointer to the shape of the destination tensor.
dst_stride – Pointer to the stride of the destination tensor.
src_stride – Pointer to the stride of the source tensor.
Remarks
The data type of the destination and source tensor is 32-bit.
The destination and source tensors start at the same NPU.
dst_addr and src_addr are divisible by 4 and preferred by 128.
shape->n, shape->h and shape->w are in [1, 65535], shape->c is in [1, 4095].
If dst_stride or src_stride is NULL, the relative tensor is in the 128-Byte Aligned Layout.
okk_bdc_32bit_set_C¶
-
void okk_bdc_32bit_set_C(local_addr_t dst_addr, x32 C, const dim4 *shape, const dim4 *dst_stride)
Set all the elements of the destination tensor to be a constant value for 32-bit data type.
\[dst(n, c, h, w) = C\]- Parameters
dst_addr – Address of the destination tensor.
shape – Pointer to the shape of the destination tensor.
dst_stride – Pointer to the stride of the destination tensor.
Remarks
The data type of the destination tensor is 32-bit.
dst_addr is divisible by 4 and preferred by 128.
shape->n, shape->h and shape->w are in [1, 65535], shape->c is in [1, 4095].
If dst_stride is NULL, the destination tensor is in the 128-Byte Aligned Layout.