SetAddrWithOffset

Product Support

Product

Supported

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

Atlas training products

Function

Sets the tensor address with an offset. It is used to quickly obtain and define a tensor and specify the offset of the new tensor relative to the start address of the old tensor. The offset length is the number of elements of the old tensor.

Prototype

1
2
template <typename S>
__aicore__ inline void SetAddrWithOffset(LocalTensor<S> &src, uint32_t offset)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

src

Input

Base address tensor. The address of this tensor is used as the base address, and the offset is applied to obtain the new tensor address.

offset

Input

Offset length, in elements.

Returns

None

Restrictions

None

Example

For details, see Example.