GET_TILING_DATA_MEMBER

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

Atlas training products

x

Functions

Obtains the member variables of a tiling structure.

Prototype

1
GET_TILING_DATA_MEMBER(struct_name, mem_name, tiling_data, tiling_arg)

Parameters

Parameter

Input/Output

Description

struct_name

Input

Name of the specified structure.

mem_name

Input

Name of a specified member variable.

tiling_data

Output

Returns the member variable of the specified tiling structure.

tiling_arg

Input

Tiling parameter input by the entrypoint function of the operator.

Constraints

  • This function needs to be used in the operator kernel code, and the type of the input tiling_data parameter does not need to be declared.
  • Currently, the kernel launch project is not supported.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
extern "C" __global__ __aicore__ void add_custom(__gm__ uint8_t *x, __gm__ uint8_t *y, __gm__ uint8_t *z, __gm__ uint8_t *tiling)
{
    KernelAdd op;
    if ASCEND_IS_AIV {
        GET_TILING_DATA(tilingData, tiling);   // Vector uses the complete structure registered by the operator by default.
	op.Init(x, y, z, tilingData.totalLength, tilingData.tileNum);
        op.Process();
    } else {
        GET_TILING_DATA_MEMBER(Add_Struct, tCubeTiling, tCubeTilingVar, tiling); // Only the member variable tCubeTiling of the structure registered by the operator is used by the Cube engine.
	op.Init(x, y, z, tCubeTilingVar);
	op.Process();
    }
}